Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: src/arm/disasm-arm.cc

Issue 2868603002: [ARM] Improve VFP register moves. (Closed)
Patch Set: Clean up, renaming. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 (instr->Bit(4) == 1)) { 2174 (instr->Bit(4) == 1)) {
2175 // vmovl unsigned 2175 // vmovl unsigned
2176 if ((instr->VdValue() & 1) != 0) Unknown(instr); 2176 if ((instr->VdValue() & 1) != 0) Unknown(instr);
2177 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); 2177 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
2178 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); 2178 int Vm = (instr->Bit(5) << 4) | instr->VmValue();
2179 int imm3 = instr->Bits(21, 19); 2179 int imm3 = instr->Bits(21, 19);
2180 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2180 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2181 "vmovl.u%d q%d, d%d", imm3 * 8, Vd, Vm); 2181 "vmovl.u%d q%d, d%d", imm3 * 8, Vd, Vm);
2182 } else if (instr->Opc1Value() == 7 && instr->Bit(4) == 0) { 2182 } else if (instr->Opc1Value() == 7 && instr->Bit(4) == 0) {
2183 if (instr->Bits(11, 7) == 0x18) { 2183 if (instr->Bits(11, 7) == 0x18) {
2184 int Vd = instr->VFPDRegValue(kSimd128Precision);
2185 int Vm = instr->VFPMRegValue(kDoublePrecision); 2184 int Vm = instr->VFPMRegValue(kDoublePrecision);
2186 int index = instr->Bit(19); 2185 int imm4 = instr->Bits(19, 16);
2187 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2186 int size = 0, index = 0;
2188 "vdup q%d, d%d[%d]", Vd, Vm, index); 2187 if ((imm4 & 0x1) != 0) {
2188 size = 8;
2189 index = imm4 >> 1;
2190 } else if ((imm4 & 0x2) != 0) {
2191 size = 16;
2192 index = imm4 >> 2;
2193 } else {
2194 size = 32;
2195 index = imm4 >> 3;
2196 }
2197 if (instr->Bit(6) == 0) {
2198 int Vd = instr->VFPDRegValue(kDoublePrecision);
2199 out_buffer_pos_ +=
2200 SNPrintF(out_buffer_ + out_buffer_pos_, "vdup.%i d%d, d%d[%d]",
2201 size, Vd, Vm, index);
2202 } else {
2203 int Vd = instr->VFPDRegValue(kSimd128Precision);
2204 out_buffer_pos_ +=
2205 SNPrintF(out_buffer_ + out_buffer_pos_, "vdup.%i q%d, d%d[%d]",
2206 size, Vd, Vm, index);
2207 }
2189 } else if (instr->Bits(11, 10) == 0x2) { 2208 } else if (instr->Bits(11, 10) == 0x2) {
2190 int Vd = instr->VFPDRegValue(kDoublePrecision); 2209 int Vd = instr->VFPDRegValue(kDoublePrecision);
2191 int Vn = instr->VFPNRegValue(kDoublePrecision); 2210 int Vn = instr->VFPNRegValue(kDoublePrecision);
2192 int Vm = instr->VFPMRegValue(kDoublePrecision); 2211 int Vm = instr->VFPMRegValue(kDoublePrecision);
2193 int len = instr->Bits(9, 8); 2212 int len = instr->Bits(9, 8);
2194 NeonListOperand list(DwVfpRegister::from_code(Vn), len + 1); 2213 NeonListOperand list(DwVfpRegister::from_code(Vn), len + 1);
2195 out_buffer_pos_ += 2214 out_buffer_pos_ +=
2196 SNPrintF(out_buffer_ + out_buffer_pos_, "%s d%d, ", 2215 SNPrintF(out_buffer_ + out_buffer_pos_, "%s d%d, ",
2197 instr->Bit(6) == 0 ? "vtbl.8" : "vtbx.8", Vd); 2216 instr->Bit(6) == 0 ? "vtbl.8" : "vtbx.8", Vd);
2198 FormatNeonList(Vn, list.type()); 2217 FormatNeonList(Vn, list.type());
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1 && 2328 } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1 &&
2310 instr->Bit(6) == 1) { 2329 instr->Bit(6) == 1) {
2311 // vshr.u<size> Qd, Qm, shift 2330 // vshr.u<size> Qd, Qm, shift
2312 int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16)); 2331 int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
2313 int shift = 2 * size - instr->Bits(21, 16); 2332 int shift = 2 * size - instr->Bits(21, 16);
2314 int Vd = instr->VFPDRegValue(kSimd128Precision); 2333 int Vd = instr->VFPDRegValue(kSimd128Precision);
2315 int Vm = instr->VFPMRegValue(kSimd128Precision); 2334 int Vm = instr->VFPMRegValue(kSimd128Precision);
2316 out_buffer_pos_ += 2335 out_buffer_pos_ +=
2317 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.u%d q%d, q%d, #%d", 2336 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.u%d q%d, q%d, #%d",
2318 size, Vd, Vm, shift); 2337 size, Vd, Vm, shift);
2338 } else if (instr->Bits(11, 8) == 0x5 && instr->Bit(6) == 0 &&
martyn.capewell 2017/05/10 12:38:06 Consider combining these - bit 8 determines how sh
bbudge 2017/05/10 17:54:52 That occurred to me too. I think it's a good idea.
2339 instr->Bit(4) == 1) {
2340 // vsli.<size> Dd, Dm, shift
2341 int imm7 = instr->Bits(21, 16);
2342 if (instr->Bit(7) != 0) imm7 += 64;
2343 int size = base::bits::RoundDownToPowerOfTwo32(imm7);
2344 int shift = imm7 - size;
2345 int Vd = instr->VFPDRegValue(kDoublePrecision);
2346 int Vm = instr->VFPMRegValue(kDoublePrecision);
2347 out_buffer_pos_ +=
2348 SNPrintF(out_buffer_ + out_buffer_pos_, "vsli.%d d%d, d%d, #%d",
2349 size, Vd, Vm, shift);
2350 } else if (instr->Bits(11, 8) == 0x4 && instr->Bit(6) == 0 &&
2351 instr->Bit(4) == 1) {
2352 // vsri.<size> Dd, Dm, shift
2353 int imm7 = instr->Bits(21, 16);
2354 if (instr->Bit(7) != 0) imm7 += 64;
2355 int size = base::bits::RoundDownToPowerOfTwo32(imm7);
2356 int shift = 2 * size - imm7;
2357 int Vd = instr->VFPDRegValue(kDoublePrecision);
2358 int Vm = instr->VFPMRegValue(kDoublePrecision);
2359 out_buffer_pos_ +=
2360 SNPrintF(out_buffer_ + out_buffer_pos_, "vsri.%d d%d, d%d, #%d",
2361 size, Vd, Vm, shift);
2319 } else { 2362 } else {
2320 Unknown(instr); 2363 Unknown(instr);
2321 } 2364 }
2322 break; 2365 break;
2323 case 8: 2366 case 8:
2324 if (instr->Bits(21, 20) == 0) { 2367 if (instr->Bits(21, 20) == 0) {
2325 // vst1 2368 // vst1
2326 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); 2369 int Vd = (instr->Bit(22) << 4) | instr->VdValue();
2327 int Rn = instr->VnValue(); 2370 int Rn = instr->VnValue();
2328 int type = instr->Bits(11, 8); 2371 int type = instr->Bits(11, 8);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 pc += d.InstructionDecode(buffer, pc); 2697 pc += d.InstructionDecode(buffer, pc);
2655 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), 2698 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc),
2656 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 2699 *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
2657 } 2700 }
2658 } 2701 }
2659 2702
2660 2703
2661 } // namespace disasm 2704 } // namespace disasm
2662 2705
2663 #endif // V8_TARGET_ARCH_ARM 2706 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698