Chromium Code Reviews| 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 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1946 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | 1946 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); |
| 1947 // vmul.i<size> Qd, Qm, Qn. | 1947 // vmul.i<size> Qd, Qm, Qn. |
| 1948 out_buffer_pos_ += | 1948 out_buffer_pos_ += |
| 1949 SNPrintF(out_buffer_ + out_buffer_pos_, | 1949 SNPrintF(out_buffer_ + out_buffer_pos_, |
| 1950 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); | 1950 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); |
| 1951 } else { | 1951 } else { |
| 1952 Unknown(instr); | 1952 Unknown(instr); |
| 1953 } | 1953 } |
| 1954 break; | 1954 break; |
| 1955 } | 1955 } |
| 1956 case 0xa: { | |
| 1957 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | |
|
martyn.capewell
2017/02/28 15:45:24
It might be worthwhile calculating this outside th
bbudge
2017/02/28 17:39:35
I moved these to the top of cases 0x4, 0x6, and 0x
| |
| 1958 // vpmin/vpmax.s<size> Dd, Dm, Dn. | |
| 1959 const char* op = instr->Bit(4) == 1 ? "vpmin" : "vpmax"; | |
| 1960 out_buffer_pos_ += | |
| 1961 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d d%d, d%d, d%d", | |
| 1962 op, size, Vd, Vn, Vm); | |
| 1963 break; | |
| 1964 } | |
| 1956 case 0xd: { | 1965 case 0xd: { |
| 1957 if (instr->Bit(4) == 0) { | 1966 if (instr->Bit(4) == 0) { |
| 1958 const char* op = (instr->Bits(21, 20) == 0) ? "vadd" : "vsub"; | 1967 const char* op = (instr->Bits(21, 20) == 0) ? "vadd" : "vsub"; |
| 1959 // vadd/vsub.f32 Qd, Qm, Qn. | 1968 // vadd/vsub.f32 Qd, Qm, Qn. |
| 1960 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1969 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
| 1961 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm); | 1970 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm); |
| 1962 } else { | 1971 } else { |
| 1963 Unknown(instr); | 1972 Unknown(instr); |
| 1964 } | 1973 } |
| 1965 break; | 1974 break; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2121 out_buffer_pos_ += | 2130 out_buffer_pos_ += |
| 2122 SNPrintF(out_buffer_ + out_buffer_pos_, | 2131 SNPrintF(out_buffer_ + out_buffer_pos_, |
| 2123 "vsub.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); | 2132 "vsub.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); |
| 2124 } else { | 2133 } else { |
| 2125 out_buffer_pos_ += | 2134 out_buffer_pos_ += |
| 2126 SNPrintF(out_buffer_ + out_buffer_pos_, | 2135 SNPrintF(out_buffer_ + out_buffer_pos_, |
| 2127 "vceq.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); | 2136 "vceq.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); |
| 2128 } | 2137 } |
| 2129 break; | 2138 break; |
| 2130 } | 2139 } |
| 2140 case 0xa: { | |
| 2141 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); | |
| 2142 // vpmin/vpmax.u<size> Dd, Dm, Dn. | |
| 2143 const char* op = instr->Bit(4) == 1 ? "vpmin" : "vpmax"; | |
| 2144 out_buffer_pos_ += | |
| 2145 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d d%d, d%d, d%d", | |
| 2146 op, size, Vd, Vn, Vm); | |
| 2147 break; | |
| 2148 } | |
| 2131 case 0xd: { | 2149 case 0xd: { |
| 2132 if (instr->Bit(21) == 0 && instr->Bit(6) == 1 && instr->Bit(4) == 1) { | 2150 if (instr->Bit(21) == 0 && instr->Bit(6) == 1 && instr->Bit(4) == 1) { |
| 2133 // vmul.f32 Qd, Qn, Qm | 2151 // vmul.f32 Qd, Qn, Qm |
| 2134 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 2152 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
| 2135 "vmul.f32 q%d, q%d, q%d", Vd, Vn, Vm); | 2153 "vmul.f32 q%d, q%d, q%d", Vd, Vn, Vm); |
| 2136 } else { | 2154 } else { |
| 2137 Unknown(instr); | 2155 Unknown(instr); |
| 2138 } | 2156 } |
| 2139 break; | 2157 break; |
| 2140 } | 2158 } |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2615 pc += d.InstructionDecode(buffer, pc); | 2633 pc += d.InstructionDecode(buffer, pc); |
| 2616 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), | 2634 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), |
| 2617 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2635 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
| 2618 } | 2636 } |
| 2619 } | 2637 } |
| 2620 | 2638 |
| 2621 | 2639 |
| 2622 } // namespace disasm | 2640 } // namespace disasm |
| 2623 | 2641 |
| 2624 #endif // V8_TARGET_ARCH_ARM | 2642 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |