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

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

Issue 2629223005: [ARM] Add Neon shift instructions vshl, vshr. (Closed)
Patch Set: Fix DCHECK in ArithmeticShiftRight. Created 3 years, 11 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
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 "vmovl.s%d q%d, d%d", imm3*8, Vd, Vm); 1966 "vmovl.s%d q%d, d%d", imm3*8, Vd, Vm);
1967 } else if (instr->Bits(21, 20) == 3 && instr->Bit(4) == 0) { 1967 } else if (instr->Bits(21, 20) == 3 && instr->Bit(4) == 0) {
1968 // vext.8 Qd, Qm, Qn, imm4 1968 // vext.8 Qd, Qm, Qn, imm4
1969 int imm4 = instr->Bits(11, 8); 1969 int imm4 = instr->Bits(11, 8);
1970 int Vd = instr->VFPDRegValue(kSimd128Precision); 1970 int Vd = instr->VFPDRegValue(kSimd128Precision);
1971 int Vm = instr->VFPMRegValue(kSimd128Precision); 1971 int Vm = instr->VFPMRegValue(kSimd128Precision);
1972 int Vn = instr->VFPNRegValue(kSimd128Precision); 1972 int Vn = instr->VFPNRegValue(kSimd128Precision);
1973 out_buffer_pos_ += 1973 out_buffer_pos_ +=
1974 SNPrintF(out_buffer_ + out_buffer_pos_, "vext.8 q%d, q%d, q%d, #%d", 1974 SNPrintF(out_buffer_ + out_buffer_pos_, "vext.8 q%d, q%d, q%d, #%d",
1975 Vd, Vn, Vm, imm4); 1975 Vd, Vn, Vm, imm4);
1976 } else if (instr->Bits(11, 7) == 0xA && instr->Bit(4) == 1) {
1977 // vshl.i<size> Qd, Qm, shift
1978 int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
1979 int shift = instr->Bits(21, 16) - size;
1980 int Vd = instr->VFPDRegValue(kSimd128Precision);
1981 int Vm = instr->VFPMRegValue(kSimd128Precision);
1982 out_buffer_pos_ +=
1983 SNPrintF(out_buffer_ + out_buffer_pos_, "vshl.i%d q%d, q%d, #%d",
1984 size, Vd, Vm, shift);
1985 } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1) {
1986 // vshr.s<size> Qd, Qm, shift
1987 int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
1988 int shift = 2 * size - instr->Bits(21, 16);
1989 int Vd = instr->VFPDRegValue(kSimd128Precision);
1990 int Vm = instr->VFPMRegValue(kSimd128Precision);
1991 out_buffer_pos_ +=
1992 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.s%d q%d, q%d, #%d",
1993 size, Vd, Vm, shift);
1976 } else { 1994 } else {
1977 Unknown(instr); 1995 Unknown(instr);
1978 } 1996 }
1979 break; 1997 break;
1980 case 6: 1998 case 6:
1981 if (instr->Bits(11, 8) == 8) { 1999 if (instr->Bits(11, 8) == 8) {
1982 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); 2000 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1983 int Vd = instr->VFPDRegValue(kSimd128Precision); 2001 int Vd = instr->VFPDRegValue(kSimd128Precision);
1984 int Vm = instr->VFPMRegValue(kSimd128Precision); 2002 int Vm = instr->VFPMRegValue(kSimd128Precision);
1985 int Vn = instr->VFPNRegValue(kSimd128Precision); 2003 int Vn = instr->VFPNRegValue(kSimd128Precision);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 type, size, Vd, Vm); 2173 type, size, Vd, Vm);
2156 } else if (instr->Bits(9, 6) == 0xf) { 2174 } else if (instr->Bits(9, 6) == 0xf) {
2157 // vneg<type>.<size> Qd, Qm. 2175 // vneg<type>.<size> Qd, Qm.
2158 out_buffer_pos_ += 2176 out_buffer_pos_ +=
2159 SNPrintF(out_buffer_ + out_buffer_pos_, "vneg.%s%d q%d, q%d", 2177 SNPrintF(out_buffer_ + out_buffer_pos_, "vneg.%s%d q%d, q%d",
2160 type, size, Vd, Vm); 2178 type, size, Vd, Vm);
2161 } else { 2179 } else {
2162 Unknown(instr); 2180 Unknown(instr);
2163 } 2181 }
2164 } else if (instr->Bits(19, 18) == 0x2 && instr->Bits(11, 8) == 0x5) { 2182 } else if (instr->Bits(19, 18) == 0x2 && instr->Bits(11, 8) == 0x5) {
2183 // vrecpe/vrsqrte.f32 Qd, Qm.
2165 int Vd = instr->VFPDRegValue(kSimd128Precision); 2184 int Vd = instr->VFPDRegValue(kSimd128Precision);
2166 int Vm = instr->VFPMRegValue(kSimd128Precision); 2185 int Vm = instr->VFPMRegValue(kSimd128Precision);
2167 const char* op = instr->Bit(7) == 0 ? "vrecpe" : "vrsqrte"; 2186 const char* op = instr->Bit(7) == 0 ? "vrecpe" : "vrsqrte";
2168 // vrecpe/vrsqrte.f32 Qd, Qm.
2169 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2187 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2170 "%s.f32 q%d, q%d", op, Vd, Vm); 2188 "%s.f32 q%d, q%d", op, Vd, Vm);
2171 } else { 2189 } else {
2172 Unknown(instr); 2190 Unknown(instr);
2173 } 2191 }
2192 } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1) {
2193 // vshr.u<size> Qd, Qm, shift
2194 int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
2195 int shift = 2 * size - instr->Bits(21, 16);
2196 int Vd = instr->VFPDRegValue(kSimd128Precision);
2197 int Vm = instr->VFPMRegValue(kSimd128Precision);
2198 out_buffer_pos_ +=
2199 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.u%d q%d, q%d, #%d",
2200 size, Vd, Vm, shift);
2174 } else { 2201 } else {
2175 Unknown(instr); 2202 Unknown(instr);
2176 } 2203 }
2177 break; 2204 break;
2178 case 8: 2205 case 8:
2179 if (instr->Bits(21, 20) == 0) { 2206 if (instr->Bits(21, 20) == 0) {
2180 // vst1 2207 // vst1
2181 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); 2208 int Vd = (instr->Bit(22) << 4) | instr->VdValue();
2182 int Rn = instr->VnValue(); 2209 int Rn = instr->VnValue();
2183 int type = instr->Bits(11, 8); 2210 int type = instr->Bits(11, 8);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 pc += d.InstructionDecode(buffer, pc); 2536 pc += d.InstructionDecode(buffer, pc);
2510 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), 2537 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc),
2511 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 2538 *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
2512 } 2539 }
2513 } 2540 }
2514 2541
2515 2542
2516 } // namespace disasm 2543 } // namespace disasm
2517 2544
2518 #endif // V8_TARGET_ARCH_ARM 2545 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698