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 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 int Vn = instr->VFPNRegValue(kDoublePrecision); | 2224 int Vn = instr->VFPNRegValue(kDoublePrecision); |
2225 int Vm = instr->VFPMRegValue(kDoublePrecision); | 2225 int Vm = instr->VFPMRegValue(kDoublePrecision); |
2226 int len = instr->Bits(9, 8); | 2226 int len = instr->Bits(9, 8); |
2227 NeonListOperand list(DwVfpRegister::from_code(Vn), len + 1); | 2227 NeonListOperand list(DwVfpRegister::from_code(Vn), len + 1); |
2228 out_buffer_pos_ += | 2228 out_buffer_pos_ += |
2229 SNPrintF(out_buffer_ + out_buffer_pos_, "%s d%d, ", | 2229 SNPrintF(out_buffer_ + out_buffer_pos_, "%s d%d, ", |
2230 instr->Bit(6) == 0 ? "vtbl.8" : "vtbx.8", Vd); | 2230 instr->Bit(6) == 0 ? "vtbl.8" : "vtbx.8", Vd); |
2231 FormatNeonList(Vn, list.type()); | 2231 FormatNeonList(Vn, list.type()); |
2232 Print(", "); | 2232 Print(", "); |
2233 PrintDRegister(Vm); | 2233 PrintDRegister(Vm); |
2234 } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 6) == 0x7) { | 2234 } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 8) == 0x1 && |
| 2235 instr->Bit(6) == 1) { |
2235 int Vd = instr->VFPDRegValue(kSimd128Precision); | 2236 int Vd = instr->VFPDRegValue(kSimd128Precision); |
2236 int Vm = instr->VFPMRegValue(kSimd128Precision); | 2237 int Vm = instr->VFPMRegValue(kSimd128Precision); |
2237 int size = kBitsPerByte * (1 << instr->Bits(19, 18)); | 2238 int size = kBitsPerByte * (1 << instr->Bits(19, 18)); |
2238 // vzip.<size> Qd, Qm. | 2239 const char* op = instr->Bit(7) != 0 ? "vzip" : "vuzp"; |
| 2240 // vzip/vuzp.<size> Qd, Qm. |
2239 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 2241 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
2240 "vzip.%d q%d, q%d", size, Vd, Vm); | 2242 "%s.%d q%d, q%d", op, size, Vd, Vm); |
2241 } else if (instr->Bits(17, 16) == 0 && instr->Bits(11, 9) == 0) { | 2243 } else if (instr->Bits(17, 16) == 0 && instr->Bits(11, 9) == 0 && |
| 2244 instr->Bit(6) == 1) { |
2242 int Vd = instr->VFPDRegValue(kSimd128Precision); | 2245 int Vd = instr->VFPDRegValue(kSimd128Precision); |
2243 int Vm = instr->VFPMRegValue(kSimd128Precision); | 2246 int Vm = instr->VFPMRegValue(kSimd128Precision); |
2244 int size = kBitsPerByte * (1 << instr->Bits(19, 18)); | 2247 int size = kBitsPerByte * (1 << instr->Bits(19, 18)); |
2245 int op = kBitsPerByte | 2248 int op = kBitsPerByte |
2246 << (static_cast<int>(Neon64) - instr->Bits(8, 7)); | 2249 << (static_cast<int>(Neon64) - instr->Bits(8, 7)); |
2247 // vrev<op>.<size> Qd, Qm. | 2250 // vrev<op>.<size> Qd, Qm. |
2248 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 2251 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
2249 "vrev%d.%d q%d, q%d", op, size, Vd, Vm); | 2252 "vrev%d.%d q%d, q%d", op, size, Vd, Vm); |
2250 } else if (instr->Bits(17, 16) == 0x1 && instr->Bit(11) == 0) { | 2253 } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 6) == 0x3) { |
2251 int Vd = instr->VFPDRegValue(kSimd128Precision); | 2254 int Vd = instr->VFPDRegValue(kSimd128Precision); |
2252 int Vm = instr->VFPMRegValue(kSimd128Precision); | 2255 int Vm = instr->VFPMRegValue(kSimd128Precision); |
2253 int size = kBitsPerByte * (1 << instr->Bits(19, 18)); | 2256 int size = kBitsPerByte * (1 << instr->Bits(19, 18)); |
| 2257 // vtrn.<size> Qd, Qm. |
| 2258 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
| 2259 "vtrn.%d q%d, q%d", size, Vd, Vm); |
| 2260 } else if (instr->Bits(17, 16) == 0x1 && instr->Bit(11) == 0 && |
| 2261 instr->Bit(6) == 1) { |
| 2262 int Vd = instr->VFPDRegValue(kSimd128Precision); |
| 2263 int Vm = instr->VFPMRegValue(kSimd128Precision); |
| 2264 int size = kBitsPerByte * (1 << instr->Bits(19, 18)); |
2254 const char* type = instr->Bit(10) != 0 ? "f" : "s"; | 2265 const char* type = instr->Bit(10) != 0 ? "f" : "s"; |
2255 if (instr->Bits(9, 6) == 0xd) { | 2266 if (instr->Bits(9, 6) == 0xd) { |
2256 // vabs<type>.<size> Qd, Qm. | 2267 // vabs<type>.<size> Qd, Qm. |
2257 out_buffer_pos_ += | 2268 out_buffer_pos_ += |
2258 SNPrintF(out_buffer_ + out_buffer_pos_, "vabs.%s%d q%d, q%d", | 2269 SNPrintF(out_buffer_ + out_buffer_pos_, "vabs.%s%d q%d, q%d", |
2259 type, size, Vd, Vm); | 2270 type, size, Vd, Vm); |
2260 } else if (instr->Bits(9, 6) == 0xf) { | 2271 } else if (instr->Bits(9, 6) == 0xf) { |
2261 // vneg<type>.<size> Qd, Qm. | 2272 // vneg<type>.<size> Qd, Qm. |
2262 out_buffer_pos_ += | 2273 out_buffer_pos_ += |
2263 SNPrintF(out_buffer_ + out_buffer_pos_, "vneg.%s%d q%d, q%d", | 2274 SNPrintF(out_buffer_ + out_buffer_pos_, "vneg.%s%d q%d, q%d", |
2264 type, size, Vd, Vm); | 2275 type, size, Vd, Vm); |
2265 } else { | 2276 } else { |
2266 Unknown(instr); | 2277 Unknown(instr); |
2267 } | 2278 } |
2268 } else if (instr->Bits(19, 18) == 0x2 && instr->Bits(11, 8) == 0x5) { | 2279 } else if (instr->Bits(19, 18) == 0x2 && instr->Bits(11, 8) == 0x5 && |
| 2280 instr->Bit(6) == 1) { |
2269 // vrecpe/vrsqrte.f32 Qd, Qm. | 2281 // vrecpe/vrsqrte.f32 Qd, Qm. |
2270 int Vd = instr->VFPDRegValue(kSimd128Precision); | 2282 int Vd = instr->VFPDRegValue(kSimd128Precision); |
2271 int Vm = instr->VFPMRegValue(kSimd128Precision); | 2283 int Vm = instr->VFPMRegValue(kSimd128Precision); |
2272 const char* op = instr->Bit(7) == 0 ? "vrecpe" : "vrsqrte"; | 2284 const char* op = instr->Bit(7) == 0 ? "vrecpe" : "vrsqrte"; |
2273 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 2285 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
2274 "%s.f32 q%d, q%d", op, Vd, Vm); | 2286 "%s.f32 q%d, q%d", op, Vd, Vm); |
2275 } else { | 2287 } else { |
2276 Unknown(instr); | 2288 Unknown(instr); |
2277 } | 2289 } |
2278 } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1) { | 2290 } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1 && |
| 2291 instr->Bit(6) == 1) { |
2279 // vshr.u<size> Qd, Qm, shift | 2292 // vshr.u<size> Qd, Qm, shift |
2280 int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16)); | 2293 int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16)); |
2281 int shift = 2 * size - instr->Bits(21, 16); | 2294 int shift = 2 * size - instr->Bits(21, 16); |
2282 int Vd = instr->VFPDRegValue(kSimd128Precision); | 2295 int Vd = instr->VFPDRegValue(kSimd128Precision); |
2283 int Vm = instr->VFPMRegValue(kSimd128Precision); | 2296 int Vm = instr->VFPMRegValue(kSimd128Precision); |
2284 out_buffer_pos_ += | 2297 out_buffer_pos_ += |
2285 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.u%d q%d, q%d, #%d", | 2298 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.u%d q%d, q%d, #%d", |
2286 size, Vd, Vm, shift); | 2299 size, Vd, Vm, shift); |
2287 } else { | 2300 } else { |
2288 Unknown(instr); | 2301 Unknown(instr); |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 pc += d.InstructionDecode(buffer, pc); | 2635 pc += d.InstructionDecode(buffer, pc); |
2623 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), | 2636 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), |
2624 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2637 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
2625 } | 2638 } |
2626 } | 2639 } |
2627 | 2640 |
2628 | 2641 |
2629 } // namespace disasm | 2642 } // namespace disasm |
2630 | 2643 |
2631 #endif // V8_TARGET_ARCH_ARM | 2644 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |