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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 void and_(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 144 void and_(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
145 bool SetFlags, CondARM32::Cond Cond); | 145 bool SetFlags, CondARM32::Cond Cond); |
146 | 146 |
147 void b(Label *L, CondARM32::Cond Cond); | 147 void b(Label *L, CondARM32::Cond Cond); |
148 | 148 |
149 void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL); | 149 void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL); |
150 | 150 |
151 void bkpt(uint16_t Imm16); | 151 void bkpt(uint16_t Imm16); |
152 | 152 |
| 153 void eor(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 154 bool SetFlags, CondARM32::Cond Cond); |
| 155 |
153 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond); | 156 void ldr(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond); |
154 | 157 |
155 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 158 void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
156 | 159 |
157 void mul(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 160 void mul(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
158 bool SetFlags, CondARM32::Cond Cond); | 161 bool SetFlags, CondARM32::Cond Cond); |
159 | 162 |
160 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 163 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
161 | 164 |
162 void movt(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 165 void movt(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
(...skipping 26 matching lines...) Expand all Loading... |
189 | 192 |
190 void bindCfgNodeLabel(const CfgNode *Node) override; | 193 void bindCfgNodeLabel(const CfgNode *Node) override; |
191 | 194 |
192 void emitInst(IValueT Value) { Buffer.emit<IValueT>(Value); } | 195 void emitInst(IValueT Value) { Buffer.emit<IValueT>(Value); } |
193 | 196 |
194 // Pattern cccctttoooosnnnnddddiiiiiiiiiiii where cccc=Cond, ttt=Type, | 197 // Pattern cccctttoooosnnnnddddiiiiiiiiiiii where cccc=Cond, ttt=Type, |
195 // oooo=Opcode, nnnn=Rn, dddd=Rd, iiiiiiiiiiii=imm12 (See ARM section A5.2.3). | 198 // oooo=Opcode, nnnn=Rn, dddd=Rd, iiiiiiiiiiii=imm12 (See ARM section A5.2.3). |
196 void emitType01(CondARM32::Cond Cond, IValueT Type, IValueT Opcode, | 199 void emitType01(CondARM32::Cond Cond, IValueT Type, IValueT Opcode, |
197 bool SetCc, IValueT Rn, IValueT Rd, IValueT imm12); | 200 bool SetCc, IValueT Rn, IValueT Rd, IValueT imm12); |
198 | 201 |
| 202 // Converts arguments to appropriate representation on a data operation, |
| 203 // and then calls emitType01 above. |
| 204 void emitType01(IValueT Opcode, const Operand *OpRd, const Operand *OpRn, |
| 205 const Operand *OpSrc1, bool SetFlags, CondARM32::Cond Cond); |
| 206 |
199 void emitType05(CondARM32::Cond COnd, int32_t Offset, bool Link); | 207 void emitType05(CondARM32::Cond COnd, int32_t Offset, bool Link); |
200 | 208 |
201 // Pattern ccccoooaabalnnnnttttaaaaaaaaaaaa where cccc=Cond, ooo=InstType, | 209 // Pattern ccccoooaabalnnnnttttaaaaaaaaaaaa where cccc=Cond, ooo=InstType, |
202 // l=isLoad, b=isByte, and aaa0a0aaaa0000aaaaaaaaaaaa=Address. Note that | 210 // l=isLoad, b=isByte, and aaa0a0aaaa0000aaaaaaaaaaaa=Address. Note that |
203 // Address is assumed to be defined by decodeAddress() in | 211 // Address is assumed to be defined by decodeAddress() in |
204 // IceAssemblerARM32.cpp. | 212 // IceAssemblerARM32.cpp. |
205 void emitMemOp(CondARM32::Cond Cond, IValueT InstType, bool IsLoad, | 213 void emitMemOp(CondARM32::Cond Cond, IValueT InstType, bool IsLoad, |
206 bool IsByte, uint32_t Rt, uint32_t Address); | 214 bool IsByte, uint32_t Rt, uint32_t Address); |
207 | 215 |
208 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 216 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
209 // mmmm=Rm, ssss=Rs, f=SetCc, and xxxxxxx=Opcode. | 217 // mmmm=Rm, ssss=Rs, f=SetCc, and xxxxxxx=Opcode. |
210 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 218 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
211 IValueT Rm, IValueT Rs, bool SetCc); | 219 IValueT Rm, IValueT Rs, bool SetCc); |
212 | 220 |
213 void emitBranch(Label *L, CondARM32::Cond, bool Link); | 221 void emitBranch(Label *L, CondARM32::Cond, bool Link); |
214 | 222 |
215 // Encodes the given Offset into the branch instruction Inst. | 223 // Encodes the given Offset into the branch instruction Inst. |
216 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst); | 224 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst); |
217 | 225 |
218 // Returns the offset encoded in the branch instruction Inst. | 226 // Returns the offset encoded in the branch instruction Inst. |
219 static IOffsetT decodeBranchOffset(IValueT Inst); | 227 static IOffsetT decodeBranchOffset(IValueT Inst); |
220 }; | 228 }; |
221 | 229 |
222 } // end of namespace ARM32 | 230 } // end of namespace ARM32 |
223 } // end of namespace Ice | 231 } // end of namespace Ice |
224 | 232 |
225 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 233 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
OLD | NEW |