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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1651263002: Add VSUB vector instruction to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 10 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/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===//
2 // 2 //
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 // 6 //
7 // Modified by the Subzero authors. 7 // Modified by the Subzero authors.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2152 constexpr const char *Vadds = "vadds"; 2152 constexpr const char *Vadds = "vadds";
2153 constexpr IValueT VaddsOpcode = B21 | B20; 2153 constexpr IValueT VaddsOpcode = B21 | B20;
2154 emitVFPsss(Cond, VaddsOpcode, OpSd, OpSn, OpSm, Vadds); 2154 emitVFPsss(Cond, VaddsOpcode, OpSd, OpSn, OpSm, Vadds);
2155 } 2155 }
2156 2156
2157 void AssemblerARM32::vaddqi(Type ElmtTy, const Operand *OpQd, 2157 void AssemblerARM32::vaddqi(Type ElmtTy, const Operand *OpQd,
2158 const Operand *OpQm, const Operand *OpQn) { 2158 const Operand *OpQm, const Operand *OpQn) {
2159 // VADD (integer) - ARM section A8.8.282, encoding A1: 2159 // VADD (integer) - ARM section A8.8.282, encoding A1:
2160 // vadd.<dt> <Qd>, <Qn>, <Qm> 2160 // vadd.<dt> <Qd>, <Qn>, <Qm>
2161 // 2161 //
2162 // 111100100Dssnnn0ddd01000NqM0mmm0 where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm, 2162 // 111100100Dssnnn0ddd01000N1M0mmm0 where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm,
2163 // and dt in [i8, i16, i32, i64] where ss is the index. 2163 // and dt in [i8, i16, i32, i64] where ss is the index.
2164 constexpr const char *Vaddqi = "vaddqi"; 2164 constexpr const char *Vaddqi = "vaddqi";
2165 constexpr IValueT VaddqiOpcode = B11; 2165 constexpr IValueT VaddqiOpcode = B11;
2166 emitSIMDqqq(VaddqiOpcode, ElmtTy, OpQd, OpQm, OpQn, Vaddqi); 2166 emitSIMDqqq(VaddqiOpcode, ElmtTy, OpQd, OpQm, OpQn, Vaddqi);
2167 } 2167 }
2168 2168
2169 void AssemblerARM32::vaddqf(const Operand *OpQd, const Operand *OpQn, 2169 void AssemblerARM32::vaddqf(const Operand *OpQd, const Operand *OpQn,
2170 const Operand *OpQm) { 2170 const Operand *OpQm) {
2171 // VADD (floating-point) - ARM section A8.8.283, Encoding A1: 2171 // VADD (floating-point) - ARM section A8.8.283, Encoding A1:
2172 // vadd.f32 <Qd>, <Qn>, <Qm> 2172 // vadd.f32 <Qd>, <Qn>, <Qm>
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
2771 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: 2771 // VSUB (floating-point) - ARM section A8.8.415, encoding A2:
2772 // vsub<c>.f64 <Dd>, <Dn>, <Dm> 2772 // vsub<c>.f64 <Dd>, <Dn>, <Dm>
2773 // 2773 //
2774 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2774 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2775 // and Mmmmm=Rm. 2775 // and Mmmmm=Rm.
2776 constexpr const char *Vsubd = "vsubd"; 2776 constexpr const char *Vsubd = "vsubd";
2777 constexpr IValueT VsubdOpcode = B21 | B20 | B6; 2777 constexpr IValueT VsubdOpcode = B21 | B20 | B6;
2778 emitVFPddd(Cond, VsubdOpcode, OpDd, OpDn, OpDm, Vsubd); 2778 emitVFPddd(Cond, VsubdOpcode, OpDd, OpDn, OpDm, Vsubd);
2779 } 2779 }
2780 2780
2781 void AssemblerARM32::vsubqi(Type ElmtTy, const Operand *OpQd,
2782 const Operand *OpQm, const Operand *OpQn) {
2783 // VSUB (integer) - ARM section A8.8.414, encoding A1:
2784 // vsub.<dt> <Qd>, <Qn>, <Qm>
2785 //
2786 // 111100110Dssnnn0ddd01000N1M0mmm0 where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm,
2787 // and dt in [i8, i16, i32, i64] where ss is the index.
2788 constexpr const char *Vsubqi = "vsubqi";
2789 constexpr IValueT VsubqiOpcode = B24 | B11;
2790 emitSIMDqqq(VsubqiOpcode, ElmtTy, OpQd, OpQm, OpQn, Vsubqi);
2791 }
2792
2793 void AssemblerARM32::vsubqf(const Operand *OpQd, const Operand *OpQn,
2794 const Operand *OpQm) {
2795 // VSUB (floating-point) - ARM section A8.8.415, Encoding A1:
2796 // vsub.f32 <Qd>, <Qn>, <Qm>
2797 //
2798 // 111100100D10nnn0ddd01101N1M0mmm0 where Dddd=Qd, Nnnn=Qn, and Mmmm=Qm.
2799 constexpr const char *Vsubqf = "vsubqf";
2800 constexpr IValueT VsubqfOpcode = B21 | B11 | B10 | B8;
2801 emitSIMDqqq(VsubqfOpcode, IceType_f32, OpQd, OpQn, OpQm, Vsubqf);
2802 }
2803
2781 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, 2804 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode,
2782 const Variable *OpBaseReg, 2805 const Variable *OpBaseReg,
2783 SizeT NumConsecRegs) { 2806 SizeT NumConsecRegs) {
2784 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg); 2807 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg);
2785 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register. 2808 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register.
2786 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register. 2809 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register.
2787 assert(0 < NumConsecRegs); 2810 assert(0 < NumConsecRegs);
2788 (void)VpushVpopMaxConsecRegs; 2811 (void)VpushVpopMaxConsecRegs;
2789 assert(NumConsecRegs <= VpushVpopMaxConsecRegs); 2812 assert(NumConsecRegs <= VpushVpopMaxConsecRegs);
2790 assert((BaseReg + NumConsecRegs) <= RegARM32::getNumSRegs()); 2813 assert((BaseReg + NumConsecRegs) <= RegARM32::getNumSRegs());
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2847 constexpr const char *Vsqrts = "vsqrts"; 2870 constexpr const char *Vsqrts = "vsqrts";
2848 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts); 2871 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts);
2849 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts); 2872 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts);
2850 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6; 2873 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6;
2851 constexpr IValueT S0 = 0; 2874 constexpr IValueT S0 = 0;
2852 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm); 2875 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm);
2853 } 2876 }
2854 2877
2855 } // end of namespace ARM32 2878 } // end of namespace ARM32
2856 } // end of namespace Ice 2879 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698