| 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 the test and branch |
| 163 // then returns the label for the target of the branch. |
| 164 // If no check is needed, returns nullptr. |
| 165 InstARM32Label *beginDiv0Check(Type Ty, Operand *SrcLo, Operand *SrcHi); |
| 166 // If a divide-by-zero check is needed (CheckLabel is non-zero), inserts |
| 167 // a local branch target with a trap as the body. |
| 168 void endDiv0Check(InstARM32Label *CheckLabel); |
| 169 typedef void (TargetARM32::*ExtInstr)(Variable *, Variable *, |
| 170 CondARM32::Cond); |
| 171 typedef void (TargetARM32::*DivInstr)(Variable *, Variable *, Variable *, |
| 172 CondARM32::Cond); |
| 173 void lowerIDivRem(Variable *Dest, Variable *T, Variable *Src0R, Operand *Src1, |
| 174 ExtInstr ExtFunc, DivInstr DivFunc, |
| 175 const char *DivHelperName, bool IsRemainder); |
| 176 |
| 144 // The following are helpers that insert lowered ARM32 instructions | 177 // The following are helpers that insert lowered ARM32 instructions |
| 145 // with minimal syntactic overhead, so that the lowering code can | 178 // with minimal syntactic overhead, so that the lowering code can |
| 146 // look as close to assembly as practical. | 179 // look as close to assembly as practical. |
| 147 | 180 |
| 148 void _add(Variable *Dest, Variable *Src0, Operand *Src1, | 181 void _add(Variable *Dest, Variable *Src0, Operand *Src1, |
| 149 CondARM32::Cond Pred = CondARM32::AL) { | 182 CondARM32::Cond Pred = CondARM32::AL) { |
| 150 Context.insert(InstARM32Add::create(Func, Dest, Src0, Src1, Pred)); | 183 Context.insert(InstARM32Add::create(Func, Dest, Src0, Src1, Pred)); |
| 151 } | 184 } |
| 152 void _adds(Variable *Dest, Variable *Src0, Operand *Src1, | 185 void _adds(Variable *Dest, Variable *Src0, Operand *Src1, |
| 153 CondARM32::Cond Pred = CondARM32::AL) { | 186 CondARM32::Cond Pred = CondARM32::AL) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 168 Context.insert(InstARM32And::create(Func, Dest, Src0, Src1, Pred)); | 201 Context.insert(InstARM32And::create(Func, Dest, Src0, Src1, Pred)); |
| 169 } | 202 } |
| 170 void _asr(Variable *Dest, Variable *Src0, Operand *Src1, | 203 void _asr(Variable *Dest, Variable *Src0, Operand *Src1, |
| 171 CondARM32::Cond Pred = CondARM32::AL) { | 204 CondARM32::Cond Pred = CondARM32::AL) { |
| 172 Context.insert(InstARM32Asr::create(Func, Dest, Src0, Src1, Pred)); | 205 Context.insert(InstARM32Asr::create(Func, Dest, Src0, Src1, Pred)); |
| 173 } | 206 } |
| 174 void _bic(Variable *Dest, Variable *Src0, Operand *Src1, | 207 void _bic(Variable *Dest, Variable *Src0, Operand *Src1, |
| 175 CondARM32::Cond Pred = CondARM32::AL) { | 208 CondARM32::Cond Pred = CondARM32::AL) { |
| 176 Context.insert(InstARM32Bic::create(Func, Dest, Src0, Src1, Pred)); | 209 Context.insert(InstARM32Bic::create(Func, Dest, Src0, Src1, Pred)); |
| 177 } | 210 } |
| 178 void _br(CondARM32::Cond Condition, CfgNode *TargetTrue, | 211 void _br(CfgNode *TargetTrue, CfgNode *TargetFalse, |
| 179 CfgNode *TargetFalse) { | 212 CondARM32::Cond Condition) { |
| 180 Context.insert( | 213 Context.insert( |
| 181 InstARM32Br::create(Func, TargetTrue, TargetFalse, Condition)); | 214 InstARM32Br::create(Func, TargetTrue, TargetFalse, Condition)); |
| 182 } | 215 } |
| 183 void _br(CfgNode *Target) { | 216 void _br(CfgNode *Target) { |
| 184 Context.insert(InstARM32Br::create(Func, Target)); | 217 Context.insert(InstARM32Br::create(Func, Target)); |
| 185 } | 218 } |
| 186 void _br(CfgNode *Target, CondARM32::Cond Condition) { | 219 void _br(CfgNode *Target, CondARM32::Cond Condition) { |
| 187 Context.insert(InstARM32Br::create(Func, Target, Condition)); | 220 Context.insert(InstARM32Br::create(Func, Target, Condition)); |
| 188 } | 221 } |
| 222 void _br(InstARM32Label *Label, CondARM32::Cond Condition) { |
| 223 Context.insert(InstARM32Br::create(Func, Label, Condition)); |
| 224 } |
| 189 void _cmp(Variable *Src0, Operand *Src1, | 225 void _cmp(Variable *Src0, Operand *Src1, |
| 190 CondARM32::Cond Pred = CondARM32::AL) { | 226 CondARM32::Cond Pred = CondARM32::AL) { |
| 191 Context.insert(InstARM32Cmp::create(Func, Src0, Src1, Pred)); | 227 Context.insert(InstARM32Cmp::create(Func, Src0, Src1, Pred)); |
| 192 } | 228 } |
| 193 void _eor(Variable *Dest, Variable *Src0, Operand *Src1, | 229 void _eor(Variable *Dest, Variable *Src0, Operand *Src1, |
| 194 CondARM32::Cond Pred = CondARM32::AL) { | 230 CondARM32::Cond Pred = CondARM32::AL) { |
| 195 Context.insert(InstARM32Eor::create(Func, Dest, Src0, Src1, Pred)); | 231 Context.insert(InstARM32Eor::create(Func, Dest, Src0, Src1, Pred)); |
| 196 } | 232 } |
| 197 void _ldr(Variable *Dest, OperandARM32Mem *Addr, | 233 void _ldr(Variable *Dest, OperandARM32Mem *Addr, |
| 198 CondARM32::Cond Pred = CondARM32::AL) { | 234 CondARM32::Cond Pred = CondARM32::AL) { |
| 199 Context.insert(InstARM32Ldr::create(Func, Dest, Addr, Pred)); | 235 Context.insert(InstARM32Ldr::create(Func, Dest, Addr, Pred)); |
| 200 } | 236 } |
| 201 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, | 237 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, |
| 202 CondARM32::Cond Pred = CondARM32::AL) { | 238 CondARM32::Cond Pred = CondARM32::AL) { |
| 203 Context.insert(InstARM32Lsl::create(Func, Dest, Src0, Src1, Pred)); | 239 Context.insert(InstARM32Lsl::create(Func, Dest, Src0, Src1, Pred)); |
| 204 } | 240 } |
| 205 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1, | 241 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1, |
| 206 CondARM32::Cond Pred = CondARM32::AL) { | 242 CondARM32::Cond Pred = CondARM32::AL) { |
| 207 Context.insert(InstARM32Lsr::create(Func, Dest, Src0, Src1, Pred)); | 243 Context.insert(InstARM32Lsr::create(Func, Dest, Src0, Src1, Pred)); |
| 208 } | 244 } |
| 209 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, | 245 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, |
| 210 CondARM32::Cond Pred = CondARM32::AL) { | 246 CondARM32::Cond Pred = CondARM32::AL) { |
| 211 Context.insert(InstARM32Mla::create(Func, Dest, Src0, Src1, Acc, Pred)); | 247 Context.insert(InstARM32Mla::create(Func, Dest, Src0, Src1, Acc, Pred)); |
| 212 } | 248 } |
| 249 void _mls(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, |
| 250 CondARM32::Cond Pred = CondARM32::AL) { |
| 251 Context.insert(InstARM32Mls::create(Func, Dest, Src0, Src1, Acc, Pred)); |
| 252 } |
| 213 // If Dest=nullptr is passed in, then a new variable is created, | 253 // If Dest=nullptr is passed in, then a new variable is created, |
| 214 // marked as infinite register allocation weight, and returned | 254 // marked as infinite register allocation weight, and returned |
| 215 // through the in/out Dest argument. | 255 // through the in/out Dest argument. |
| 216 void _mov(Variable *&Dest, Operand *Src0, | 256 void _mov(Variable *&Dest, Operand *Src0, |
| 217 CondARM32::Cond Pred = CondARM32::AL, | 257 CondARM32::Cond Pred = CondARM32::AL, |
| 218 int32_t RegNum = Variable::NoRegister) { | 258 int32_t RegNum = Variable::NoRegister) { |
| 219 if (Dest == nullptr) | 259 if (Dest == nullptr) |
| 220 Dest = makeReg(Src0->getType(), RegNum); | 260 Dest = makeReg(Src0->getType(), RegNum); |
| 221 Context.insert(InstARM32Mov::create(Func, Dest, Src0, Pred)); | 261 Context.insert(InstARM32Mov::create(Func, Dest, Src0, Pred)); |
| 222 } | 262 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 241 Context.insert(InstARM32Mul::create(Func, Dest, Src0, Src1, Pred)); | 281 Context.insert(InstARM32Mul::create(Func, Dest, Src0, Src1, Pred)); |
| 242 } | 282 } |
| 243 void _mvn(Variable *Dest, Operand *Src0, | 283 void _mvn(Variable *Dest, Operand *Src0, |
| 244 CondARM32::Cond Pred = CondARM32::AL) { | 284 CondARM32::Cond Pred = CondARM32::AL) { |
| 245 Context.insert(InstARM32Mvn::create(Func, Dest, Src0, Pred)); | 285 Context.insert(InstARM32Mvn::create(Func, Dest, Src0, Pred)); |
| 246 } | 286 } |
| 247 void _orr(Variable *Dest, Variable *Src0, Operand *Src1, | 287 void _orr(Variable *Dest, Variable *Src0, Operand *Src1, |
| 248 CondARM32::Cond Pred = CondARM32::AL) { | 288 CondARM32::Cond Pred = CondARM32::AL) { |
| 249 Context.insert(InstARM32Orr::create(Func, Dest, Src0, Src1, Pred)); | 289 Context.insert(InstARM32Orr::create(Func, Dest, Src0, Src1, Pred)); |
| 250 } | 290 } |
| 291 void _orrs(Variable *Dest, Variable *Src0, Operand *Src1, |
| 292 CondARM32::Cond Pred = CondARM32::AL) { |
| 293 const bool SetFlags = true; |
| 294 Context.insert( |
| 295 InstARM32Orr::create(Func, Dest, Src0, Src1, Pred, SetFlags)); |
| 296 } |
| 251 void _push(const VarList &Sources) { | 297 void _push(const VarList &Sources) { |
| 252 Context.insert(InstARM32Push::create(Func, Sources)); | 298 Context.insert(InstARM32Push::create(Func, Sources)); |
| 253 } | 299 } |
| 254 void _pop(const VarList &Dests) { | 300 void _pop(const VarList &Dests) { |
| 255 Context.insert(InstARM32Pop::create(Func, Dests)); | 301 Context.insert(InstARM32Pop::create(Func, Dests)); |
| 256 // Mark dests as modified. | 302 // Mark dests as modified. |
| 257 for (Variable *Dest : Dests) | 303 for (Variable *Dest : Dests) |
| 258 Context.insert(InstFakeDef::create(Func, Dest)); | 304 Context.insert(InstFakeDef::create(Func, Dest)); |
| 259 } | 305 } |
| 306 void _ret(Variable *LR, Variable *Src0 = nullptr) { |
| 307 Context.insert(InstARM32Ret::create(Func, LR, Src0)); |
| 308 } |
| 260 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1, | 309 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1, |
| 261 CondARM32::Cond Pred = CondARM32::AL) { | 310 CondARM32::Cond Pred = CondARM32::AL) { |
| 262 Context.insert(InstARM32Rsb::create(Func, Dest, Src0, Src1, Pred)); | 311 Context.insert(InstARM32Rsb::create(Func, Dest, Src0, Src1, Pred)); |
| 263 } | 312 } |
| 264 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1, | 313 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1, |
| 265 CondARM32::Cond Pred = CondARM32::AL) { | 314 CondARM32::Cond Pred = CondARM32::AL) { |
| 266 Context.insert(InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred)); | 315 Context.insert(InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred)); |
| 267 } | 316 } |
| 268 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1, | 317 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1, |
| 269 CondARM32::Cond Pred = CondARM32::AL) { | 318 CondARM32::Cond Pred = CondARM32::AL) { |
| 270 const bool SetFlags = true; | 319 const bool SetFlags = true; |
| 271 Context.insert( | 320 Context.insert( |
| 272 InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred, SetFlags)); | 321 InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred, SetFlags)); |
| 273 } | 322 } |
| 323 void _sdiv(Variable *Dest, Variable *Src0, Variable *Src1, |
| 324 CondARM32::Cond Pred = CondARM32::AL) { |
| 325 Context.insert(InstARM32Sdiv::create(Func, Dest, Src0, Src1, Pred)); |
| 326 } |
| 274 void _str(Variable *Value, OperandARM32Mem *Addr, | 327 void _str(Variable *Value, OperandARM32Mem *Addr, |
| 275 CondARM32::Cond Pred = CondARM32::AL) { | 328 CondARM32::Cond Pred = CondARM32::AL) { |
| 276 Context.insert(InstARM32Str::create(Func, Value, Addr, Pred)); | 329 Context.insert(InstARM32Str::create(Func, Value, Addr, Pred)); |
| 277 } | 330 } |
| 278 void _sub(Variable *Dest, Variable *Src0, Operand *Src1, | 331 void _sub(Variable *Dest, Variable *Src0, Operand *Src1, |
| 279 CondARM32::Cond Pred = CondARM32::AL) { | 332 CondARM32::Cond Pred = CondARM32::AL) { |
| 280 Context.insert(InstARM32Sub::create(Func, Dest, Src0, Src1, Pred)); | 333 Context.insert(InstARM32Sub::create(Func, Dest, Src0, Src1, Pred)); |
| 281 } | 334 } |
| 282 void _subs(Variable *Dest, Variable *Src0, Operand *Src1, | 335 void _subs(Variable *Dest, Variable *Src0, Operand *Src1, |
| 283 CondARM32::Cond Pred = CondARM32::AL) { | 336 CondARM32::Cond Pred = CondARM32::AL) { |
| 284 const bool SetFlags = true; | 337 const bool SetFlags = true; |
| 285 Context.insert( | 338 Context.insert( |
| 286 InstARM32Sub::create(Func, Dest, Src0, Src1, Pred, SetFlags)); | 339 InstARM32Sub::create(Func, Dest, Src0, Src1, Pred, SetFlags)); |
| 287 } | 340 } |
| 288 void _sxt(Variable *Dest, Variable *Src0, | 341 void _sxt(Variable *Dest, Variable *Src0, |
| 289 CondARM32::Cond Pred = CondARM32::AL) { | 342 CondARM32::Cond Pred = CondARM32::AL) { |
| 290 Context.insert(InstARM32Sxt::create(Func, Dest, Src0, Pred)); | 343 Context.insert(InstARM32Sxt::create(Func, Dest, Src0, Pred)); |
| 291 } | 344 } |
| 292 void _ret(Variable *LR, Variable *Src0 = nullptr) { | 345 void _tst(Variable *Src0, Operand *Src1, |
| 293 Context.insert(InstARM32Ret::create(Func, LR, Src0)); | 346 CondARM32::Cond Pred = CondARM32::AL) { |
| 347 Context.insert(InstARM32Tst::create(Func, Src0, Src1, Pred)); |
| 348 } |
| 349 void _trap() { Context.insert(InstARM32Trap::create(Func)); } |
| 350 void _udiv(Variable *Dest, Variable *Src0, Variable *Src1, |
| 351 CondARM32::Cond Pred = CondARM32::AL) { |
| 352 Context.insert(InstARM32Udiv::create(Func, Dest, Src0, Src1, Pred)); |
| 294 } | 353 } |
| 295 void _umull(Variable *DestLo, Variable *DestHi, Variable *Src0, | 354 void _umull(Variable *DestLo, Variable *DestHi, Variable *Src0, |
| 296 Variable *Src1, CondARM32::Cond Pred = CondARM32::AL) { | 355 Variable *Src1, CondARM32::Cond Pred = CondARM32::AL) { |
| 297 Context.insert( | 356 Context.insert( |
| 298 InstARM32Umull::create(Func, DestLo, DestHi, Src0, Src1, Pred)); | 357 InstARM32Umull::create(Func, DestLo, DestHi, Src0, Src1, Pred)); |
| 299 // Model the modification to the second dest as a fake def. | 358 // Model the modification to the second dest as a fake def. |
| 300 // Note that the def is not predicated. | 359 // Note that the def is not predicated. |
| 301 Context.insert(InstFakeDef::create(Func, DestHi, DestLo)); | 360 Context.insert(InstFakeDef::create(Func, DestHi, DestLo)); |
| 302 } | 361 } |
| 303 void _uxt(Variable *Dest, Variable *Src0, | 362 void _uxt(Variable *Dest, Variable *Src0, |
| 304 CondARM32::Cond Pred = CondARM32::AL) { | 363 CondARM32::Cond Pred = CondARM32::AL) { |
| 305 Context.insert(InstARM32Uxt::create(Func, Dest, Src0, Pred)); | 364 Context.insert(InstARM32Uxt::create(Func, Dest, Src0, Pred)); |
| 306 } | 365 } |
| 307 | 366 |
| 308 ARM32InstructionSet InstructionSet = ARM32InstructionSet::Begin; | 367 TargetARM32Features CPUFeatures; |
| 309 bool UsesFramePointer = false; | 368 bool UsesFramePointer = false; |
| 310 bool NeedsStackAlignment = false; | 369 bool NeedsStackAlignment = false; |
| 311 bool MaybeLeafFunc = true; | 370 bool MaybeLeafFunc = true; |
| 312 size_t SpillAreaSizeBytes = 0; | 371 size_t SpillAreaSizeBytes = 0; |
| 313 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 372 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
| 314 llvm::SmallBitVector ScratchRegs; | 373 llvm::SmallBitVector ScratchRegs; |
| 315 llvm::SmallBitVector RegsUsed; | 374 llvm::SmallBitVector RegsUsed; |
| 316 VarList PhysicalRegisters[IceType_NUM]; | 375 VarList PhysicalRegisters[IceType_NUM]; |
| 317 static IceString RegNames[]; | 376 static IceString RegNames[]; |
| 318 | 377 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderARM32(Ctx)); | 438 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderARM32(Ctx)); |
| 380 } | 439 } |
| 381 | 440 |
| 382 void lower() override; | 441 void lower() override; |
| 383 | 442 |
| 384 protected: | 443 protected: |
| 385 explicit TargetHeaderARM32(GlobalContext *Ctx); | 444 explicit TargetHeaderARM32(GlobalContext *Ctx); |
| 386 | 445 |
| 387 private: | 446 private: |
| 388 ~TargetHeaderARM32() = default; | 447 ~TargetHeaderARM32() = default; |
| 448 |
| 449 TargetARM32Features CPUFeatures; |
| 389 }; | 450 }; |
| 390 | 451 |
| 391 } // end of namespace Ice | 452 } // end of namespace Ice |
| 392 | 453 |
| 393 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 454 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
| OLD | NEW |