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 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 static const char* const barrier_option_names[] = { | 1851 static const char* const barrier_option_names[] = { |
1852 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh", | 1852 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh", |
1853 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy", | 1853 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy", |
1854 }; | 1854 }; |
1855 | 1855 |
1856 | 1856 |
1857 void Decoder::DecodeSpecialCondition(Instruction* instr) { | 1857 void Decoder::DecodeSpecialCondition(Instruction* instr) { |
1858 switch (instr->SpecialValue()) { | 1858 switch (instr->SpecialValue()) { |
1859 case 4: | 1859 case 4: |
1860 if (instr->Bits(21, 20) == 2 && instr->Bits(11, 8) == 1 && | 1860 if (instr->Bits(21, 20) == 2 && instr->Bits(11, 8) == 1 && |
1861 instr->Bit(4) == 1) { | 1861 instr->Bit(6) == 1 && instr->Bit(4) == 1) { |
1862 // vmov Qd, Qm | |
1863 int Vd = instr->VFPDRegValue(kSimd128Precision); | 1862 int Vd = instr->VFPDRegValue(kSimd128Precision); |
1864 int Vm = instr->VFPMRegValue(kSimd128Precision); | 1863 int Vm = instr->VFPMRegValue(kSimd128Precision); |
1865 out_buffer_pos_ += | 1864 int Vn = instr->VFPNRegValue(kSimd128Precision); |
1866 SNPrintF(out_buffer_ + out_buffer_pos_, "vmov q%d, q%d", Vd, Vm); | 1865 if (Vm == Vn) { |
| 1866 // vmov Qd, Qm |
| 1867 out_buffer_pos_ += |
| 1868 SNPrintF(out_buffer_ + out_buffer_pos_, "vmov q%d, q%d", Vd, Vm); |
| 1869 } else { |
| 1870 // vorr Qd, Qm, Qn. |
| 1871 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
| 1872 "vorr q%d, q%d, q%d", Vd, Vn, Vm); |
| 1873 } |
1867 } else if (instr->Bits(11, 8) == 8) { | 1874 } else if (instr->Bits(11, 8) == 8) { |
1868 const char* op = (instr->Bit(4) == 0) ? "vadd" : "vtst"; | 1875 const char* op = (instr->Bit(4) == 0) ? "vadd" : "vtst"; |
1869 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | 1876 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); |
1870 int Vd = instr->VFPDRegValue(kSimd128Precision); | 1877 int Vd = instr->VFPDRegValue(kSimd128Precision); |
1871 int Vm = instr->VFPMRegValue(kSimd128Precision); | 1878 int Vm = instr->VFPMRegValue(kSimd128Precision); |
1872 int Vn = instr->VFPNRegValue(kSimd128Precision); | 1879 int Vn = instr->VFPNRegValue(kSimd128Precision); |
1873 // vadd/vtst.i<size> Qd, Qm, Qn. | 1880 // vadd/vtst.i<size> Qd, Qm, Qn. |
1874 out_buffer_pos_ += | 1881 out_buffer_pos_ += |
1875 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d", op, | 1882 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d", op, |
1876 size, Vd, Vn, Vm); | 1883 size, Vd, Vn, Vm); |
(...skipping 15 matching lines...) Expand all Loading... |
1892 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1899 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1893 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); | 1900 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); |
1894 } else if (instr->Bits(21, 20) == 0 && instr->Bits(11, 8) == 0xe && | 1901 } else if (instr->Bits(21, 20) == 0 && instr->Bits(11, 8) == 0xe && |
1895 instr->Bit(4) == 0) { | 1902 instr->Bit(4) == 0) { |
1896 int Vd = instr->VFPDRegValue(kSimd128Precision); | 1903 int Vd = instr->VFPDRegValue(kSimd128Precision); |
1897 int Vm = instr->VFPMRegValue(kSimd128Precision); | 1904 int Vm = instr->VFPMRegValue(kSimd128Precision); |
1898 int Vn = instr->VFPNRegValue(kSimd128Precision); | 1905 int Vn = instr->VFPNRegValue(kSimd128Precision); |
1899 // vceq.f32 Qd, Qm, Qn. | 1906 // vceq.f32 Qd, Qm, Qn. |
1900 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1907 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1901 "vceq.f32 q%d, q%d, q%d", Vd, Vn, Vm); | 1908 "vceq.f32 q%d, q%d, q%d", Vd, Vn, Vm); |
| 1909 } else if (instr->Bits(11, 8) == 1 && instr->Bits(21, 20) == 0 && |
| 1910 instr->Bit(6) == 1 && instr->Bit(4) == 1) { |
| 1911 int Vd = instr->VFPDRegValue(kSimd128Precision); |
| 1912 int Vm = instr->VFPMRegValue(kSimd128Precision); |
| 1913 int Vn = instr->VFPNRegValue(kSimd128Precision); |
| 1914 // vand Qd, Qm, Qn. |
| 1915 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
| 1916 "vand q%d, q%d, q%d", Vd, Vn, Vm); |
1902 } else if (instr->Bits(11, 8) == 0x3) { | 1917 } else if (instr->Bits(11, 8) == 0x3) { |
1903 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | 1918 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); |
1904 int Vd = instr->VFPDRegValue(kSimd128Precision); | 1919 int Vd = instr->VFPDRegValue(kSimd128Precision); |
1905 int Vm = instr->VFPMRegValue(kSimd128Precision); | 1920 int Vm = instr->VFPMRegValue(kSimd128Precision); |
1906 int Vn = instr->VFPNRegValue(kSimd128Precision); | 1921 int Vn = instr->VFPNRegValue(kSimd128Precision); |
1907 const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt"; | 1922 const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt"; |
1908 // vcge/vcgt.s<size> Qd, Qm, Qn. | 1923 // vcge/vcgt.s<size> Qd, Qm, Qn. |
1909 out_buffer_pos_ += | 1924 out_buffer_pos_ += |
1910 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d", op, | 1925 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d", op, |
1911 size, Vd, Vn, Vm); | 1926 size, Vd, Vn, Vm); |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 pc += d.InstructionDecode(buffer, pc); | 2482 pc += d.InstructionDecode(buffer, pc); |
2468 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), | 2483 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), |
2469 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2484 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
2470 } | 2485 } |
2471 } | 2486 } |
2472 | 2487 |
2473 | 2488 |
2474 } // namespace disasm | 2489 } // namespace disasm |
2475 | 2490 |
2476 #endif // V8_TARGET_ARCH_ARM | 2491 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |