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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 void add(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 101 void add(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
102 bool SetFlags, CondARM32::Cond Cond); | 102 bool SetFlags, CondARM32::Cond Cond); |
103 | 103 |
104 void bkpt(uint16_t Imm16); | 104 void bkpt(uint16_t Imm16); |
105 | 105 |
106 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 106 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
107 | 107 |
108 void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL); | 108 void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL); |
109 | 109 |
| 110 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 111 bool SetFlags, CondARM32::Cond Cond); |
| 112 |
110 static bool classof(const Assembler *Asm) { | 113 static bool classof(const Assembler *Asm) { |
111 return Asm->getKind() == Asm_ARM32; | 114 return Asm->getKind() == Asm_ARM32; |
112 } | 115 } |
113 | 116 |
114 private: | 117 private: |
115 // A vector of pool-allocated x86 labels for CFG nodes. | 118 // A vector of pool-allocated x86 labels for CFG nodes. |
116 using LabelVector = std::vector<Label *>; | 119 using LabelVector = std::vector<Label *>; |
117 LabelVector CfgNodeLabels; | 120 LabelVector CfgNodeLabels; |
118 | 121 |
119 Label *getOrCreateLabel(SizeT Number, LabelVector &Labels); | 122 Label *getOrCreateLabel(SizeT Number, LabelVector &Labels); |
120 Label *getOrCreateCfgNodeLabel(SizeT NodeNumber) { | 123 Label *getOrCreateCfgNodeLabel(SizeT NodeNumber) { |
121 return getOrCreateLabel(NodeNumber, CfgNodeLabels); | 124 return getOrCreateLabel(NodeNumber, CfgNodeLabels); |
122 } | 125 } |
123 | 126 |
124 void emitInst(uint32_t Value) { Buffer.emit<uint32_t>(Value); } | 127 void emitInst(uint32_t Value) { Buffer.emit<uint32_t>(Value); } |
125 | 128 |
126 // Pattern cccctttoooosnnnnddddiiiiiiiiiiii where cccc=Cond, ttt=Type, | 129 // Pattern cccctttoooosnnnnddddiiiiiiiiiiii where cccc=Cond, ttt=Type, |
127 // oooo=Opcode, nnnn=Rn, dddd=Rd, iiiiiiiiiiii=imm12 (See ARM section A5.2.3). | 130 // oooo=Opcode, nnnn=Rn, dddd=Rd, iiiiiiiiiiii=imm12 (See ARM section A5.2.3). |
128 void emitType01(CondARM32::Cond Cond, uint32_t Type, uint32_t Opcode, | 131 void emitType01(CondARM32::Cond Cond, uint32_t Type, uint32_t Opcode, |
129 bool SetCc, uint32_t Rn, uint32_t Rd, uint32_t imm12); | 132 bool SetCc, uint32_t Rn, uint32_t Rd, uint32_t imm12); |
130 }; | 133 }; |
131 | 134 |
132 } // end of namespace ARM32 | 135 } // end of namespace ARM32 |
133 } // end of namespace Ice | 136 } // end of namespace Ice |
134 | 137 |
135 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 138 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
OLD | NEW |