| 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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 // These instructions may be affected by an 0x66, 0xF2, or 0xF3 prefix. | 1192 // These instructions may be affected by an 0x66, 0xF2, or 0xF3 prefix. |
| 1193 // We do not use any three-byte opcodes, which start with 0x0F38 or 0x0F3A. | 1193 // We do not use any three-byte opcodes, which start with 0x0F38 or 0x0F3A. |
| 1194 int DisassemblerX64::TwoByteOpcodeInstruction(uint8_t* data) { | 1194 int DisassemblerX64::TwoByteOpcodeInstruction(uint8_t* data) { |
| 1195 uint8_t opcode = *(data + 1); | 1195 uint8_t opcode = *(data + 1); |
| 1196 uint8_t* current = data + 2; | 1196 uint8_t* current = data + 2; |
| 1197 // At return, "current" points to the start of the next instruction. | 1197 // At return, "current" points to the start of the next instruction. |
| 1198 const char* mnemonic = TwoByteMnemonic(opcode); | 1198 const char* mnemonic = TwoByteMnemonic(opcode); |
| 1199 if (operand_size_ == 0x66) { | 1199 if (operand_size_ == 0x66) { |
| 1200 // 0x66 0x0F prefix. | 1200 // 0x66 0x0F prefix. |
| 1201 int mod, regop, rm; | 1201 int mod, regop, rm; |
| 1202 if (opcode == 0x3A) { | 1202 if (opcode == 0xC6) { |
| 1203 int mod, regop, rm; |
| 1204 get_modrm(*current, &mod, ®op, &rm); |
| 1205 AppendToBuffer("shufpd %s, ", NameOfXMMRegister(regop)); |
| 1206 current += PrintRightXMMOperand(current); |
| 1207 AppendToBuffer(" [%x]", *current); |
| 1208 current++; |
| 1209 } else if (opcode == 0x3A) { |
| 1203 uint8_t third_byte = *current; | 1210 uint8_t third_byte = *current; |
| 1204 current = data + 3; | 1211 current = data + 3; |
| 1205 if (third_byte == 0x17) { | 1212 if (third_byte == 0x17) { |
| 1206 get_modrm(*current, &mod, ®op, &rm); | 1213 get_modrm(*current, &mod, ®op, &rm); |
| 1207 AppendToBuffer("extractps "); // reg/m32, xmm, imm8 | 1214 AppendToBuffer("extractps "); // reg/m32, xmm, imm8 |
| 1208 current += PrintRightOperand(current); | 1215 current += PrintRightOperand(current); |
| 1209 AppendToBuffer(", %s, %d", NameOfCPURegister(regop), (*current) & 3); | 1216 AppendToBuffer(", %s, %d", NameOfCPURegister(regop), (*current) & 3); |
| 1210 current += 1; | 1217 current += 1; |
| 1211 } else if (third_byte == 0x0b) { | 1218 } else if (third_byte == 0x0b) { |
| 1212 get_modrm(*current, &mod, ®op, &rm); | 1219 get_modrm(*current, &mod, ®op, &rm); |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 pc); | 1967 pc); |
| 1961 pc += instruction_length; | 1968 pc += instruction_length; |
| 1962 } | 1969 } |
| 1963 | 1970 |
| 1964 return; | 1971 return; |
| 1965 } | 1972 } |
| 1966 | 1973 |
| 1967 } // namespace dart | 1974 } // namespace dart |
| 1968 | 1975 |
| 1969 #endif // defined TARGET_ARCH_X64 | 1976 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |