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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, | 267 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond, |
268 const TargetLowering *Lowering) { | 268 const TargetLowering *Lowering) { |
269 const TargetInfo TInfo(Lowering); | 269 const TargetInfo TInfo(Lowering); |
270 str(OpRt, OpAddress, Cond, TInfo); | 270 str(OpRt, OpAddress, Cond, TInfo); |
271 } | 271 } |
272 | 272 |
273 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 273 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
274 bool SetFlags, CondARM32::Cond Cond); | 274 bool SetFlags, CondARM32::Cond Cond); |
275 | 275 |
| 276 // Implements sxtb/sxth depending on type of OpSrc0. |
| 277 void sxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); |
| 278 |
276 void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond); | 279 void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond); |
277 | 280 |
278 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 281 void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
279 CondARM32::Cond Cond); | 282 CondARM32::Cond Cond); |
280 | 283 |
281 void umull(const Operand *OpRdLo, const Operand *OpRdHi, const Operand *OpRn, | 284 void umull(const Operand *OpRdLo, const Operand *OpRdHi, const Operand *OpRn, |
282 const Operand *OpRm, CondARM32::Cond Cond); | 285 const Operand *OpRm, CondARM32::Cond Cond); |
283 | 286 |
284 // Implements uxtb/uxth depending on type of OpSrc0. | 287 // Implements uxtb/uxth depending on type of OpSrc0. |
285 void uxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); | 288 void uxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 IValueT Rm, IValueT Rs, bool SetFlags, const char *InstName); | 383 IValueT Rm, IValueT Rs, bool SetFlags, const char *InstName); |
381 | 384 |
382 // Pattern cccc0001101s0000ddddxxxxxtt0mmmm where cccc=Cond, s=SetFlags, | 385 // Pattern cccc0001101s0000ddddxxxxxtt0mmmm where cccc=Cond, s=SetFlags, |
383 // dddd=Rd, mmmm=Rm, tt=Shift, and xxxxx is defined by OpSrc1. OpSrc1 defines | 386 // dddd=Rd, mmmm=Rm, tt=Shift, and xxxxx is defined by OpSrc1. OpSrc1 defines |
384 // either xxxxx=Imm5, or xxxxx=ssss0 where ssss=Rs. | 387 // either xxxxx=Imm5, or xxxxx=ssss0 where ssss=Rs. |
385 void emitShift(const CondARM32::Cond Cond, | 388 void emitShift(const CondARM32::Cond Cond, |
386 const OperandARM32::ShiftKind Shift, const Operand *OpRd, | 389 const OperandARM32::ShiftKind Shift, const Operand *OpRd, |
387 const Operand *OpRm, const Operand *OpSrc1, | 390 const Operand *OpRm, const Operand *OpSrc1, |
388 const bool SetFlags, const char *InstName); | 391 const bool SetFlags, const char *InstName); |
389 | 392 |
390 // Implements various forms of Unsigned extend value, using pattern | 393 // Implements various forms of signed/unsigned extend value, using pattern |
391 // ccccxxxxxxxxnnnnddddrr000111mmmm where cccc=Cond, xxxxxxxx<<20=Opcode, | 394 // ccccxxxxxxxxnnnnddddrr000111mmmm where cccc=Cond, xxxxxxxx<<20=Opcode, |
392 // nnnn=Rn, dddd=Rd, rr=Rotation, and mmmm=Rm. | 395 // nnnn=Rn, dddd=Rd, rr=Rotation, and mmmm=Rm. |
393 void emitUxt(CondARM32::Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 396 void emitSignExtend(CondARM32::Cond, IValueT Opcode, const Operand *OpRd, |
394 IValueT Rm, RotationValue Rotation, const char *InstName); | 397 const Operand *OpSrc0, const char *InstName); |
395 | 398 |
396 // Pattern cccctttxxxxnnnn0000iiiiiiiiiiii where cccc=Cond, nnnn=Rn, | 399 // Pattern cccctttxxxxnnnn0000iiiiiiiiiiii where cccc=Cond, nnnn=Rn, |
397 // ttt=Instruction type (derived from OpSrc1), iiiiiiiiiiii is derived from | 400 // ttt=Instruction type (derived from OpSrc1), iiiiiiiiiiii is derived from |
398 // OpSrc1, and xxxx=Opcode. | 401 // OpSrc1, and xxxx=Opcode. |
399 void emitCompareOp(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpRn, | 402 void emitCompareOp(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpRn, |
400 const Operand *OpSrc1, const char *CmpName); | 403 const Operand *OpSrc1, const char *CmpName); |
401 | 404 |
402 void emitBranch(Label *L, CondARM32::Cond, bool Link); | 405 void emitBranch(Label *L, CondARM32::Cond, bool Link); |
403 | 406 |
404 // Encodes the given Offset into the branch instruction Inst. | 407 // Encodes the given Offset into the branch instruction Inst. |
405 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst); | 408 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst); |
406 | 409 |
407 // Returns the offset encoded in the branch instruction Inst. | 410 // Returns the offset encoded in the branch instruction Inst. |
408 static IOffsetT decodeBranchOffset(IValueT Inst); | 411 static IOffsetT decodeBranchOffset(IValueT Inst); |
409 | 412 |
410 // Implements movw/movt, generating pattern ccccxxxxxxxsiiiiddddiiiiiiiiiiii | 413 // Implements movw/movt, generating pattern ccccxxxxxxxsiiiiddddiiiiiiiiiiii |
411 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and | 414 // where cccc=Cond, xxxxxxx<<21=Opcode, dddd=Rd, s=SetFlags, and |
412 // iiiiiiiiiiiiiiii=Imm16. | 415 // iiiiiiiiiiiiiiii=Imm16. |
413 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd, | 416 void emitMovwt(CondARM32::Cond Cond, bool IsMovw, const Operand *OpRd, |
414 const Operand *OpSrc, const char *MovName); | 417 const Operand *OpSrc, const char *MovName); |
415 }; | 418 }; |
416 | 419 |
417 } // end of namespace ARM32 | 420 } // end of namespace ARM32 |
418 } // end of namespace Ice | 421 } // end of namespace Ice |
419 | 422 |
420 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 423 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
OLD | NEW |