| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 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 TargetLoweringX8632 class, which | 10 // This file declares the TargetLoweringX8632 class, which |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, | 129 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, |
| 130 SizeT MaxSrcs) { | 130 SizeT MaxSrcs) { |
| 131 bool SuppressMangling = true; | 131 bool SuppressMangling = true; |
| 132 Type Ty = Dest ? Dest->getType() : IceType_void; | 132 Type Ty = Dest ? Dest->getType() : IceType_void; |
| 133 Constant *CallTarget = Ctx->getConstantSym(Ty, 0, Name, SuppressMangling); | 133 Constant *CallTarget = Ctx->getConstantSym(Ty, 0, Name, SuppressMangling); |
| 134 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); | 134 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); |
| 135 return Call; | 135 return Call; |
| 136 } | 136 } |
| 137 static Type stackSlotType(); | 137 static Type stackSlotType(); |
| 138 | 138 |
| 139 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
| 140 |
| 139 // The following are helpers that insert lowered x86 instructions | 141 // The following are helpers that insert lowered x86 instructions |
| 140 // with minimal syntactic overhead, so that the lowering code can | 142 // with minimal syntactic overhead, so that the lowering code can |
| 141 // look as close to assembly as practical. | 143 // look as close to assembly as practical. |
| 142 void _adc(Variable *Dest, Operand *Src0) { | 144 void _adc(Variable *Dest, Operand *Src0) { |
| 143 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); | 145 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); |
| 144 } | 146 } |
| 145 void _add(Variable *Dest, Operand *Src0) { | 147 void _add(Variable *Dest, Operand *Src0) { |
| 146 Context.insert(InstX8632Add::create(Func, Dest, Src0)); | 148 Context.insert(InstX8632Add::create(Func, Dest, Src0)); |
| 147 } | 149 } |
| 148 void _addss(Variable *Dest, Operand *Src0) { | 150 void _addss(Variable *Dest, Operand *Src0) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // as infinite register allocation weight, and returned through the | 197 // as infinite register allocation weight, and returned through the |
| 196 // in/out Dest argument. | 198 // in/out Dest argument. |
| 197 void _mov(Variable *&Dest, Operand *Src0, | 199 void _mov(Variable *&Dest, Operand *Src0, |
| 198 int32_t RegNum = Variable::NoRegister) { | 200 int32_t RegNum = Variable::NoRegister) { |
| 199 if (Dest == NULL) { | 201 if (Dest == NULL) { |
| 200 Dest = legalizeToVar(Src0, false, RegNum); | 202 Dest = legalizeToVar(Src0, false, RegNum); |
| 201 } else { | 203 } else { |
| 202 Context.insert(InstX8632Mov::create(Func, Dest, Src0)); | 204 Context.insert(InstX8632Mov::create(Func, Dest, Src0)); |
| 203 } | 205 } |
| 204 } | 206 } |
| 207 void _movp(Variable *Dest, Operand *Src0) { |
| 208 Context.insert(InstX8632Movp::create(Func, Dest, Src0)); |
| 209 } |
| 205 void _movq(Variable *Dest, Operand *Src0) { | 210 void _movq(Variable *Dest, Operand *Src0) { |
| 206 Context.insert(InstX8632Movq::create(Func, Dest, Src0)); | 211 Context.insert(InstX8632Movq::create(Func, Dest, Src0)); |
| 207 } | 212 } |
| 208 void _movsx(Variable *Dest, Operand *Src0) { | 213 void _movsx(Variable *Dest, Operand *Src0) { |
| 209 Context.insert(InstX8632Movsx::create(Func, Dest, Src0)); | 214 Context.insert(InstX8632Movsx::create(Func, Dest, Src0)); |
| 210 } | 215 } |
| 211 void _movzx(Variable *Dest, Operand *Src0) { | 216 void _movzx(Variable *Dest, Operand *Src0) { |
| 212 Context.insert(InstX8632Movzx::create(Func, Dest, Src0)); | 217 Context.insert(InstX8632Movzx::create(Func, Dest, Src0)); |
| 213 } | 218 } |
| 214 void _mul(Variable *Dest, Variable *Src0, Operand *Src1) { | 219 void _mul(Variable *Dest, Variable *Src0, Operand *Src1) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 void _ud2() { Context.insert(InstX8632UD2::create(Func)); } | 273 void _ud2() { Context.insert(InstX8632UD2::create(Func)); } |
| 269 void _xadd(Operand *Dest, Variable *Src, bool Locked) { | 274 void _xadd(Operand *Dest, Variable *Src, bool Locked) { |
| 270 Context.insert(InstX8632Xadd::create(Func, Dest, Src, Locked)); | 275 Context.insert(InstX8632Xadd::create(Func, Dest, Src, Locked)); |
| 271 // The xadd exchanges Dest and Src (modifying Src). | 276 // The xadd exchanges Dest and Src (modifying Src). |
| 272 // Model that update with a FakeDef. | 277 // Model that update with a FakeDef. |
| 273 Context.insert(InstFakeDef::create(Func, Src)); | 278 Context.insert(InstFakeDef::create(Func, Src)); |
| 274 } | 279 } |
| 275 void _xor(Variable *Dest, Operand *Src0) { | 280 void _xor(Variable *Dest, Operand *Src0) { |
| 276 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); | 281 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); |
| 277 } | 282 } |
| 283 void _pxor(Variable *Dest, Operand *Src0) { |
| 284 Context.insert(InstX8632Pxor::create(Func, Dest, Src0)); |
| 285 } |
| 278 | 286 |
| 279 bool IsEbpBasedFrame; | 287 bool IsEbpBasedFrame; |
| 280 size_t FrameSizeLocals; | 288 size_t FrameSizeLocals; |
| 281 size_t LocalsSizeBytes; | 289 size_t LocalsSizeBytes; |
| 282 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 290 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
| 283 llvm::SmallBitVector ScratchRegs; | 291 llvm::SmallBitVector ScratchRegs; |
| 284 llvm::SmallBitVector RegsUsed; | 292 llvm::SmallBitVector RegsUsed; |
| 285 SizeT NextLabelNumber; | 293 SizeT NextLabelNumber; |
| 286 bool ComputedLiveRanges; | 294 bool ComputedLiveRanges; |
| 287 VarList PhysicalRegisters; | 295 VarList PhysicalRegisters; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 306 protected: | 314 protected: |
| 307 TargetGlobalInitX8632(GlobalContext *Ctx); | 315 TargetGlobalInitX8632(GlobalContext *Ctx); |
| 308 | 316 |
| 309 private: | 317 private: |
| 310 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) LLVM_DELETED_FUNCTION; | 318 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) LLVM_DELETED_FUNCTION; |
| 311 TargetGlobalInitX8632 & | 319 TargetGlobalInitX8632 & |
| 312 operator=(const TargetGlobalInitX8632 &) LLVM_DELETED_FUNCTION; | 320 operator=(const TargetGlobalInitX8632 &) LLVM_DELETED_FUNCTION; |
| 313 virtual ~TargetGlobalInitX8632() {} | 321 virtual ~TargetGlobalInitX8632() {} |
| 314 }; | 322 }; |
| 315 | 323 |
| 324 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
| 316 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 325 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 317 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 326 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
| 318 | 327 |
| 319 } // end of namespace Ice | 328 } // end of namespace Ice |
| 320 | 329 |
| 321 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 330 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| OLD | NEW |