Chromium Code Reviews| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 // Rn should be used, and iiiiiiiiiiii defines the rotated Imm8 value. | 231 // Rn should be used, and iiiiiiiiiiii defines the rotated Imm8 value. |
| 232 // | 232 // |
| 233 // ***** OpEncoding3 ***** | 233 // ***** OpEncoding3 ***** |
| 234 // | 234 // |
| 235 // Value=00000000pu0w0nnnn0000iiii0000jjjj where nnnn=Rn, iiiijjjj=Imm8, p=1 | 235 // Value=00000000pu0w0nnnn0000iiii0000jjjj where nnnn=Rn, iiiijjjj=Imm8, p=1 |
| 236 // if pre-indexed addressing, u=1 if offset positive, and w=1 if writeback to | 236 // if pre-indexed addressing, u=1 if offset positive, and w=1 if writeback to |
| 237 // Rn. | 237 // Rn. |
| 238 // | 238 // |
| 239 // ***** OpEncodingMemEx ***** | 239 // ***** OpEncodingMemEx ***** |
| 240 // | 240 // |
| 241 // Value=000000000000nnnn0000000000000000 where nnnn=Rn. | 241 // Value=00000000U000nnnn00000000xxxxxxxx where nnnn=Rn, xxxxxxxx=abs(Offset), |
| 242 // and U=1 Offset>=0. | |
| 242 EncodedAsImmRegOffset, | 243 EncodedAsImmRegOffset, |
| 243 // Value=0000000pu0w00nnnnttttiiiiiss0mmmm where nnnn is the base register Rn, | 244 // Value=0000000pu0w00nnnnttttiiiiiss0mmmm where nnnn is the base register Rn, |
| 244 // mmmm is the index register Rm, iiiii is the shift amount, ss is the shift | 245 // mmmm is the index register Rm, iiiii is the shift amount, ss is the shift |
| 245 // kind, p=1 if pre-indexed addressing, u=1 if offset positive, and w=1 if | 246 // kind, p=1 if pre-indexed addressing, u=1 if offset positive, and w=1 if |
| 246 // writeback to Rn. | 247 // writeback to Rn. |
| 247 EncodedAsShiftRotateImm5, | 248 EncodedAsShiftRotateImm5, |
| 248 // Value=000000000000000000000iiiii0000000 where iiii defines the Imm5 value | 249 // Value=000000000000000000000iiiii0000000 where iiii defines the Imm5 value |
| 249 // to shift. | 250 // to shift. |
| 250 EncodedAsShiftImm5, | 251 EncodedAsShiftImm5, |
| 251 // Value=iiiiiss0mmmm where mmmm is the register to rotate, ss is the shift | 252 // Value=iiiiiss0mmmm where mmmm is the register to rotate, ss is the shift |
| (...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2180 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, | 2181 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, |
| 2181 // and Mmmmm=Rm. | 2182 // and Mmmmm=Rm. |
| 2182 constexpr const char *Vdivd = "vdivd"; | 2183 constexpr const char *Vdivd = "vdivd"; |
| 2183 IValueT Dd = encodeDRegister(OpDd, "Dd", Vdivd); | 2184 IValueT Dd = encodeDRegister(OpDd, "Dd", Vdivd); |
| 2184 IValueT Dn = encodeDRegister(OpDn, "Dn", Vdivd); | 2185 IValueT Dn = encodeDRegister(OpDn, "Dn", Vdivd); |
| 2185 IValueT Dm = encodeDRegister(OpDm, "Dm", Vdivd); | 2186 IValueT Dm = encodeDRegister(OpDm, "Dm", Vdivd); |
| 2186 constexpr IValueT VdivdOpcode = B23; | 2187 constexpr IValueT VdivdOpcode = B23; |
| 2187 emitVFPddd(Cond, VdivdOpcode, Dd, Dn, Dm); | 2188 emitVFPddd(Cond, VdivdOpcode, Dd, Dn, Dm); |
| 2188 } | 2189 } |
| 2189 | 2190 |
| 2191 void AssemblerARM32::vldrd(const Operand *OpDd, const Operand *OpAddress, | |
| 2192 CondARM32::Cond Cond, const TargetInfo &TInfo) { | |
| 2193 // VLDR - ARM section A8.8.333, encoding A1. | |
| 2194 // vldr<c> <Dd>, [<Rn>{, #+/-<imm>}] | |
| 2195 // | |
| 2196 // cccc1101UD01nnnndddd1011iiiiiiii where cccc=Cond, nnnn=Rn, Ddddd=Rd, | |
| 2197 // iiiiiiii=abs(Opcode), and U=1 if Opcode>=0, | |
| 2198 // cccc1101ud01nnnndddd1010iiiiiiii. | |
|
Karl
2016/01/21 17:47:36
Delete this line (don't duplicate pattern).
Done.
| |
| 2199 constexpr const char *Vldrd = "vldrd"; | |
| 2200 IValueT Dd = encodeDRegister(OpDd, "Dd", Vldrd); | |
| 2201 assert(CondARM32::isDefined(Cond)); | |
| 2202 IValueT Address; | |
| 2203 assert(encodeAddress(OpAddress, Address, TInfo) == EncodedAsImmRegOffset); | |
| 2204 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | |
| 2205 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | B8 | | |
| 2206 (encodeCondition(Cond) << kConditionShift) | | |
| 2207 (getYInRegYXXXX(Dd) << 22) | | |
| 2208 (getXXXXInRegYXXXX(Dd) << 12) | Address; | |
| 2209 emitInst(Encoding); | |
| 2210 } | |
| 2211 | |
| 2212 void AssemblerARM32::vldrs(const Operand *OpSd, const Operand *OpAddress, | |
| 2213 CondARM32::Cond Cond, const TargetInfo &TInfo) { | |
| 2214 // VDLR - ARM section A8.8.333, encoding A2. | |
| 2215 // vldr<c> <Sd>, [<Rn>{, #+/-<imm>]] | |
| 2216 // | |
| 2217 // cccc1101UD01nnnndddd1010iiiiiiii where cccc=Cond, nnnn=Rn, ddddD=Sd, | |
| 2218 // iiiiiiii=abs(Opcode), and U=1 if Opcode >= 0; | |
| 2219 constexpr const char *Vldrs = "vldrs"; | |
| 2220 IValueT Sd = encodeSRegister(OpSd, "Sd", Vldrs); | |
| 2221 assert(CondARM32::isDefined(Cond)); | |
| 2222 IValueT Address; | |
| 2223 assert(encodeAddress(OpAddress, Address, TInfo) == EncodedAsImmRegOffset); | |
| 2224 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | |
| 2225 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | | |
| 2226 (encodeCondition(Cond) << kConditionShift) | | |
| 2227 (getYInRegXXXXY(Sd) << 22) | | |
| 2228 (getXXXXInRegXXXXY(Sd) << 12) | Address; | |
| 2229 emitInst(Encoding); | |
| 2230 } | |
| 2231 | |
| 2190 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, | 2232 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, |
| 2191 const Operand *OpSm, CondARM32::Cond Cond) { | 2233 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2192 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: | 2234 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: |
| 2193 // vmul<c>.f32 <Sd>, <Sn>, <Sm> | 2235 // vmul<c>.f32 <Sd>, <Sn>, <Sm> |
| 2194 // | 2236 // |
| 2195 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, | 2237 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2196 // and mmmmM=Rm. | 2238 // and mmmmM=Rm. |
| 2197 constexpr const char *Vmuls = "vmuls"; | 2239 constexpr const char *Vmuls = "vmuls"; |
| 2198 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls); | 2240 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls); |
| 2199 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls); | 2241 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2289 // | 2331 // |
| 2290 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2332 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 2291 // iiiiiiii=NumConsecRegs. | 2333 // iiiiiiii=NumConsecRegs. |
| 2292 constexpr IValueT VpushOpcode = | 2334 constexpr IValueT VpushOpcode = |
| 2293 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2335 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 2294 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2336 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 2295 } | 2337 } |
| 2296 | 2338 |
| 2297 } // end of namespace ARM32 | 2339 } // end of namespace ARM32 |
| 2298 } // end of namespace Ice | 2340 } // end of namespace Ice |
| OLD | NEW |