OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 } else { | 1028 } else { |
1029 AppendToBuffer("%s,", NameOfXMMRegister(regop)); | 1029 AppendToBuffer("%s,", NameOfXMMRegister(regop)); |
1030 current += PrintRightOperand(current); | 1030 current += PrintRightOperand(current); |
1031 } | 1031 } |
1032 } else if (opcode == 0x2A) { | 1032 } else if (opcode == 0x2A) { |
1033 // CVTSI2SD: integer to XMM double conversion. | 1033 // CVTSI2SD: integer to XMM double conversion. |
1034 int mod, regop, rm; | 1034 int mod, regop, rm; |
1035 get_modrm(*current, &mod, ®op, &rm); | 1035 get_modrm(*current, &mod, ®op, &rm); |
1036 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); | 1036 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); |
1037 current += PrintRightOperand(current); | 1037 current += PrintRightOperand(current); |
1038 } else if ((opcode & 0xF8) == 0x58) { | 1038 } else if ((opcode & 0xF8) == 0x58 || opcode == 0x51) { |
1039 // XMM arithmetic. Mnemonic was retrieved at the start of this function. | 1039 // XMM arithmetic. Mnemonic was retrieved at the start of this function. |
1040 int mod, regop, rm; | 1040 int mod, regop, rm; |
1041 get_modrm(*current, &mod, ®op, &rm); | 1041 get_modrm(*current, &mod, ®op, &rm); |
1042 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); | 1042 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); |
1043 current += PrintRightXMMOperand(current); | 1043 current += PrintRightXMMOperand(current); |
1044 } else { | 1044 } else { |
1045 UnimplementedInstruction(); | 1045 UnimplementedInstruction(); |
1046 } | 1046 } |
1047 } else if (group_1_prefix_ == 0xF3) { | 1047 } else if (group_1_prefix_ == 0xF3) { |
1048 // Instructions with prefix 0xF3. | 1048 // Instructions with prefix 0xF3. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 // The argument is the second byte of the two-byte opcode. | 1119 // The argument is the second byte of the two-byte opcode. |
1120 // Returns NULL if the instruction is not handled here. | 1120 // Returns NULL if the instruction is not handled here. |
1121 const char* DisassemblerX64::TwoByteMnemonic(byte opcode) { | 1121 const char* DisassemblerX64::TwoByteMnemonic(byte opcode) { |
1122 switch (opcode) { | 1122 switch (opcode) { |
1123 case 0x1F: | 1123 case 0x1F: |
1124 return "nop"; | 1124 return "nop"; |
1125 case 0x2A: // F2 prefix. | 1125 case 0x2A: // F2 prefix. |
1126 return "cvtsi2sd"; | 1126 return "cvtsi2sd"; |
1127 case 0x31: | 1127 case 0x31: |
1128 return "rdtsc"; | 1128 return "rdtsc"; |
| 1129 case 0x51: // F2 prefix. |
| 1130 return "sqrtsd"; |
1129 case 0x58: // F2 prefix. | 1131 case 0x58: // F2 prefix. |
1130 return "addsd"; | 1132 return "addsd"; |
1131 case 0x59: // F2 prefix. | 1133 case 0x59: // F2 prefix. |
1132 return "mulsd"; | 1134 return "mulsd"; |
1133 case 0x5C: // F2 prefix. | 1135 case 0x5C: // F2 prefix. |
1134 return "subsd"; | 1136 return "subsd"; |
1135 case 0x5E: // F2 prefix. | 1137 case 0x5E: // F2 prefix. |
1136 return "divsd"; | 1138 return "divsd"; |
1137 case 0xA2: | 1139 case 0xA2: |
1138 return "cpuid"; | 1140 return "cpuid"; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 fprintf(f, "%02x", *bp); | 1643 fprintf(f, "%02x", *bp); |
1642 } | 1644 } |
1643 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { | 1645 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { |
1644 fprintf(f, " "); | 1646 fprintf(f, " "); |
1645 } | 1647 } |
1646 fprintf(f, " %s\n", buffer.start()); | 1648 fprintf(f, " %s\n", buffer.start()); |
1647 } | 1649 } |
1648 } | 1650 } |
1649 | 1651 |
1650 } // namespace disasm | 1652 } // namespace disasm |
OLD | NEW |