| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 8 #if defined(TARGET_ARCH_X64) | 8 #if defined(TARGET_ARCH_X64) |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 } else if (opcode == 0x57) { | 1280 } else if (opcode == 0x57) { |
| 1281 mnemonic = "xorpd"; | 1281 mnemonic = "xorpd"; |
| 1282 } else if (opcode == 0x2E) { | 1282 } else if (opcode == 0x2E) { |
| 1283 mnemonic = "ucomisd"; | 1283 mnemonic = "ucomisd"; |
| 1284 } else if (opcode == 0x2F) { | 1284 } else if (opcode == 0x2F) { |
| 1285 mnemonic = "comisd"; | 1285 mnemonic = "comisd"; |
| 1286 } else if (opcode == 0xFE) { | 1286 } else if (opcode == 0xFE) { |
| 1287 mnemonic = "paddd"; | 1287 mnemonic = "paddd"; |
| 1288 } else if (opcode == 0xFA) { | 1288 } else if (opcode == 0xFA) { |
| 1289 mnemonic = "psubd"; | 1289 mnemonic = "psubd"; |
| 1290 } else if (opcode == 0x58) { |
| 1291 mnemonic = "addpd"; |
| 1292 } else if (opcode == 0x5C) { |
| 1293 mnemonic = "subpd"; |
| 1294 } else if (opcode == 0x59) { |
| 1295 mnemonic = "mulpd"; |
| 1296 } else if (opcode == 0x5E) { |
| 1297 mnemonic = "divpd"; |
| 1298 } else if (opcode == 0x5D) { |
| 1299 mnemonic = "minpd"; |
| 1300 } else if (opcode == 0x5F) { |
| 1301 mnemonic = "maxpd"; |
| 1302 } else if (opcode == 0x51) { |
| 1303 mnemonic = "sqrtpd"; |
| 1304 } else if (opcode == 0x5A) { |
| 1305 mnemonic = "cvtpd2ps"; |
| 1290 } else { | 1306 } else { |
| 1291 UnimplementedInstruction(); | 1307 UnimplementedInstruction(); |
| 1292 } | 1308 } |
| 1293 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); | 1309 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); |
| 1294 current += PrintRightXMMOperand(current); | 1310 current += PrintRightXMMOperand(current); |
| 1295 } | 1311 } |
| 1296 } | 1312 } |
| 1297 } else if (group_1_prefix_ == 0xF2) { | 1313 } else if (group_1_prefix_ == 0xF2) { |
| 1298 // Beginning of instructions with prefix 0xF2. | 1314 // Beginning of instructions with prefix 0xF2. |
| 1299 | 1315 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 // Convert scalar single-precision FP to scalar double-precision FP. | 1388 // Convert scalar single-precision FP to scalar double-precision FP. |
| 1373 int mod, regop, rm; | 1389 int mod, regop, rm; |
| 1374 get_modrm(*current, &mod, ®op, &rm); | 1390 get_modrm(*current, &mod, ®op, &rm); |
| 1375 AppendToBuffer("cvtss2sd %s,", NameOfXMMRegister(regop)); | 1391 AppendToBuffer("cvtss2sd %s,", NameOfXMMRegister(regop)); |
| 1376 current += PrintRightXMMOperand(current); | 1392 current += PrintRightXMMOperand(current); |
| 1377 } else if (opcode == 0x7E) { | 1393 } else if (opcode == 0x7E) { |
| 1378 int mod, regop, rm; | 1394 int mod, regop, rm; |
| 1379 get_modrm(*current, &mod, ®op, &rm); | 1395 get_modrm(*current, &mod, ®op, &rm); |
| 1380 AppendToBuffer("movq %s, ", NameOfXMMRegister(regop)); | 1396 AppendToBuffer("movq %s, ", NameOfXMMRegister(regop)); |
| 1381 current += PrintRightXMMOperand(current); | 1397 current += PrintRightXMMOperand(current); |
| 1398 } else if (opcode == 0x58) { |
| 1399 int mod, regop, rm; |
| 1400 get_modrm(*current, &mod, ®op, &rm); |
| 1401 AppendToBuffer("addss %s,", NameOfXMMRegister(regop)); |
| 1402 current += PrintRightXMMOperand(current); |
| 1382 } else { | 1403 } else { |
| 1383 UnimplementedInstruction(); | 1404 UnimplementedInstruction(); |
| 1384 } | 1405 } |
| 1385 } else if (opcode == 0x1F) { | 1406 } else if (opcode == 0x1F) { |
| 1386 // NOP | 1407 // NOP |
| 1387 int mod, regop, rm; | 1408 int mod, regop, rm; |
| 1388 get_modrm(*current, &mod, ®op, &rm); | 1409 get_modrm(*current, &mod, ®op, &rm); |
| 1389 current++; | 1410 current++; |
| 1390 if (rm == 4) { // SIB byte present. | 1411 if (rm == 4) { // SIB byte present. |
| 1391 current++; | 1412 current++; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 case 0xAF: | 1566 case 0xAF: |
| 1546 return "imul"; | 1567 return "imul"; |
| 1547 case 0xB6: | 1568 case 0xB6: |
| 1548 return "movzxb"; | 1569 return "movzxb"; |
| 1549 case 0xB7: | 1570 case 0xB7: |
| 1550 return "movzxw"; | 1571 return "movzxw"; |
| 1551 case 0xBE: | 1572 case 0xBE: |
| 1552 return "movsxb"; | 1573 return "movsxb"; |
| 1553 case 0xBF: | 1574 case 0xBF: |
| 1554 return "movsxw"; | 1575 return "movsxw"; |
| 1576 case 0x12: |
| 1577 return "movhlps"; |
| 1578 case 0x16: |
| 1579 return "movlhps"; |
| 1555 default: | 1580 default: |
| 1556 return NULL; | 1581 return NULL; |
| 1557 } | 1582 } |
| 1558 } | 1583 } |
| 1559 | 1584 |
| 1560 | 1585 |
| 1561 int DisassemblerX64::InstructionDecode(uword pc) { | 1586 int DisassemblerX64::InstructionDecode(uword pc) { |
| 1562 uint8_t* data = reinterpret_cast<uint8_t*>(pc); | 1587 uint8_t* data = reinterpret_cast<uint8_t*>(pc); |
| 1563 | 1588 |
| 1564 const bool processed = DecodeInstructionType(&data); | 1589 const bool processed = DecodeInstructionType(&data); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 pc); | 1964 pc); |
| 1940 pc += instruction_length; | 1965 pc += instruction_length; |
| 1941 } | 1966 } |
| 1942 | 1967 |
| 1943 return; | 1968 return; |
| 1944 } | 1969 } |
| 1945 | 1970 |
| 1946 } // namespace dart | 1971 } // namespace dart |
| 1947 | 1972 |
| 1948 #endif // defined TARGET_ARCH_X64 | 1973 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |