OLD | NEW |
1 //===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===// | 1 //===- subzero/src/IceAssemblerARM32.h - 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, | 217 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, |
218 const TargetInfo &TInfo); | 218 const TargetInfo &TInfo); |
219 | 219 |
220 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, | 220 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, |
221 const TargetLowering *Lowering) { | 221 const TargetLowering *Lowering) { |
222 const TargetInfo TInfo(Lowering); | 222 const TargetInfo TInfo(Lowering); |
223 ldr(OpRt, OpAddress, Cond, TInfo); | 223 ldr(OpRt, OpAddress, Cond, TInfo); |
224 } | 224 } |
225 | 225 |
| 226 void ldrex(const Operand *OpRt, const Operand *OpAddress, |
| 227 CondARM32::Cond Cond, const TargetInfo &TInfo); |
| 228 |
| 229 void ldrex(const Operand *OpRt, const Operand *OpAddress, |
| 230 CondARM32::Cond Cond, const TargetLowering *Lowering) { |
| 231 const TargetInfo TInfo(Lowering); |
| 232 ldrex(OpRt, OpAddress, Cond, TInfo); |
| 233 } |
| 234 |
226 void lsl(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 235 void lsl(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
227 bool SetFlags, CondARM32::Cond Cond); | 236 bool SetFlags, CondARM32::Cond Cond); |
228 | 237 |
229 void lsr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 238 void lsr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
230 bool SetFlags, CondARM32::Cond Cond); | 239 bool SetFlags, CondARM32::Cond Cond); |
231 | 240 |
232 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 241 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
233 | 242 |
234 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 243 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
235 | 244 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 278 |
270 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, | 279 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, |
271 const TargetInfo &TInfo); | 280 const TargetInfo &TInfo); |
272 | 281 |
273 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, | 282 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, |
274 const TargetLowering *Lowering) { | 283 const TargetLowering *Lowering) { |
275 const TargetInfo TInfo(Lowering); | 284 const TargetInfo TInfo(Lowering); |
276 str(OpRt, OpAddress, Cond, TInfo); | 285 str(OpRt, OpAddress, Cond, TInfo); |
277 } | 286 } |
278 | 287 |
| 288 void strex(const Operand *OpRd, const Operand *OpRt, const Operand *OpAddress, |
| 289 CondARM32::Cond Cond, const TargetInfo &TInfo); |
| 290 |
| 291 void strex(const Operand *OpRd, const Operand *OpRt, const Operand *OpAddress, |
| 292 CondARM32::Cond Cond, const TargetLowering *Lowering) { |
| 293 const TargetInfo TInfo(Lowering); |
| 294 strex(OpRd, OpRt, OpAddress, Cond, TInfo); |
| 295 } |
| 296 |
279 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 297 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
280 bool SetFlags, CondARM32::Cond Cond); | 298 bool SetFlags, CondARM32::Cond Cond); |
281 | 299 |
282 // Implements sxtb/sxth depending on type of OpSrc0. | 300 // Implements sxtb/sxth depending on type of OpSrc0. |
283 void sxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); | 301 void sxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); |
284 | 302 |
285 void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond); | 303 void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond); |
286 | 304 |
287 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 305 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
288 CondARM32::Cond Cond); | 306 CondARM32::Cond Cond); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // Emit ldr/ldrb/str/strb instruction with given address. | 382 // Emit ldr/ldrb/str/strb instruction with given address. |
365 void emitMemOp(CondARM32::Cond Cond, bool IsLoad, bool IsByte, IValueT Rt, | 383 void emitMemOp(CondARM32::Cond Cond, bool IsLoad, bool IsByte, IValueT Rt, |
366 const Operand *OpAddress, const TargetInfo &TInfo, | 384 const Operand *OpAddress, const TargetInfo &TInfo, |
367 const char *InstName); | 385 const char *InstName); |
368 | 386 |
369 // Emit ldrh/ldrd/strh/strd instruction with given address using encoding 3. | 387 // Emit ldrh/ldrd/strh/strd instruction with given address using encoding 3. |
370 void emitMemOpEnc3(CondARM32::Cond Cond, IValueT Opcode, IValueT Rt, | 388 void emitMemOpEnc3(CondARM32::Cond Cond, IValueT Opcode, IValueT Rt, |
371 const Operand *OpAddress, const TargetInfo &TInfo, | 389 const Operand *OpAddress, const TargetInfo &TInfo, |
372 const char *InstName); | 390 const char *InstName); |
373 | 391 |
| 392 // Emit cccc00011xxlnnnndddd11111001tttt where cccc=Cond, xx encodes type |
| 393 // size, l=IsLoad, nnnn=Rn (as defined by OpAddress), and tttt=Rt. |
| 394 void emitMemExOp(CondARM32::Cond, Type Ty, bool IsLoad, const Operand *OpRd, |
| 395 IValueT Rt, const Operand *OpAddress, |
| 396 const TargetInfo &TInfo, const char *InstName); |
| 397 |
374 // Pattern cccc100aaaalnnnnrrrrrrrrrrrrrrrr where cccc=Cond, | 398 // Pattern cccc100aaaalnnnnrrrrrrrrrrrrrrrr where cccc=Cond, |
375 // aaaa<<21=AddressMode, l=IsLoad, nnnn=BaseReg, and | 399 // aaaa<<21=AddressMode, l=IsLoad, nnnn=BaseReg, and |
376 // rrrrrrrrrrrrrrrr is bitset of Registers. | 400 // rrrrrrrrrrrrrrrr is bitset of Registers. |
377 void emitMultiMemOp(CondARM32::Cond Cond, BlockAddressMode AddressMode, | 401 void emitMultiMemOp(CondARM32::Cond Cond, BlockAddressMode AddressMode, |
378 bool IsLoad, IValueT BaseReg, IValueT Registers, | 402 bool IsLoad, IValueT BaseReg, IValueT Registers, |
379 const char *InstName); | 403 const char *InstName); |
380 | 404 |
381 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, | 405 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, |
382 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. | 406 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. |
383 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 407 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and | 444 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and |
421 // iiiiiiiiiiiiiiii=Imm16. | 445 // iiiiiiiiiiiiiiii=Imm16. |
422 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd, | 446 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd, |
423 const Operand *OpSrc, const char *MovName); | 447 const Operand *OpSrc, const char *MovName); |
424 }; | 448 }; |
425 | 449 |
426 } // end of namespace ARM32 | 450 } // end of namespace ARM32 |
427 } // end of namespace Ice | 451 } // end of namespace Ice |
428 | 452 |
429 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 453 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
OLD | NEW |