| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file declares the TargetLoweringARM32 class, which implements the | 10 // This file declares the TargetLoweringARM32 class, which implements the |
| 11 // TargetLowering interface for the ARM 32-bit architecture. | 11 // TargetLowering interface for the ARM 32-bit architecture. |
| 12 // | 12 // |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #ifndef SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 15 #ifndef SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
| 16 #define SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 16 #define SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
| 17 | 17 |
| 18 #include "IceDefs.h" | 18 #include "IceDefs.h" |
| 19 #include "IceInstARM32.h" | 19 #include "IceInstARM32.h" |
| 20 #include "IceRegistersARM32.h" | 20 #include "IceRegistersARM32.h" |
| 21 #include "IceTargetLowering.h" | 21 #include "IceTargetLowering.h" |
| 22 | 22 |
| 23 namespace Ice { | 23 namespace Ice { |
| 24 | 24 |
| 25 // Class encapsulating ARM cpu features / instruction set. |
| 26 class TargetARM32Features { |
| 27 TargetARM32Features() = delete; |
| 28 TargetARM32Features(const TargetARM32Features &) = delete; |
| 29 TargetARM32Features &operator=(const TargetARM32Features &) = delete; |
| 30 |
| 31 public: |
| 32 explicit TargetARM32Features(const ClFlags &Flags); |
| 33 |
| 34 enum ARM32InstructionSet { |
| 35 Begin, |
| 36 // Neon is the PNaCl baseline instruction set. |
| 37 Neon = Begin, |
| 38 HWDivArm, // HW divide in ARM mode (not just Thumb mode). |
| 39 End |
| 40 }; |
| 41 |
| 42 bool hasFeature(ARM32InstructionSet I) const { return I <= InstructionSet; } |
| 43 |
| 44 private: |
| 45 ARM32InstructionSet InstructionSet = ARM32InstructionSet::Begin; |
| 46 }; |
| 47 |
| 48 // The target lowering logic for ARM32. |
| 25 class TargetARM32 : public TargetLowering { | 49 class TargetARM32 : public TargetLowering { |
| 26 TargetARM32() = delete; | 50 TargetARM32() = delete; |
| 27 TargetARM32(const TargetARM32 &) = delete; | 51 TargetARM32(const TargetARM32 &) = delete; |
| 28 TargetARM32 &operator=(const TargetARM32 &) = delete; | 52 TargetARM32 &operator=(const TargetARM32 &) = delete; |
| 29 | 53 |
| 30 public: | 54 public: |
| 31 // TODO(jvoung): return a unique_ptr. | 55 // TODO(jvoung): return a unique_ptr. |
| 32 static TargetARM32 *create(Cfg *Func) { return new TargetARM32(Func); } | 56 static TargetARM32 *create(Cfg *Func) { return new TargetARM32(Func); } |
| 33 | 57 |
| 34 void translateOm1() override; | 58 void translateOm1() override; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 92 |
| 69 // Ensure that a 64-bit Variable has been split into 2 32-bit | 93 // Ensure that a 64-bit Variable has been split into 2 32-bit |
| 70 // Variables, creating them if necessary. This is needed for all | 94 // Variables, creating them if necessary. This is needed for all |
| 71 // I64 operations. | 95 // I64 operations. |
| 72 void split64(Variable *Var); | 96 void split64(Variable *Var); |
| 73 Operand *loOperand(Operand *Operand); | 97 Operand *loOperand(Operand *Operand); |
| 74 Operand *hiOperand(Operand *Operand); | 98 Operand *hiOperand(Operand *Operand); |
| 75 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, | 99 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, |
| 76 size_t BasicFrameOffset, size_t &InArgsSizeBytes); | 100 size_t BasicFrameOffset, size_t &InArgsSizeBytes); |
| 77 | 101 |
| 78 enum ARM32InstructionSet { | 102 bool hasCPUFeature(TargetARM32Features::ARM32InstructionSet I) const { |
| 79 Begin, | 103 return CPUFeatures.hasFeature(I); |
| 80 // Neon is the PNaCl baseline instruction set. | 104 } |
| 81 Neon = Begin, | |
| 82 HWDivArm, // HW divide in ARM mode (not just Thumb mode). | |
| 83 End | |
| 84 }; | |
| 85 | |
| 86 ARM32InstructionSet getInstructionSet() const { return InstructionSet; } | |
| 87 | 105 |
| 88 protected: | 106 protected: |
| 89 explicit TargetARM32(Cfg *Func); | 107 explicit TargetARM32(Cfg *Func); |
| 90 | 108 |
| 91 void postLower() override; | 109 void postLower() override; |
| 92 | 110 |
| 93 void lowerAlloca(const InstAlloca *Inst) override; | 111 void lowerAlloca(const InstAlloca *Inst) override; |
| 94 void lowerArithmetic(const InstArithmetic *Inst) override; | 112 void lowerArithmetic(const InstArithmetic *Inst) override; |
| 95 void lowerAssign(const InstAssign *Inst) override; | 113 void lowerAssign(const InstAssign *Inst) override; |
| 96 void lowerBr(const InstBr *Inst) override; | 114 void lowerBr(const InstBr *Inst) override; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); | 152 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
| 135 void alignRegisterPow2(Variable *Reg, uint32_t Align); | 153 void alignRegisterPow2(Variable *Reg, uint32_t Align); |
| 136 | 154 |
| 137 // Returns a vector in a register with the given constant entries. | 155 // Returns a vector in a register with the given constant entries. |
| 138 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); | 156 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 139 | 157 |
| 140 void makeRandomRegisterPermutation( | 158 void makeRandomRegisterPermutation( |
| 141 llvm::SmallVectorImpl<int32_t> &Permutation, | 159 llvm::SmallVectorImpl<int32_t> &Permutation, |
| 142 const llvm::SmallBitVector &ExcludeRegisters) const override; | 160 const llvm::SmallBitVector &ExcludeRegisters) const override; |
| 143 | 161 |
| 162 // If a divide-by-zero check is needed, inserts a: |
| 163 // test; branch .LSKIP; trap; .LSKIP: <continuation>. |
| 164 // If no check is needed nothing is inserted. |
| 165 void div0Check(Type Ty, Operand *SrcLo, Operand *SrcHi); |
| 166 typedef void (TargetARM32::*ExtInstr)(Variable *, Variable *, |
| 167 CondARM32::Cond); |
| 168 typedef void (TargetARM32::*DivInstr)(Variable *, Variable *, Variable *, |
| 169 CondARM32::Cond); |
| 170 void lowerIDivRem(Variable *Dest, Variable *T, Variable *Src0R, Operand *Src1, |
| 171 ExtInstr ExtFunc, DivInstr DivFunc, |
| 172 const char *DivHelperName, bool IsRemainder); |
| 173 |
| 144 // The following are helpers that insert lowered ARM32 instructions | 174 // The following are helpers that insert lowered ARM32 instructions |
| 145 // with minimal syntactic overhead, so that the lowering code can | 175 // with minimal syntactic overhead, so that the lowering code can |
| 146 // look as close to assembly as practical. | 176 // look as close to assembly as practical. |
| 147 | 177 |
| 148 void _add(Variable *Dest, Variable *Src0, Operand *Src1, | 178 void _add(Variable *Dest, Variable *Src0, Operand *Src1, |
| 149 CondARM32::Cond Pred = CondARM32::AL) { | 179 CondARM32::Cond Pred = CondARM32::AL) { |
| 150 Context.insert(InstARM32Add::create(Func, Dest, Src0, Src1, Pred)); | 180 Context.insert(InstARM32Add::create(Func, Dest, Src0, Src1, Pred)); |
| 151 } | 181 } |
| 152 void _adds(Variable *Dest, Variable *Src0, Operand *Src1, | 182 void _adds(Variable *Dest, Variable *Src0, Operand *Src1, |
| 153 CondARM32::Cond Pred = CondARM32::AL) { | 183 CondARM32::Cond Pred = CondARM32::AL) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 168 Context.insert(InstARM32And::create(Func, Dest, Src0, Src1, Pred)); | 198 Context.insert(InstARM32And::create(Func, Dest, Src0, Src1, Pred)); |
| 169 } | 199 } |
| 170 void _asr(Variable *Dest, Variable *Src0, Operand *Src1, | 200 void _asr(Variable *Dest, Variable *Src0, Operand *Src1, |
| 171 CondARM32::Cond Pred = CondARM32::AL) { | 201 CondARM32::Cond Pred = CondARM32::AL) { |
| 172 Context.insert(InstARM32Asr::create(Func, Dest, Src0, Src1, Pred)); | 202 Context.insert(InstARM32Asr::create(Func, Dest, Src0, Src1, Pred)); |
| 173 } | 203 } |
| 174 void _bic(Variable *Dest, Variable *Src0, Operand *Src1, | 204 void _bic(Variable *Dest, Variable *Src0, Operand *Src1, |
| 175 CondARM32::Cond Pred = CondARM32::AL) { | 205 CondARM32::Cond Pred = CondARM32::AL) { |
| 176 Context.insert(InstARM32Bic::create(Func, Dest, Src0, Src1, Pred)); | 206 Context.insert(InstARM32Bic::create(Func, Dest, Src0, Src1, Pred)); |
| 177 } | 207 } |
| 178 void _br(CondARM32::Cond Condition, CfgNode *TargetTrue, | 208 void _br(CfgNode *TargetTrue, CfgNode *TargetFalse, |
| 179 CfgNode *TargetFalse) { | 209 CondARM32::Cond Condition) { |
| 180 Context.insert( | 210 Context.insert( |
| 181 InstARM32Br::create(Func, TargetTrue, TargetFalse, Condition)); | 211 InstARM32Br::create(Func, TargetTrue, TargetFalse, Condition)); |
| 182 } | 212 } |
| 183 void _br(CfgNode *Target) { | 213 void _br(CfgNode *Target) { |
| 184 Context.insert(InstARM32Br::create(Func, Target)); | 214 Context.insert(InstARM32Br::create(Func, Target)); |
| 185 } | 215 } |
| 186 void _br(CfgNode *Target, CondARM32::Cond Condition) { | 216 void _br(CfgNode *Target, CondARM32::Cond Condition) { |
| 187 Context.insert(InstARM32Br::create(Func, Target, Condition)); | 217 Context.insert(InstARM32Br::create(Func, Target, Condition)); |
| 188 } | 218 } |
| 219 void _br(InstARM32Label *Label, CondARM32::Cond Condition) { |
| 220 Context.insert(InstARM32Br::create(Func, Label, Condition)); |
| 221 } |
| 189 void _cmp(Variable *Src0, Operand *Src1, | 222 void _cmp(Variable *Src0, Operand *Src1, |
| 190 CondARM32::Cond Pred = CondARM32::AL) { | 223 CondARM32::Cond Pred = CondARM32::AL) { |
| 191 Context.insert(InstARM32Cmp::create(Func, Src0, Src1, Pred)); | 224 Context.insert(InstARM32Cmp::create(Func, Src0, Src1, Pred)); |
| 192 } | 225 } |
| 193 void _eor(Variable *Dest, Variable *Src0, Operand *Src1, | 226 void _eor(Variable *Dest, Variable *Src0, Operand *Src1, |
| 194 CondARM32::Cond Pred = CondARM32::AL) { | 227 CondARM32::Cond Pred = CondARM32::AL) { |
| 195 Context.insert(InstARM32Eor::create(Func, Dest, Src0, Src1, Pred)); | 228 Context.insert(InstARM32Eor::create(Func, Dest, Src0, Src1, Pred)); |
| 196 } | 229 } |
| 197 void _ldr(Variable *Dest, OperandARM32Mem *Addr, | 230 void _ldr(Variable *Dest, OperandARM32Mem *Addr, |
| 198 CondARM32::Cond Pred = CondARM32::AL) { | 231 CondARM32::Cond Pred = CondARM32::AL) { |
| 199 Context.insert(InstARM32Ldr::create(Func, Dest, Addr, Pred)); | 232 Context.insert(InstARM32Ldr::create(Func, Dest, Addr, Pred)); |
| 200 } | 233 } |
| 201 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, | 234 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, |
| 202 CondARM32::Cond Pred = CondARM32::AL) { | 235 CondARM32::Cond Pred = CondARM32::AL) { |
| 203 Context.insert(InstARM32Lsl::create(Func, Dest, Src0, Src1, Pred)); | 236 Context.insert(InstARM32Lsl::create(Func, Dest, Src0, Src1, Pred)); |
| 204 } | 237 } |
| 205 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1, | 238 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1, |
| 206 CondARM32::Cond Pred = CondARM32::AL) { | 239 CondARM32::Cond Pred = CondARM32::AL) { |
| 207 Context.insert(InstARM32Lsr::create(Func, Dest, Src0, Src1, Pred)); | 240 Context.insert(InstARM32Lsr::create(Func, Dest, Src0, Src1, Pred)); |
| 208 } | 241 } |
| 209 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, | 242 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, |
| 210 CondARM32::Cond Pred = CondARM32::AL) { | 243 CondARM32::Cond Pred = CondARM32::AL) { |
| 211 Context.insert(InstARM32Mla::create(Func, Dest, Src0, Src1, Acc, Pred)); | 244 Context.insert(InstARM32Mla::create(Func, Dest, Src0, Src1, Acc, Pred)); |
| 212 } | 245 } |
| 246 void _mls(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, |
| 247 CondARM32::Cond Pred = CondARM32::AL) { |
| 248 Context.insert(InstARM32Mls::create(Func, Dest, Src0, Src1, Acc, Pred)); |
| 249 } |
| 213 // If Dest=nullptr is passed in, then a new variable is created, | 250 // If Dest=nullptr is passed in, then a new variable is created, |
| 214 // marked as infinite register allocation weight, and returned | 251 // marked as infinite register allocation weight, and returned |
| 215 // through the in/out Dest argument. | 252 // through the in/out Dest argument. |
| 216 void _mov(Variable *&Dest, Operand *Src0, | 253 void _mov(Variable *&Dest, Operand *Src0, |
| 217 CondARM32::Cond Pred = CondARM32::AL, | 254 CondARM32::Cond Pred = CondARM32::AL, |
| 218 int32_t RegNum = Variable::NoRegister) { | 255 int32_t RegNum = Variable::NoRegister) { |
| 219 if (Dest == nullptr) | 256 if (Dest == nullptr) |
| 220 Dest = makeReg(Src0->getType(), RegNum); | 257 Dest = makeReg(Src0->getType(), RegNum); |
| 221 Context.insert(InstARM32Mov::create(Func, Dest, Src0, Pred)); | 258 Context.insert(InstARM32Mov::create(Func, Dest, Src0, Pred)); |
| 222 } | 259 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 241 Context.insert(InstARM32Mul::create(Func, Dest, Src0, Src1, Pred)); | 278 Context.insert(InstARM32Mul::create(Func, Dest, Src0, Src1, Pred)); |
| 242 } | 279 } |
| 243 void _mvn(Variable *Dest, Operand *Src0, | 280 void _mvn(Variable *Dest, Operand *Src0, |
| 244 CondARM32::Cond Pred = CondARM32::AL) { | 281 CondARM32::Cond Pred = CondARM32::AL) { |
| 245 Context.insert(InstARM32Mvn::create(Func, Dest, Src0, Pred)); | 282 Context.insert(InstARM32Mvn::create(Func, Dest, Src0, Pred)); |
| 246 } | 283 } |
| 247 void _orr(Variable *Dest, Variable *Src0, Operand *Src1, | 284 void _orr(Variable *Dest, Variable *Src0, Operand *Src1, |
| 248 CondARM32::Cond Pred = CondARM32::AL) { | 285 CondARM32::Cond Pred = CondARM32::AL) { |
| 249 Context.insert(InstARM32Orr::create(Func, Dest, Src0, Src1, Pred)); | 286 Context.insert(InstARM32Orr::create(Func, Dest, Src0, Src1, Pred)); |
| 250 } | 287 } |
| 288 void _orrs(Variable *Dest, Variable *Src0, Operand *Src1, |
| 289 CondARM32::Cond Pred = CondARM32::AL) { |
| 290 const bool SetFlags = true; |
| 291 Context.insert( |
| 292 InstARM32Orr::create(Func, Dest, Src0, Src1, Pred, SetFlags)); |
| 293 } |
| 251 void _push(const VarList &Sources) { | 294 void _push(const VarList &Sources) { |
| 252 Context.insert(InstARM32Push::create(Func, Sources)); | 295 Context.insert(InstARM32Push::create(Func, Sources)); |
| 253 } | 296 } |
| 254 void _pop(const VarList &Dests) { | 297 void _pop(const VarList &Dests) { |
| 255 Context.insert(InstARM32Pop::create(Func, Dests)); | 298 Context.insert(InstARM32Pop::create(Func, Dests)); |
| 256 // Mark dests as modified. | 299 // Mark dests as modified. |
| 257 for (Variable *Dest : Dests) | 300 for (Variable *Dest : Dests) |
| 258 Context.insert(InstFakeDef::create(Func, Dest)); | 301 Context.insert(InstFakeDef::create(Func, Dest)); |
| 259 } | 302 } |
| 303 void _ret(Variable *LR, Variable *Src0 = nullptr) { |
| 304 Context.insert(InstARM32Ret::create(Func, LR, Src0)); |
| 305 } |
| 260 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1, | 306 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1, |
| 261 CondARM32::Cond Pred = CondARM32::AL) { | 307 CondARM32::Cond Pred = CondARM32::AL) { |
| 262 Context.insert(InstARM32Rsb::create(Func, Dest, Src0, Src1, Pred)); | 308 Context.insert(InstARM32Rsb::create(Func, Dest, Src0, Src1, Pred)); |
| 263 } | 309 } |
| 264 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1, | 310 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1, |
| 265 CondARM32::Cond Pred = CondARM32::AL) { | 311 CondARM32::Cond Pred = CondARM32::AL) { |
| 266 Context.insert(InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred)); | 312 Context.insert(InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred)); |
| 267 } | 313 } |
| 268 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1, | 314 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1, |
| 269 CondARM32::Cond Pred = CondARM32::AL) { | 315 CondARM32::Cond Pred = CondARM32::AL) { |
| 270 const bool SetFlags = true; | 316 const bool SetFlags = true; |
| 271 Context.insert( | 317 Context.insert( |
| 272 InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred, SetFlags)); | 318 InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred, SetFlags)); |
| 273 } | 319 } |
| 320 void _sdiv(Variable *Dest, Variable *Src0, Variable *Src1, |
| 321 CondARM32::Cond Pred = CondARM32::AL) { |
| 322 Context.insert(InstARM32Sdiv::create(Func, Dest, Src0, Src1, Pred)); |
| 323 } |
| 274 void _str(Variable *Value, OperandARM32Mem *Addr, | 324 void _str(Variable *Value, OperandARM32Mem *Addr, |
| 275 CondARM32::Cond Pred = CondARM32::AL) { | 325 CondARM32::Cond Pred = CondARM32::AL) { |
| 276 Context.insert(InstARM32Str::create(Func, Value, Addr, Pred)); | 326 Context.insert(InstARM32Str::create(Func, Value, Addr, Pred)); |
| 277 } | 327 } |
| 278 void _sub(Variable *Dest, Variable *Src0, Operand *Src1, | 328 void _sub(Variable *Dest, Variable *Src0, Operand *Src1, |
| 279 CondARM32::Cond Pred = CondARM32::AL) { | 329 CondARM32::Cond Pred = CondARM32::AL) { |
| 280 Context.insert(InstARM32Sub::create(Func, Dest, Src0, Src1, Pred)); | 330 Context.insert(InstARM32Sub::create(Func, Dest, Src0, Src1, Pred)); |
| 281 } | 331 } |
| 282 void _subs(Variable *Dest, Variable *Src0, Operand *Src1, | 332 void _subs(Variable *Dest, Variable *Src0, Operand *Src1, |
| 283 CondARM32::Cond Pred = CondARM32::AL) { | 333 CondARM32::Cond Pred = CondARM32::AL) { |
| 284 const bool SetFlags = true; | 334 const bool SetFlags = true; |
| 285 Context.insert( | 335 Context.insert( |
| 286 InstARM32Sub::create(Func, Dest, Src0, Src1, Pred, SetFlags)); | 336 InstARM32Sub::create(Func, Dest, Src0, Src1, Pred, SetFlags)); |
| 287 } | 337 } |
| 288 void _sxt(Variable *Dest, Variable *Src0, | 338 void _sxt(Variable *Dest, Variable *Src0, |
| 289 CondARM32::Cond Pred = CondARM32::AL) { | 339 CondARM32::Cond Pred = CondARM32::AL) { |
| 290 Context.insert(InstARM32Sxt::create(Func, Dest, Src0, Pred)); | 340 Context.insert(InstARM32Sxt::create(Func, Dest, Src0, Pred)); |
| 291 } | 341 } |
| 292 void _ret(Variable *LR, Variable *Src0 = nullptr) { | 342 void _tst(Variable *Src0, Operand *Src1, |
| 293 Context.insert(InstARM32Ret::create(Func, LR, Src0)); | 343 CondARM32::Cond Pred = CondARM32::AL) { |
| 344 Context.insert(InstARM32Tst::create(Func, Src0, Src1, Pred)); |
| 345 } |
| 346 void _trap() { Context.insert(InstARM32Trap::create(Func)); } |
| 347 void _udiv(Variable *Dest, Variable *Src0, Variable *Src1, |
| 348 CondARM32::Cond Pred = CondARM32::AL) { |
| 349 Context.insert(InstARM32Udiv::create(Func, Dest, Src0, Src1, Pred)); |
| 294 } | 350 } |
| 295 void _umull(Variable *DestLo, Variable *DestHi, Variable *Src0, | 351 void _umull(Variable *DestLo, Variable *DestHi, Variable *Src0, |
| 296 Variable *Src1, CondARM32::Cond Pred = CondARM32::AL) { | 352 Variable *Src1, CondARM32::Cond Pred = CondARM32::AL) { |
| 297 Context.insert( | 353 Context.insert( |
| 298 InstARM32Umull::create(Func, DestLo, DestHi, Src0, Src1, Pred)); | 354 InstARM32Umull::create(Func, DestLo, DestHi, Src0, Src1, Pred)); |
| 299 // Model the modification to the second dest as a fake def. | 355 // Model the modification to the second dest as a fake def. |
| 300 // Note that the def is not predicated. | 356 // Note that the def is not predicated. |
| 301 Context.insert(InstFakeDef::create(Func, DestHi, DestLo)); | 357 Context.insert(InstFakeDef::create(Func, DestHi, DestLo)); |
| 302 } | 358 } |
| 303 void _uxt(Variable *Dest, Variable *Src0, | 359 void _uxt(Variable *Dest, Variable *Src0, |
| 304 CondARM32::Cond Pred = CondARM32::AL) { | 360 CondARM32::Cond Pred = CondARM32::AL) { |
| 305 Context.insert(InstARM32Uxt::create(Func, Dest, Src0, Pred)); | 361 Context.insert(InstARM32Uxt::create(Func, Dest, Src0, Pred)); |
| 306 } | 362 } |
| 307 | 363 |
| 308 ARM32InstructionSet InstructionSet = ARM32InstructionSet::Begin; | 364 TargetARM32Features CPUFeatures; |
| 309 bool UsesFramePointer = false; | 365 bool UsesFramePointer = false; |
| 310 bool NeedsStackAlignment = false; | 366 bool NeedsStackAlignment = false; |
| 311 bool MaybeLeafFunc = true; | 367 bool MaybeLeafFunc = true; |
| 312 size_t SpillAreaSizeBytes = 0; | 368 size_t SpillAreaSizeBytes = 0; |
| 313 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 369 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
| 314 llvm::SmallBitVector ScratchRegs; | 370 llvm::SmallBitVector ScratchRegs; |
| 315 llvm::SmallBitVector RegsUsed; | 371 llvm::SmallBitVector RegsUsed; |
| 316 VarList PhysicalRegisters[IceType_NUM]; | 372 VarList PhysicalRegisters[IceType_NUM]; |
| 317 static IceString RegNames[]; | 373 static IceString RegNames[]; |
| 318 | 374 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderARM32(Ctx)); | 435 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderARM32(Ctx)); |
| 380 } | 436 } |
| 381 | 437 |
| 382 void lower() override; | 438 void lower() override; |
| 383 | 439 |
| 384 protected: | 440 protected: |
| 385 explicit TargetHeaderARM32(GlobalContext *Ctx); | 441 explicit TargetHeaderARM32(GlobalContext *Ctx); |
| 386 | 442 |
| 387 private: | 443 private: |
| 388 ~TargetHeaderARM32() = default; | 444 ~TargetHeaderARM32() = default; |
| 445 |
| 446 TargetARM32Features CPUFeatures; |
| 389 }; | 447 }; |
| 390 | 448 |
| 391 } // end of namespace Ice | 449 } // end of namespace Ice |
| 392 | 450 |
| 393 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 451 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
| OLD | NEW |