OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <assert.h> | 5 #include <assert.h> |
6 #include <stdarg.h> | 6 #include <stdarg.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 current += PrintRightOperand(current); | 1172 current += PrintRightOperand(current); |
1173 AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3); | 1173 AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3); |
1174 current += 1; | 1174 current += 1; |
1175 } else if (third_byte == 0x0b) { | 1175 } else if (third_byte == 0x0b) { |
1176 get_modrm(*current, &mod, ®op, &rm); | 1176 get_modrm(*current, &mod, ®op, &rm); |
1177 // roundsd xmm, xmm/m64, imm8 | 1177 // roundsd xmm, xmm/m64, imm8 |
1178 AppendToBuffer("roundsd %s,", NameOfXMMRegister(regop)); | 1178 AppendToBuffer("roundsd %s,", NameOfXMMRegister(regop)); |
1179 current += PrintRightXMMOperand(current); | 1179 current += PrintRightXMMOperand(current); |
1180 AppendToBuffer(",%d", (*current) & 3); | 1180 AppendToBuffer(",%d", (*current) & 3); |
1181 current += 1; | 1181 current += 1; |
| 1182 } else if (third_byte == 0x16) { |
| 1183 get_modrm(*current, &mod, ®op, &rm); |
| 1184 AppendToBuffer("pextrd "); // reg/m32, xmm, imm8 |
| 1185 current += PrintRightOperand(current); |
| 1186 AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3); |
| 1187 current += 1; |
| 1188 } else if (third_byte == 0x22) { |
| 1189 get_modrm(*current, &mod, ®op, &rm); |
| 1190 AppendToBuffer("pinsrd "); // xmm, reg/m32, imm8 |
| 1191 AppendToBuffer(" %s,", NameOfXMMRegister(regop)); |
| 1192 current += PrintRightOperand(current); |
| 1193 AppendToBuffer(",%d", (*current) & 3); |
| 1194 current += 1; |
1182 } else { | 1195 } else { |
1183 UnimplementedInstruction(); | 1196 UnimplementedInstruction(); |
1184 } | 1197 } |
1185 } else { | 1198 } else { |
1186 get_modrm(*current, &mod, ®op, &rm); | 1199 get_modrm(*current, &mod, ®op, &rm); |
1187 if (opcode == 0x1f) { | 1200 if (opcode == 0x1f) { |
1188 current++; | 1201 current++; |
1189 if (rm == 4) { // SIB byte present. | 1202 if (rm == 4) { // SIB byte present. |
1190 current++; | 1203 current++; |
1191 } | 1204 } |
(...skipping 30 matching lines...) Expand all Loading... |
1222 AppendToBuffer(",%s", NameOfXMMRegister(regop)); | 1235 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
1223 } else if (opcode == 0xD6) { | 1236 } else if (opcode == 0xD6) { |
1224 AppendToBuffer("movq "); | 1237 AppendToBuffer("movq "); |
1225 current += PrintRightXMMOperand(current); | 1238 current += PrintRightXMMOperand(current); |
1226 AppendToBuffer(",%s", NameOfXMMRegister(regop)); | 1239 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
1227 } else if (opcode == 0x50) { | 1240 } else if (opcode == 0x50) { |
1228 AppendToBuffer("movmskpd %s,", NameOfCPURegister(regop)); | 1241 AppendToBuffer("movmskpd %s,", NameOfCPURegister(regop)); |
1229 current += PrintRightXMMOperand(current); | 1242 current += PrintRightXMMOperand(current); |
1230 } else if (opcode == 0x72) { | 1243 } else if (opcode == 0x72) { |
1231 current += 1; | 1244 current += 1; |
1232 AppendToBuffer("%s,%s,%d", (regop == 6) ? "pslld" : "psrld", | 1245 AppendToBuffer("%s %s,%d", (regop == 6) ? "pslld" : "psrld", |
1233 NameOfXMMRegister(rm), *current & 0x7f); | 1246 NameOfXMMRegister(rm), *current & 0x7f); |
1234 current += 1; | 1247 current += 1; |
1235 } else if (opcode == 0x73) { | 1248 } else if (opcode == 0x73) { |
1236 current += 1; | 1249 current += 1; |
1237 AppendToBuffer("%s,%s,%d", (regop == 6) ? "psllq" : "psrlq", | 1250 AppendToBuffer("%s %s,%d", (regop == 6) ? "psllq" : "psrlq", |
1238 NameOfXMMRegister(rm), *current & 0x7f); | 1251 NameOfXMMRegister(rm), *current & 0x7f); |
1239 current += 1; | 1252 current += 1; |
1240 } else { | 1253 } else { |
1241 const char* mnemonic = "?"; | 1254 const char* mnemonic = "?"; |
1242 if (opcode == 0x54) { | 1255 if (opcode == 0x54) { |
1243 mnemonic = "andpd"; | 1256 mnemonic = "andpd"; |
1244 } else if (opcode == 0x56) { | 1257 } else if (opcode == 0x56) { |
1245 mnemonic = "orpd"; | 1258 mnemonic = "orpd"; |
1246 } else if (opcode == 0x57) { | 1259 } else if (opcode == 0x57) { |
1247 mnemonic = "xorpd"; | 1260 mnemonic = "xorpd"; |
1248 } else if (opcode == 0x2E) { | 1261 } else if (opcode == 0x2E) { |
1249 mnemonic = "ucomisd"; | 1262 mnemonic = "ucomisd"; |
1250 } else if (opcode == 0x2F) { | 1263 } else if (opcode == 0x2F) { |
1251 mnemonic = "comisd"; | 1264 mnemonic = "comisd"; |
1252 } else if (opcode == 0x76) { | 1265 } else if (opcode == 0x76) { |
1253 mnemonic = "pcmpeqd"; | 1266 mnemonic = "pcmpeqd"; |
| 1267 } else if (opcode == 0x62) { |
| 1268 mnemonic = "punpckldq"; |
| 1269 } else if (opcode == 0x6A) { |
| 1270 mnemonic = "punpckhdq"; |
1254 } else { | 1271 } else { |
1255 UnimplementedInstruction(); | 1272 UnimplementedInstruction(); |
1256 } | 1273 } |
1257 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); | 1274 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); |
1258 current += PrintRightXMMOperand(current); | 1275 current += PrintRightXMMOperand(current); |
1259 } | 1276 } |
1260 } | 1277 } |
1261 } else if (group_1_prefix_ == 0xF2) { | 1278 } else if (group_1_prefix_ == 0xF2) { |
1262 // Beginning of instructions with prefix 0xF2. | 1279 // Beginning of instructions with prefix 0xF2. |
1263 | 1280 |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2113 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { | 2130 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { |
2114 fprintf(f, " "); | 2131 fprintf(f, " "); |
2115 } | 2132 } |
2116 fprintf(f, " %s\n", buffer.start()); | 2133 fprintf(f, " %s\n", buffer.start()); |
2117 } | 2134 } |
2118 } | 2135 } |
2119 | 2136 |
2120 } // namespace disasm | 2137 } // namespace disasm |
2121 | 2138 |
2122 #endif // V8_TARGET_ARCH_X64 | 2139 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |