| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 163 void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
| 164 | 164 |
| 165 void movt(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); | 165 void movt(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
| 166 | 166 |
| 167 void orr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 167 void orr(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 168 bool SetFlags, CondARM32::Cond Cond); | 168 bool SetFlags, CondARM32::Cond Cond); |
| 169 | 169 |
| 170 void sbc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 170 void sbc(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 171 bool SetFlags, CondARM32::Cond Cond); | 171 bool SetFlags, CondARM32::Cond Cond); |
| 172 | 172 |
| 173 void sdiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 174 CondARM32::Cond Cond); |
| 175 |
| 173 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond); | 176 void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond); |
| 174 | 177 |
| 175 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, | 178 void sub(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| 176 bool SetFlags, CondARM32::Cond Cond); | 179 bool SetFlags, CondARM32::Cond Cond); |
| 177 | 180 |
| 178 static bool classof(const Assembler *Asm) { | 181 static bool classof(const Assembler *Asm) { |
| 179 return Asm->getKind() == Asm_ARM32; | 182 return Asm->getKind() == Asm_ARM32; |
| 180 } | 183 } |
| 181 | 184 |
| 182 void emitTextInst(const std::string &Text, SizeT InstSize = sizeof(IValueT)); | 185 void emitTextInst(const std::string &Text, SizeT InstSize = sizeof(IValueT)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 206 | 209 |
| 207 void emitType05(CondARM32::Cond COnd, int32_t Offset, bool Link); | 210 void emitType05(CondARM32::Cond COnd, int32_t Offset, bool Link); |
| 208 | 211 |
| 209 // Pattern ccccoooaabalnnnnttttaaaaaaaaaaaa where cccc=Cond, ooo=InstType, | 212 // Pattern ccccoooaabalnnnnttttaaaaaaaaaaaa where cccc=Cond, ooo=InstType, |
| 210 // l=isLoad, b=isByte, and aaa0a0aaaa0000aaaaaaaaaaaa=Address. Note that | 213 // l=isLoad, b=isByte, and aaa0a0aaaa0000aaaaaaaaaaaa=Address. Note that |
| 211 // Address is assumed to be defined by decodeAddress() in | 214 // Address is assumed to be defined by decodeAddress() in |
| 212 // IceAssemblerARM32.cpp. | 215 // IceAssemblerARM32.cpp. |
| 213 void emitMemOp(CondARM32::Cond Cond, IValueT InstType, bool IsLoad, | 216 void emitMemOp(CondARM32::Cond Cond, IValueT InstType, bool IsLoad, |
| 214 bool IsByte, uint32_t Rt, uint32_t Address); | 217 bool IsByte, uint32_t Rt, uint32_t Address); |
| 215 | 218 |
| 219 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, |
| 220 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. |
| 221 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
| 222 IValueT Rm); |
| 223 |
| 216 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 224 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 217 // mmmm=Rm, ssss=Rs, f=SetCc, and xxxxxxx=Opcode. | 225 // mmmm=Rm, ssss=Rs, f=SetCc, and xxxxxxx=Opcode. |
| 218 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 226 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
| 219 IValueT Rm, IValueT Rs, bool SetCc); | 227 IValueT Rm, IValueT Rs, bool SetCc); |
| 220 | 228 |
| 221 void emitBranch(Label *L, CondARM32::Cond, bool Link); | 229 void emitBranch(Label *L, CondARM32::Cond, bool Link); |
| 222 | 230 |
| 223 // Encodes the given Offset into the branch instruction Inst. | 231 // Encodes the given Offset into the branch instruction Inst. |
| 224 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst); | 232 IValueT encodeBranchOffset(IOffsetT Offset, IValueT Inst); |
| 225 | 233 |
| 226 // Returns the offset encoded in the branch instruction Inst. | 234 // Returns the offset encoded in the branch instruction Inst. |
| 227 static IOffsetT decodeBranchOffset(IValueT Inst); | 235 static IOffsetT decodeBranchOffset(IValueT Inst); |
| 228 }; | 236 }; |
| 229 | 237 |
| 230 } // end of namespace ARM32 | 238 } // end of namespace ARM32 |
| 231 } // end of namespace Ice | 239 } // end of namespace Ice |
| 232 | 240 |
| 233 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 241 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
| OLD | NEW |