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

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

Issue 2620343002: [ARM] Add vand, vorr NEON instructions. (Closed)
Patch Set: 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
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 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 static const char* const barrier_option_names[] = { 1851 static const char* const barrier_option_names[] = {
1852 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh", 1852 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh",
1853 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy", 1853 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy",
1854 }; 1854 };
1855 1855
1856 1856
1857 void Decoder::DecodeSpecialCondition(Instruction* instr) { 1857 void Decoder::DecodeSpecialCondition(Instruction* instr) {
1858 switch (instr->SpecialValue()) { 1858 switch (instr->SpecialValue()) {
1859 case 4: 1859 case 4:
1860 if (instr->Bits(21, 20) == 2 && instr->Bits(11, 8) == 1 && 1860 if (instr->Bits(21, 20) == 2 && instr->Bits(11, 8) == 1 &&
1861 instr->Bit(4) == 1) { 1861 instr->Bit(6) == 1 && instr->Bit(4) == 1) {
1862 // vmov Qd, Qm
1863 int Vd = instr->VFPDRegValue(kSimd128Precision); 1862 int Vd = instr->VFPDRegValue(kSimd128Precision);
1864 int Vm = instr->VFPMRegValue(kSimd128Precision); 1863 int Vm = instr->VFPMRegValue(kSimd128Precision);
1865 out_buffer_pos_ += 1864 int Vn = instr->VFPNRegValue(kSimd128Precision);
1866 SNPrintF(out_buffer_ + out_buffer_pos_, "vmov q%d, q%d", Vd, Vm); 1865 if (Vm == Vn) {
1866 // vmov Qd, Qm
1867 out_buffer_pos_ +=
1868 SNPrintF(out_buffer_ + out_buffer_pos_, "vmov q%d, q%d", Vd, Vm);
1869 } else {
1870 // vorr Qd, Qm, Qn.
1871 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1872 "vorr q%d, q%d, q%d", Vd, Vn, Vm);
1873 }
1867 } else if (instr->Bits(11, 8) == 8) { 1874 } else if (instr->Bits(11, 8) == 8) {
1868 const char* op = (instr->Bit(4) == 0) ? "vadd" : "vtst"; 1875 const char* op = (instr->Bit(4) == 0) ? "vadd" : "vtst";
1869 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); 1876 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1870 int Vd = instr->VFPDRegValue(kSimd128Precision); 1877 int Vd = instr->VFPDRegValue(kSimd128Precision);
1871 int Vm = instr->VFPMRegValue(kSimd128Precision); 1878 int Vm = instr->VFPMRegValue(kSimd128Precision);
1872 int Vn = instr->VFPNRegValue(kSimd128Precision); 1879 int Vn = instr->VFPNRegValue(kSimd128Precision);
1873 // vadd/vtst.i<size> Qd, Qm, Qn. 1880 // vadd/vtst.i<size> Qd, Qm, Qn.
1874 out_buffer_pos_ += 1881 out_buffer_pos_ +=
1875 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d", op, 1882 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d", op,
1876 size, Vd, Vn, Vm); 1883 size, Vd, Vn, Vm);
(...skipping 15 matching lines...) Expand all
1892 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1899 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1893 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm); 1900 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
1894 } else if (instr->Bits(21, 20) == 0 && instr->Bits(11, 8) == 0xe && 1901 } else if (instr->Bits(21, 20) == 0 && instr->Bits(11, 8) == 0xe &&
1895 instr->Bit(4) == 0) { 1902 instr->Bit(4) == 0) {
1896 int Vd = instr->VFPDRegValue(kSimd128Precision); 1903 int Vd = instr->VFPDRegValue(kSimd128Precision);
1897 int Vm = instr->VFPMRegValue(kSimd128Precision); 1904 int Vm = instr->VFPMRegValue(kSimd128Precision);
1898 int Vn = instr->VFPNRegValue(kSimd128Precision); 1905 int Vn = instr->VFPNRegValue(kSimd128Precision);
1899 // vceq.f32 Qd, Qm, Qn. 1906 // vceq.f32 Qd, Qm, Qn.
1900 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1907 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1901 "vceq.f32 q%d, q%d, q%d", Vd, Vn, Vm); 1908 "vceq.f32 q%d, q%d, q%d", Vd, Vn, Vm);
1909 } else if (instr->Bits(11, 8) == 1 && instr->Bits(21, 20) == 0 &&
1910 instr->Bit(6) == 1 && instr->Bit(4) == 1) {
1911 int Vd = instr->VFPDRegValue(kSimd128Precision);
1912 int Vm = instr->VFPMRegValue(kSimd128Precision);
1913 int Vn = instr->VFPNRegValue(kSimd128Precision);
1914 // vand Qd, Qm, Qn.
1915 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1916 "vand q%d, q%d, q%d", Vd, Vn, Vm);
1902 } else if (instr->Bit(20) == 0 && instr->Bits(11, 8) == 0xf && 1917 } else if (instr->Bit(20) == 0 && instr->Bits(11, 8) == 0xf &&
1903 instr->Bit(6) == 1 && instr->Bit(4) == 1) { 1918 instr->Bit(6) == 1 && instr->Bit(4) == 1) {
1904 int Vd = instr->VFPDRegValue(kSimd128Precision); 1919 int Vd = instr->VFPDRegValue(kSimd128Precision);
1905 int Vm = instr->VFPMRegValue(kSimd128Precision); 1920 int Vm = instr->VFPMRegValue(kSimd128Precision);
1906 int Vn = instr->VFPNRegValue(kSimd128Precision); 1921 int Vn = instr->VFPNRegValue(kSimd128Precision);
1907 const char* op = instr->Bit(21) == 0 ? "vrecps" : "vrsqrts"; 1922 const char* op = instr->Bit(21) == 0 ? "vrecps" : "vrsqrts";
1908 // vrecps/vrsqrts.f32 Qd, Qm, Qn. 1923 // vrecps/vrsqrts.f32 Qd, Qm, Qn.
1909 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1924 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1910 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm); 1925 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
1911 } else { 1926 } else {
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
2438 pc += d.InstructionDecode(buffer, pc); 2453 pc += d.InstructionDecode(buffer, pc);
2439 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), 2454 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc),
2440 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 2455 *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
2441 } 2456 }
2442 } 2457 }
2443 2458
2444 2459
2445 } // namespace disasm 2460 } // namespace disasm
2446 2461
2447 #endif // V8_TARGET_ARCH_ARM 2462 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698