| 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 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1845 // SHLD, SHRD (double-precision shift), BTS (bit set). | 1845 // SHLD, SHRD (double-precision shift), BTS (bit set). |
| 1846 AppendToBuffer("%s ", mnemonic); | 1846 AppendToBuffer("%s ", mnemonic); |
| 1847 int mod, regop, rm; | 1847 int mod, regop, rm; |
| 1848 get_modrm(*current, &mod, ®op, &rm); | 1848 get_modrm(*current, &mod, ®op, &rm); |
| 1849 current += PrintRightOperand(current); | 1849 current += PrintRightOperand(current); |
| 1850 if (opcode == 0xAB) { | 1850 if (opcode == 0xAB) { |
| 1851 AppendToBuffer(",%s", NameOfCPURegister(regop)); | 1851 AppendToBuffer(",%s", NameOfCPURegister(regop)); |
| 1852 } else { | 1852 } else { |
| 1853 AppendToBuffer(",%s,cl", NameOfCPURegister(regop)); | 1853 AppendToBuffer(",%s,cl", NameOfCPURegister(regop)); |
| 1854 } | 1854 } |
| 1855 } else if (opcode == 0xBC) { | 1855 } else if (opcode == 0xB8 || opcode == 0xBC || opcode == 0xBD) { |
| 1856 // POPCNT, CTZ, CLZ. |
| 1856 AppendToBuffer("%s%c ", mnemonic, operand_size_code()); | 1857 AppendToBuffer("%s%c ", mnemonic, operand_size_code()); |
| 1857 int mod, regop, rm; | 1858 int mod, regop, rm; |
| 1858 get_modrm(*current, &mod, ®op, &rm); | 1859 get_modrm(*current, &mod, ®op, &rm); |
| 1859 AppendToBuffer("%s,", NameOfCPURegister(regop)); | |
| 1860 current += PrintRightOperand(current); | |
| 1861 } else if (opcode == 0xBD) { | |
| 1862 AppendToBuffer("%s%c ", mnemonic, operand_size_code()); | |
| 1863 int mod, regop, rm; | |
| 1864 get_modrm(*current, &mod, ®op, &rm); | |
| 1865 AppendToBuffer("%s,", NameOfCPURegister(regop)); | 1860 AppendToBuffer("%s,", NameOfCPURegister(regop)); |
| 1866 current += PrintRightOperand(current); | 1861 current += PrintRightOperand(current); |
| 1867 } else if (opcode == 0x0B) { | 1862 } else if (opcode == 0x0B) { |
| 1868 AppendToBuffer("ud2"); | 1863 AppendToBuffer("ud2"); |
| 1869 } else { | 1864 } else { |
| 1870 UnimplementedInstruction(); | 1865 UnimplementedInstruction(); |
| 1871 } | 1866 } |
| 1872 return static_cast<int>(current - data); | 1867 return static_cast<int>(current - data); |
| 1873 } | 1868 } |
| 1874 | 1869 |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2485 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { | 2480 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { |
| 2486 fprintf(f, " "); | 2481 fprintf(f, " "); |
| 2487 } | 2482 } |
| 2488 fprintf(f, " %s\n", buffer.start()); | 2483 fprintf(f, " %s\n", buffer.start()); |
| 2489 } | 2484 } |
| 2490 } | 2485 } |
| 2491 | 2486 |
| 2492 } // namespace disasm | 2487 } // namespace disasm |
| 2493 | 2488 |
| 2494 #endif // V8_TARGET_ARCH_X64 | 2489 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |