| OLD | NEW |
| 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 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2997 // vmul.f32 <Qd>, <Qn>, <Qm> | 2997 // vmul.f32 <Qd>, <Qn>, <Qm> |
| 2998 // | 2998 // |
| 2999 // 111100110D00nnn0ddd01101MqM1mmm0 where Dddd=Qd, Nnnn=Qn, and Mmmm=Qm. | 2999 // 111100110D00nnn0ddd01101MqM1mmm0 where Dddd=Qd, Nnnn=Qn, and Mmmm=Qm. |
| 3000 assert(OpQd->getType() == IceType_v4f32 && "vmulqf expects type <4 x float>"); | 3000 assert(OpQd->getType() == IceType_v4f32 && "vmulqf expects type <4 x float>"); |
| 3001 constexpr const char *Vmulqf = "vmulqf"; | 3001 constexpr const char *Vmulqf = "vmulqf"; |
| 3002 constexpr IValueT VmulqfOpcode = B24 | B11 | B8 | B4; | 3002 constexpr IValueT VmulqfOpcode = B24 | B11 | B8 | B4; |
| 3003 constexpr bool IsFloatTy = true; | 3003 constexpr bool IsFloatTy = true; |
| 3004 emitSIMDqqqBase(VmulqfOpcode, OpQd, OpQn, OpQm, IsFloatTy, Vmulqf); | 3004 emitSIMDqqqBase(VmulqfOpcode, OpQd, OpQn, OpQm, IsFloatTy, Vmulqf); |
| 3005 } | 3005 } |
| 3006 | 3006 |
| 3007 void AssemblerARM32::vnegqs(Type ElmtTy, const Operand *OpQd, |
| 3008 const Operand *OpQm) { |
| 3009 // VNEG - ARM section A8.8.355, encoding A1: |
| 3010 // vneg.<dt> <Qd>, <Qm> |
| 3011 // |
| 3012 // 111111111D11ss01dddd0F111QM0mmmm where Dddd=Qd, and Mmmm=Qm, and: |
| 3013 // * dt=s8 -> 00=ss, 0=F |
| 3014 // * dt=s16 -> 01=ss, 0=F |
| 3015 // * dt=s32 -> 10=ss, 0=F |
| 3016 // * dt=s32 -> 10=ss, 1=F |
| 3017 constexpr const char *Vneg = "vneg"; |
| 3018 constexpr IValueT VnegOpcode = B24 | B23 | B21 | B20 | B16 | B9 | B8 | B7; |
| 3019 const IValueT Qd = encodeQRegister(OpQd, "Qd", Vneg); |
| 3020 constexpr IValueT Qn = 0; |
| 3021 const IValueT Qm = encodeQRegister(OpQm, "Qm", Vneg); |
| 3022 constexpr bool UseQRegs = true; |
| 3023 constexpr IValueT ElmtShift = 18; |
| 3024 const IValueT ElmtSize = encodeElmtType(ElmtTy); |
| 3025 assert(Utils::IsUint(2, ElmtSize)); |
| 3026 emitSIMDBase(VnegOpcode | (ElmtSize << ElmtShift), mapQRegToDReg(Qd), |
| 3027 mapQRegToDReg(Qn), mapQRegToDReg(Qm), UseQRegs, |
| 3028 isFloatingType(ElmtTy)); |
| 3029 } |
| 3030 |
| 3007 void AssemblerARM32::vorrq(const Operand *OpQd, const Operand *OpQm, | 3031 void AssemblerARM32::vorrq(const Operand *OpQd, const Operand *OpQm, |
| 3008 const Operand *OpQn) { | 3032 const Operand *OpQn) { |
| 3009 // VORR (register) - ARM section A8.8.360, encoding A1: | 3033 // VORR (register) - ARM section A8.8.360, encoding A1: |
| 3010 // vorr <Qd>, <Qn>, <Qm> | 3034 // vorr <Qd>, <Qn>, <Qm> |
| 3011 // | 3035 // |
| 3012 // 111100100D10nnn0ddd00001N1M1mmm0 where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm. | 3036 // 111100100D10nnn0ddd00001N1M1mmm0 where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm. |
| 3013 constexpr const char *Vorrq = "vorrq"; | 3037 constexpr const char *Vorrq = "vorrq"; |
| 3014 constexpr IValueT VorrqOpcode = B21 | B8 | B4; | 3038 constexpr IValueT VorrqOpcode = B21 | B8 | B4; |
| 3015 constexpr Type ElmtTy = IceType_i8; | 3039 constexpr Type ElmtTy = IceType_i8; |
| 3016 emitSIMDqqq(VorrqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vorrq); | 3040 emitSIMDqqq(VorrqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vorrq); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3170 // VPUSH - ARM section A8.8.368, encoding A2: | 3194 // VPUSH - ARM section A8.8.368, encoding A2: |
| 3171 // vpush<c> <RegList> | 3195 // vpush<c> <RegList> |
| 3172 // | 3196 // |
| 3173 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 3197 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 3174 // iiiiiiii=NumConsecRegs. | 3198 // iiiiiiii=NumConsecRegs. |
| 3175 constexpr IValueT VpushOpcode = | 3199 constexpr IValueT VpushOpcode = |
| 3176 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 3200 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 3177 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 3201 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 3178 } | 3202 } |
| 3179 | 3203 |
| 3204 void AssemblerARM32::vshlqi(Type ElmtTy, const Operand *OpQd, |
| 3205 const Operand *OpQm, const Operand *OpQn) { |
| 3206 // VSHL - ARM section A8.8.396, encoding A1: |
| 3207 // vshl Qd, Qm, Qn |
| 3208 // |
| 3209 // 1111001U0Dssnnnndddd0100NQM0mmmm where Ddddd=Qd, Mmmmm=Qm, Nnnnn=Qn, 0=U, |
| 3210 // 1=Q |
| 3211 assert(isScalarIntegerType(ElmtTy) && |
| 3212 "vshl expects vector with integer element type"); |
| 3213 constexpr const char *Vshl = "vshl"; |
| 3214 constexpr IValueT VshlOpcode = B10 | B6; |
| 3215 emitSIMDqqq(VshlOpcode, ElmtTy, OpQd, OpQn, OpQm, Vshl); |
| 3216 } |
| 3217 |
| 3218 void AssemblerARM32::vshlqu(Type ElmtTy, const Operand *OpQd, |
| 3219 const Operand *OpQm, const Operand *OpQn) { |
| 3220 // VSHL - ARM section A8.8.396, encoding A1: |
| 3221 // vshl Qd, Qm, Qn |
| 3222 // |
| 3223 // 1111001U0Dssnnnndddd0100NQM0mmmm where Ddddd=Qd, Mmmmm=Qm, Nnnnn=Qn, 1=U, |
| 3224 // 1=Q |
| 3225 assert(isScalarIntegerType(ElmtTy) && |
| 3226 "vshl expects vector with integer element type"); |
| 3227 constexpr const char *Vshl = "vshl"; |
| 3228 constexpr IValueT VshlOpcode = B24 | B10 | B6; |
| 3229 emitSIMDqqq(VshlOpcode, ElmtTy, OpQd, OpQn, OpQm, Vshl); |
| 3230 } |
| 3231 |
| 3180 void AssemblerARM32::vsqrtd(const Operand *OpDd, const Operand *OpDm, | 3232 void AssemblerARM32::vsqrtd(const Operand *OpDd, const Operand *OpDm, |
| 3181 CondARM32::Cond Cond) { | 3233 CondARM32::Cond Cond) { |
| 3182 // VSQRT - ARM section A8.8.401, encoding A1: | 3234 // VSQRT - ARM section A8.8.401, encoding A1: |
| 3183 // vsqrt<c>.f64 <Dd>, <Dm> | 3235 // vsqrt<c>.f64 <Dd>, <Dm> |
| 3184 // | 3236 // |
| 3185 // cccc11101D110001dddd101111M0mmmm where cccc=Cond, Ddddd=Sd, and Mmmmm=Sm. | 3237 // cccc11101D110001dddd101111M0mmmm where cccc=Cond, Ddddd=Sd, and Mmmmm=Sm. |
| 3186 constexpr const char *Vsqrtd = "vsqrtd"; | 3238 constexpr const char *Vsqrtd = "vsqrtd"; |
| 3187 IValueT Dd = encodeDRegister(OpDd, "Dd", Vsqrtd); | 3239 IValueT Dd = encodeDRegister(OpDd, "Dd", Vsqrtd); |
| 3188 IValueT Dm = encodeDRegister(OpDm, "Dm", Vsqrtd); | 3240 IValueT Dm = encodeDRegister(OpDm, "Dm", Vsqrtd); |
| 3189 constexpr IValueT VsqrtdOpcode = B23 | B21 | B20 | B16 | B7 | B6; | 3241 constexpr IValueT VsqrtdOpcode = B23 | B21 | B20 | B16 | B7 | B6; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3200 constexpr const char *Vsqrts = "vsqrts"; | 3252 constexpr const char *Vsqrts = "vsqrts"; |
| 3201 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts); | 3253 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts); |
| 3202 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts); | 3254 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts); |
| 3203 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6; | 3255 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6; |
| 3204 constexpr IValueT S0 = 0; | 3256 constexpr IValueT S0 = 0; |
| 3205 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm); | 3257 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm); |
| 3206 } | 3258 } |
| 3207 | 3259 |
| 3208 } // end of namespace ARM32 | 3260 } // end of namespace ARM32 |
| 3209 } // end of namespace Ice | 3261 } // end of namespace Ice |
| OLD | NEW |