| 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 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 case 0x54: | 1252 case 0x54: |
| 1253 AppendToBuffer("vandps %s,%s,", NameOfXMMRegister(regop), | 1253 AppendToBuffer("vandps %s,%s,", NameOfXMMRegister(regop), |
| 1254 NameOfXMMRegister(vvvv)); | 1254 NameOfXMMRegister(vvvv)); |
| 1255 current += PrintRightXMMOperand(current); | 1255 current += PrintRightXMMOperand(current); |
| 1256 break; | 1256 break; |
| 1257 case 0x57: | 1257 case 0x57: |
| 1258 AppendToBuffer("vxorps %s,%s,", NameOfXMMRegister(regop), | 1258 AppendToBuffer("vxorps %s,%s,", NameOfXMMRegister(regop), |
| 1259 NameOfXMMRegister(vvvv)); | 1259 NameOfXMMRegister(vvvv)); |
| 1260 current += PrintRightXMMOperand(current); | 1260 current += PrintRightXMMOperand(current); |
| 1261 break; | 1261 break; |
| 1262 case 0xC2: { |
| 1263 AppendToBuffer("vcmpps %s,%s,", NameOfXMMRegister(regop), |
| 1264 NameOfXMMRegister(vvvv)); |
| 1265 current += PrintRightXMMOperand(current); |
| 1266 const char* const pseudo_op[] = {"eq", "lt", "le", "unord", |
| 1267 "neq", "nlt", "nle", "ord"}; |
| 1268 AppendToBuffer(", (%s)", pseudo_op[*current]); |
| 1269 current += 1; |
| 1270 break; |
| 1271 } |
| 1262 default: | 1272 default: |
| 1263 UnimplementedInstruction(); | 1273 UnimplementedInstruction(); |
| 1264 } | 1274 } |
| 1265 } else if (vex_66() && vex_0f()) { | 1275 } else if (vex_66() && vex_0f()) { |
| 1266 int mod, regop, rm, vvvv = vex_vreg(); | 1276 int mod, regop, rm, vvvv = vex_vreg(); |
| 1267 get_modrm(*current, &mod, ®op, &rm); | 1277 get_modrm(*current, &mod, ®op, &rm); |
| 1268 switch (opcode) { | 1278 switch (opcode) { |
| 1269 case 0x10: | 1279 case 0x10: |
| 1270 AppendToBuffer("vmovupd %s,", NameOfXMMRegister(regop)); | 1280 AppendToBuffer("vmovupd %s,", NameOfXMMRegister(regop)); |
| 1271 current += PrintRightXMMOperand(current); | 1281 current += PrintRightXMMOperand(current); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 case 0x76: | 1331 case 0x76: |
| 1322 AppendToBuffer("vpcmpeqd %s,%s,", NameOfXMMRegister(regop), | 1332 AppendToBuffer("vpcmpeqd %s,%s,", NameOfXMMRegister(regop), |
| 1323 NameOfXMMRegister(vvvv)); | 1333 NameOfXMMRegister(vvvv)); |
| 1324 current += PrintRightXMMOperand(current); | 1334 current += PrintRightXMMOperand(current); |
| 1325 break; | 1335 break; |
| 1326 case 0x7e: | 1336 case 0x7e: |
| 1327 AppendToBuffer("vmov%c ", vex_w() ? 'q' : 'd'); | 1337 AppendToBuffer("vmov%c ", vex_w() ? 'q' : 'd'); |
| 1328 current += PrintRightOperand(current); | 1338 current += PrintRightOperand(current); |
| 1329 AppendToBuffer(",%s", NameOfXMMRegister(regop)); | 1339 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
| 1330 break; | 1340 break; |
| 1341 case 0xC2: { |
| 1342 AppendToBuffer("vcmppd %s,%s,", NameOfXMMRegister(regop), |
| 1343 NameOfXMMRegister(vvvv)); |
| 1344 current += PrintRightXMMOperand(current); |
| 1345 const char* const pseudo_op[] = {"eq", "lt", "le", "unord", |
| 1346 "neq", "nlt", "nle", "ord"}; |
| 1347 AppendToBuffer(", (%s)", pseudo_op[*current]); |
| 1348 current += 1; |
| 1349 break; |
| 1350 } |
| 1331 default: | 1351 default: |
| 1332 UnimplementedInstruction(); | 1352 UnimplementedInstruction(); |
| 1333 } | 1353 } |
| 1334 | 1354 |
| 1335 } else { | 1355 } else { |
| 1336 UnimplementedInstruction(); | 1356 UnimplementedInstruction(); |
| 1337 } | 1357 } |
| 1338 | 1358 |
| 1339 return static_cast<int>(current - data); | 1359 return static_cast<int>(current - data); |
| 1340 } | 1360 } |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 } else if (opcode == 0x62) { | 1693 } else if (opcode == 0x62) { |
| 1674 mnemonic = "punpckldq"; | 1694 mnemonic = "punpckldq"; |
| 1675 } else if (opcode == 0x6A) { | 1695 } else if (opcode == 0x6A) { |
| 1676 mnemonic = "punpckhdq"; | 1696 mnemonic = "punpckhdq"; |
| 1677 } else if (opcode == 0xF4) { | 1697 } else if (opcode == 0xF4) { |
| 1678 mnemonic = "pmuludq"; | 1698 mnemonic = "pmuludq"; |
| 1679 } else if (opcode == 0xFA) { | 1699 } else if (opcode == 0xFA) { |
| 1680 mnemonic = "psubd"; | 1700 mnemonic = "psubd"; |
| 1681 } else if (opcode == 0xFE) { | 1701 } else if (opcode == 0xFE) { |
| 1682 mnemonic = "paddd"; | 1702 mnemonic = "paddd"; |
| 1703 } else if (opcode == 0xC2) { |
| 1704 mnemonic = "cmppd"; |
| 1683 } else { | 1705 } else { |
| 1684 UnimplementedInstruction(); | 1706 UnimplementedInstruction(); |
| 1685 } | 1707 } |
| 1686 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); | 1708 AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop)); |
| 1687 current += PrintRightXMMOperand(current); | 1709 current += PrintRightXMMOperand(current); |
| 1710 if (opcode == 0xC2) { |
| 1711 const char* const pseudo_op[] = {"eq", "lt", "le", "unord", |
| 1712 "neq", "nlt", "nle", "ord"}; |
| 1713 AppendToBuffer(", (%s)", pseudo_op[*current]); |
| 1714 current += 1; |
| 1715 } |
| 1688 } | 1716 } |
| 1689 } | 1717 } |
| 1690 } else if (group_1_prefix_ == 0xF2) { | 1718 } else if (group_1_prefix_ == 0xF2) { |
| 1691 // Beginning of instructions with prefix 0xF2. | 1719 // Beginning of instructions with prefix 0xF2. |
| 1692 | 1720 |
| 1693 if (opcode == 0x11 || opcode == 0x10) { | 1721 if (opcode == 0x11 || opcode == 0x10) { |
| 1694 // MOVSD: Move scalar double-precision fp to/from/between XMM registers. | 1722 // MOVSD: Move scalar double-precision fp to/from/between XMM registers. |
| 1695 AppendToBuffer("movsd "); | 1723 AppendToBuffer("movsd "); |
| 1696 int mod, regop, rm; | 1724 int mod, regop, rm; |
| 1697 get_modrm(*current, &mod, ®op, &rm); | 1725 get_modrm(*current, &mod, ®op, &rm); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 int mod, regop, rm; | 1917 int mod, regop, rm; |
| 1890 get_modrm(*current, &mod, ®op, &rm); | 1918 get_modrm(*current, &mod, ®op, &rm); |
| 1891 AppendToBuffer("%s %s,", pseudo_op[opcode - 0x51], | 1919 AppendToBuffer("%s %s,", pseudo_op[opcode - 0x51], |
| 1892 NameOfXMMRegister(regop)); | 1920 NameOfXMMRegister(regop)); |
| 1893 current += PrintRightXMMOperand(current); | 1921 current += PrintRightXMMOperand(current); |
| 1894 | 1922 |
| 1895 } else if (opcode == 0xC2) { | 1923 } else if (opcode == 0xC2) { |
| 1896 // cmpps xmm, xmm/m128, imm8 | 1924 // cmpps xmm, xmm/m128, imm8 |
| 1897 int mod, regop, rm; | 1925 int mod, regop, rm; |
| 1898 get_modrm(*current, &mod, ®op, &rm); | 1926 get_modrm(*current, &mod, ®op, &rm); |
| 1899 const char* const pseudo_op[] = {"cmpeqps", "cmpltps", "cmpleps", | 1927 const char* const pseudo_op[] = {"eq", "lt", "le", "unord", |
| 1900 "cmpunordps", "cmpneqps", "cmpnltps", | 1928 "neq", "nlt", "nle", "ord"}; |
| 1901 "cmpnleps", "cmpordps"}; | 1929 AppendToBuffer("cmpps %s, ", NameOfXMMRegister(regop)); |
| 1902 AppendToBuffer("%s %s,%s", pseudo_op[current[1]], NameOfXMMRegister(regop), | 1930 current += PrintRightXMMOperand(current); |
| 1903 NameOfXMMRegister(rm)); | 1931 AppendToBuffer(", %s", pseudo_op[*current]); |
| 1904 current += 2; | 1932 current += 1; |
| 1905 } else if (opcode == 0xC6) { | 1933 } else if (opcode == 0xC6) { |
| 1906 // shufps xmm, xmm/m128, imm8 | 1934 // shufps xmm, xmm/m128, imm8 |
| 1907 int mod, regop, rm; | 1935 int mod, regop, rm; |
| 1908 get_modrm(*current, &mod, ®op, &rm); | 1936 get_modrm(*current, &mod, ®op, &rm); |
| 1909 AppendToBuffer("shufps %s, ", NameOfXMMRegister(regop)); | 1937 AppendToBuffer("shufps %s, ", NameOfXMMRegister(regop)); |
| 1910 current += PrintRightXMMOperand(current); | 1938 current += PrintRightXMMOperand(current); |
| 1911 AppendToBuffer(", %d", (*current) & 3); | 1939 AppendToBuffer(", %d", (*current) & 3); |
| 1912 current += 1; | 1940 current += 1; |
| 1913 } else if (opcode == 0x50) { | 1941 } else if (opcode == 0x50) { |
| 1914 // movmskps reg, xmm | 1942 // movmskps reg, xmm |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2580 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { | 2608 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { |
| 2581 fprintf(f, " "); | 2609 fprintf(f, " "); |
| 2582 } | 2610 } |
| 2583 fprintf(f, " %s\n", buffer.start()); | 2611 fprintf(f, " %s\n", buffer.start()); |
| 2584 } | 2612 } |
| 2585 } | 2613 } |
| 2586 | 2614 |
| 2587 } // namespace disasm | 2615 } // namespace disasm |
| 2588 | 2616 |
| 2589 #endif // V8_TARGET_ARCH_X64 | 2617 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |