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 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1818 case 7: | 1818 case 7: |
1819 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && | 1819 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && |
1820 (instr->Bit(4) == 1)) { | 1820 (instr->Bit(4) == 1)) { |
1821 // vmovl unsigned | 1821 // vmovl unsigned |
1822 if ((instr->VdValue() & 1) != 0) Unknown(instr); | 1822 if ((instr->VdValue() & 1) != 0) Unknown(instr); |
1823 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); | 1823 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); |
1824 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); | 1824 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); |
1825 int imm3 = instr->Bits(21, 19); | 1825 int imm3 = instr->Bits(21, 19); |
1826 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1826 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1827 "vmovl.u%d q%d, d%d", imm3*8, Vd, Vm); | 1827 "vmovl.u%d q%d, d%d", imm3*8, Vd, Vm); |
1828 } else if ((instr->Bits(21, 16) == 0x32) && (instr->Bits(11, 7) == 0) && | |
1829 (instr->Bit(4) == 0)) { | |
1830 int Vd = instr->VFPDRegValue(kDoublePrecision); | |
1831 int Vm = instr->VFPMRegValue(kDoublePrecision); | |
1832 char rtype = (instr->Bit(6) == 0) ? 'd' : 'q'; | |
1833 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | |
1834 "vswp %c%d, %c%d", rtype, Vd, rtype, Vm); | |
1835 } else { | 1828 } else { |
1836 Unknown(instr); | 1829 Unknown(instr); |
1837 } | 1830 } |
1838 break; | 1831 break; |
1839 case 8: | 1832 case 8: |
1840 if (instr->Bits(21, 20) == 0) { | 1833 if (instr->Bits(21, 20) == 0) { |
1841 // vst1 | 1834 // vst1 |
1842 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); | 1835 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); |
1843 int Rn = instr->VnValue(); | 1836 int Rn = instr->VnValue(); |
1844 int type = instr->Bits(11, 8); | 1837 int type = instr->Bits(11, 8); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 pc += d.InstructionDecode(buffer, pc); | 2163 pc += d.InstructionDecode(buffer, pc); |
2171 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), | 2164 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), |
2172 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2165 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
2173 } | 2166 } |
2174 } | 2167 } |
2175 | 2168 |
2176 | 2169 |
2177 } // namespace disasm | 2170 } // namespace disasm |
2178 | 2171 |
2179 #endif // V8_TARGET_ARCH_ARM | 2172 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |