| 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_IA32) | 8 #if defined(TARGET_ARCH_IA32) |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 case 0x14: return "unpcklps"; | 230 case 0x14: return "unpcklps"; |
| 231 case 0x15: return "unpckhps"; | 231 case 0x15: return "unpckhps"; |
| 232 case 0x16: return "movlhps"; | 232 case 0x16: return "movlhps"; |
| 233 case 0xA2: return "cpuid"; | 233 case 0xA2: return "cpuid"; |
| 234 case 0x31: return "rdtsc"; | 234 case 0x31: return "rdtsc"; |
| 235 case 0xBE: return "movsx_b"; | 235 case 0xBE: return "movsx_b"; |
| 236 case 0xBF: return "movsx_w"; | 236 case 0xBF: return "movsx_w"; |
| 237 case 0xB6: return "movzx_b"; | 237 case 0xB6: return "movzx_b"; |
| 238 case 0xB7: return "movzx_w"; | 238 case 0xB7: return "movzx_w"; |
| 239 case 0xAF: return "imul"; | 239 case 0xAF: return "imul"; |
| 240 case 0xA4: // Fall through. |
| 240 case 0xA5: return "shld"; | 241 case 0xA5: return "shld"; |
| 242 case 0xAC: // Fall through. |
| 241 case 0xAD: return "shrd"; | 243 case 0xAD: return "shrd"; |
| 242 case 0xAB: return "bts"; | 244 case 0xAB: return "bts"; |
| 243 case 0xBD: return "bsr"; | 245 case 0xBD: return "bsr"; |
| 244 case 0xB1: return "cmpxchg"; | 246 case 0xB1: return "cmpxchg"; |
| 245 case 0x50: return "movmskps"; | 247 case 0x50: return "movmskps"; |
| 246 case 0x51: return "sqrtps"; | 248 case 0x51: return "sqrtps"; |
| 247 case 0x52: return "rqstps"; | 249 case 0x52: return "rqstps"; |
| 248 case 0x53: return "rcpps"; | 250 case 0x53: return "rcpps"; |
| 249 case 0x54: return "andps"; | 251 case 0x54: return "andps"; |
| 250 case 0x56: return "orps"; | 252 case 0x56: return "orps"; |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 *(data+3) == 0x00 && | 1404 *(data+3) == 0x00 && |
| 1403 *(data+3) == 0x00 && | 1405 *(data+3) == 0x00 && |
| 1404 *(data+4) == 0x00) { | 1406 *(data+4) == 0x00) { |
| 1405 Print("nop"); | 1407 Print("nop"); |
| 1406 data += 8; | 1408 data += 8; |
| 1407 } else { | 1409 } else { |
| 1408 UNIMPLEMENTED(); | 1410 UNIMPLEMENTED(); |
| 1409 } | 1411 } |
| 1410 } else { | 1412 } else { |
| 1411 data += 2; | 1413 data += 2; |
| 1412 if (f0byte == 0xAB || f0byte == 0xA5 || f0byte == 0xAD) { | 1414 if (f0byte == 0xAB || f0byte == 0xA4 || f0byte == 0xA5 || |
| 1415 f0byte == 0xAC || f0byte == 0xAD) { |
| 1413 // shrd, shld, bts | 1416 // shrd, shld, bts |
| 1414 Print(f0mnem); | 1417 Print(f0mnem); |
| 1415 int mod, regop, rm; | 1418 int mod, regop, rm; |
| 1416 GetModRm(*data, &mod, ®op, &rm); | 1419 GetModRm(*data, &mod, ®op, &rm); |
| 1417 Print(" "); | 1420 Print(" "); |
| 1418 data += PrintRightOperand(data); | 1421 data += PrintRightOperand(data); |
| 1422 Print(","); |
| 1423 PrintCPURegister(regop); |
| 1419 if (f0byte == 0xAB) { | 1424 if (f0byte == 0xAB) { |
| 1420 Print(","); | 1425 // Done. |
| 1421 PrintCPURegister(regop); | 1426 } else if (f0byte == 0xA5 || f0byte == 0xAD) { |
| 1427 Print(",cl"); |
| 1422 } else { | 1428 } else { |
| 1423 Print(","); | 1429 Print(", "); |
| 1424 PrintCPURegister(regop); | 1430 PrintInt(*(data++)); |
| 1425 Print(",cl"); | |
| 1426 } | 1431 } |
| 1427 } else if ((f0byte == 0x10) || (f0byte == 0x11) || | 1432 } else if ((f0byte == 0x10) || (f0byte == 0x11) || |
| 1428 IsTwoXmmRegInstruction(f0byte)) { | 1433 IsTwoXmmRegInstruction(f0byte)) { |
| 1429 data = SSEInstruction(0x0F, f0byte, data); | 1434 data = SSEInstruction(0x0F, f0byte, data); |
| 1430 } else if (f0byte == 0x50) { | 1435 } else if (f0byte == 0x50) { |
| 1431 Print("movmskps "); | 1436 Print("movmskps "); |
| 1432 int mod, regop, rm; | 1437 int mod, regop, rm; |
| 1433 GetModRm(*data, &mod, ®op, &rm); | 1438 GetModRm(*data, &mod, ®op, &rm); |
| 1434 PrintCPURegister(regop); | 1439 PrintCPURegister(regop); |
| 1435 Print(","); | 1440 Print(","); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1870 pc); | 1875 pc); |
| 1871 pc += instruction_length; | 1876 pc += instruction_length; |
| 1872 } | 1877 } |
| 1873 | 1878 |
| 1874 return; | 1879 return; |
| 1875 } | 1880 } |
| 1876 | 1881 |
| 1877 } // namespace dart | 1882 } // namespace dart |
| 1878 | 1883 |
| 1879 #endif // defined TARGET_ARCH_IA32 | 1884 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |