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

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

Issue 2523933002: [Turbofan] Add ARM support for simd128 moves and swaps. (Closed)
Patch Set: Fix AssembleMove, AssembleSwap. Created 4 years 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 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 1794
1795 1795
1796 static const char* const barrier_option_names[] = { 1796 static const char* const barrier_option_names[] = {
1797 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh", 1797 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh",
1798 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy", 1798 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy",
1799 }; 1799 };
1800 1800
1801 1801
1802 void Decoder::DecodeSpecialCondition(Instruction* instr) { 1802 void Decoder::DecodeSpecialCondition(Instruction* instr) {
1803 switch (instr->SpecialValue()) { 1803 switch (instr->SpecialValue()) {
1804 case 4:
1805 if (instr->Bits(27, 23) == 4 && instr->Bits(21, 20) == 2 &&
1806 instr->Bits(11, 8) == 1 && instr->Bit(4) == 1) {
1807 // vmov Qd, Qm
martyn.capewell 2016/11/23 20:08:46 There's no disassembler test for this.
bbudge 2016/11/24 02:22:53 I didn't realize there were disassembler tests. Ad
1808 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
1809 int Vm = (instr->Bit(7) << 3) | instr->VmValue() >> 1;
bbudge 2016/11/24 02:22:53 I also converted this to use the VfpXRegister func
1810 out_buffer_pos_ +=
1811 SNPrintF(out_buffer_ + out_buffer_pos_, "vmov q%d, q%d", Vd, Vm);
1812 } else {
1813 Unknown(instr);
1814 }
1815 break;
1804 case 5: 1816 case 5:
1805 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && 1817 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
1806 (instr->Bit(4) == 1)) { 1818 (instr->Bit(4) == 1)) {
1807 // vmovl signed 1819 // vmovl signed
1808 if ((instr->VdValue() & 1) != 0) Unknown(instr); 1820 if ((instr->VdValue() & 1) != 0) Unknown(instr);
1809 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); 1821 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
1810 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); 1822 int Vm = (instr->Bit(5) << 4) | instr->VmValue();
1811 int imm3 = instr->Bits(21, 19); 1823 int imm3 = instr->Bits(21, 19);
1812 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1824 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1813 "vmovl.s%d q%d, d%d", imm3*8, Vd, Vm); 1825 "vmovl.s%d q%d, d%d", imm3*8, Vd, Vm);
1814 } else { 1826 } else {
1815 Unknown(instr); 1827 Unknown(instr);
1816 } 1828 }
1817 break; 1829 break;
1818 case 7: 1830 case 7:
1819 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && 1831 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
1820 (instr->Bit(4) == 1)) { 1832 (instr->Bit(4) == 1)) {
1821 // vmovl unsigned 1833 // vmovl unsigned
1822 if ((instr->VdValue() & 1) != 0) Unknown(instr); 1834 if ((instr->VdValue() & 1) != 0) Unknown(instr);
1823 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); 1835 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
1824 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); 1836 int Vm = (instr->Bit(5) << 4) | instr->VmValue();
1825 int imm3 = instr->Bits(21, 19); 1837 int imm3 = instr->Bits(21, 19);
1826 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1838 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1827 "vmovl.u%d q%d, d%d", imm3*8, Vd, Vm); 1839 "vmovl.u%d q%d, d%d", imm3*8, Vd, Vm);
1828 } else if ((instr->Bits(21, 16) == 0x32) && (instr->Bits(11, 7) == 0) && 1840 } else if ((instr->Bits(21, 16) == 0x32) && (instr->Bits(11, 7) == 0) &&
1829 (instr->Bit(4) == 0)) { 1841 (instr->Bit(4) == 0)) {
1830 int Vd = instr->VFPDRegValue(kDoublePrecision); 1842 if (instr->Bit(6) == 0) {
1831 int Vm = instr->VFPMRegValue(kDoublePrecision); 1843 int Vd = instr->VFPDRegValue(kDoublePrecision);
1832 char rtype = (instr->Bit(6) == 0) ? 'd' : 'q'; 1844 int Vm = instr->VFPMRegValue(kDoublePrecision);
1833 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1845 out_buffer_pos_ +=
1834 "vswp %c%d, %c%d", rtype, Vd, rtype, Vm); 1846 SNPrintF(out_buffer_ + out_buffer_pos_, "vswp d%d, d%d", Vd, Vm);
1847 } else {
1848 int Vd = instr->VFPDRegValue(kSimd128Precision);
1849 int Vm = instr->VFPMRegValue(kSimd128Precision);
1850 out_buffer_pos_ +=
1851 SNPrintF(out_buffer_ + out_buffer_pos_, "vswp q%d, q%d", Vd, Vm);
martyn.capewell 2016/11/23 20:08:46 There's no disassembler test for this.
bbudge 2016/11/24 02:22:53 Done.
1852 }
1835 } else { 1853 } else {
1836 Unknown(instr); 1854 Unknown(instr);
1837 } 1855 }
1838 break; 1856 break;
1839 case 8: 1857 case 8:
1840 if (instr->Bits(21, 20) == 0) { 1858 if (instr->Bits(21, 20) == 0) {
1841 // vst1 1859 // vst1
1842 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); 1860 int Vd = (instr->Bit(22) << 4) | instr->VdValue();
1843 int Rn = instr->VnValue(); 1861 int Rn = instr->VnValue();
1844 int type = instr->Bits(11, 8); 1862 int type = instr->Bits(11, 8);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 pc += d.InstructionDecode(buffer, pc); 2188 pc += d.InstructionDecode(buffer, pc);
2171 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), 2189 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc),
2172 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 2190 *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
2173 } 2191 }
2174 } 2192 }
2175 2193
2176 2194
2177 } // namespace disasm 2195 } // namespace disasm
2178 2196
2179 #endif // V8_TARGET_ARCH_ARM 2197 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698