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 // A Disassembler object is used to disassemble a block of code instruction by | 5 // A Disassembler object is used to disassemble a block of code instruction by |
6 // instruction. The default implementation of the NameConverter object can be | 6 // instruction. The default implementation of the NameConverter object can be |
7 // overriden to modify register names or to do symbol lookup on addresses. | 7 // overriden to modify register names or to do symbol lookup on addresses. |
8 // | 8 // |
9 // The example below will disassemble a block of code and print it to stdout. | 9 // The example below will disassemble a block of code and print it to stdout. |
10 // | 10 // |
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | 1869 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); |
1870 int Vd = instr->VFPDRegValue(kSimd128Precision); | 1870 int Vd = instr->VFPDRegValue(kSimd128Precision); |
1871 int Vm = instr->VFPMRegValue(kSimd128Precision); | 1871 int Vm = instr->VFPMRegValue(kSimd128Precision); |
1872 int Vn = instr->VFPNRegValue(kSimd128Precision); | 1872 int Vn = instr->VFPNRegValue(kSimd128Precision); |
1873 // vadd/vtst.i<size> Qd, Qm, Qn. | 1873 // vadd/vtst.i<size> Qd, Qm, Qn. |
1874 out_buffer_pos_ += | 1874 out_buffer_pos_ += |
1875 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d", op, | 1875 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d", op, |
1876 size, Vd, Vn, Vm); | 1876 size, Vd, Vn, Vm); |
1877 } else if (instr->Bits(11, 8) == 0xd && instr->Bit(4) == 0) { | 1877 } else if (instr->Bits(11, 8) == 0xd && instr->Bit(4) == 0) { |
1878 const char* op = (instr->Bits(21, 20) == 0) ? "vadd" : "vsub"; | 1878 const char* op = (instr->Bits(21, 20) == 0) ? "vadd" : "vsub"; |
1879 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | |
1880 int Vd = instr->VFPDRegValue(kSimd128Precision); | 1879 int Vd = instr->VFPDRegValue(kSimd128Precision); |
1881 int Vm = instr->VFPMRegValue(kSimd128Precision); | 1880 int Vm = instr->VFPMRegValue(kSimd128Precision); |
1882 int Vn = instr->VFPNRegValue(kSimd128Precision); | 1881 int Vn = instr->VFPNRegValue(kSimd128Precision); |
1883 // vadd/vsub.f32 Qd, Qm, Qn. | 1882 // vadd/vsub.f32 Qd, Qm, Qn. |
1884 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1883 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1885 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm); | 1884 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm); |
1886 } else if (instr->Bits(11, 8) == 0x9 && instr->Bit(6) == 1 && | 1885 } else if (instr->Bits(11, 8) == 0x9 && instr->Bit(6) == 1 && |
1887 instr->Bit(4) == 1) { | 1886 instr->Bit(4) == 1) { |
1888 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | 1887 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); |
1889 int Vd = instr->VFPDRegValue(kSimd128Precision); | 1888 int Vd = instr->VFPDRegValue(kSimd128Precision); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2423 pc += d.InstructionDecode(buffer, pc); | 2422 pc += d.InstructionDecode(buffer, pc); |
2424 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), | 2423 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), |
2425 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2424 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
2426 } | 2425 } |
2427 } | 2426 } |
2428 | 2427 |
2429 | 2428 |
2430 } // namespace disasm | 2429 } // namespace disasm |
2431 | 2430 |
2432 #endif // V8_TARGET_ARCH_ARM | 2431 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |