| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, | 126 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, |
| 127 SizeT MaxSrcs) { | 127 SizeT MaxSrcs) { |
| 128 bool SuppressMangling = true; | 128 bool SuppressMangling = true; |
| 129 Type Ty = Dest ? Dest->getType() : IceType_void; | 129 Type Ty = Dest ? Dest->getType() : IceType_void; |
| 130 Constant *CallTarget = Ctx->getConstantSym(Ty, 0, Name, SuppressMangling); | 130 Constant *CallTarget = Ctx->getConstantSym(Ty, 0, Name, SuppressMangling); |
| 131 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); | 131 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); |
| 132 return Call; | 132 return Call; |
| 133 } | 133 } |
| 134 static Type stackSlotType(); | 134 static Type stackSlotType(); |
| 135 | 135 |
| 136 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
| 137 |
| 136 // The following are helpers that insert lowered x86 instructions | 138 // The following are helpers that insert lowered x86 instructions |
| 137 // with minimal syntactic overhead, so that the lowering code can | 139 // with minimal syntactic overhead, so that the lowering code can |
| 138 // look as close to assembly as practical. | 140 // look as close to assembly as practical. |
| 139 void _adc(Variable *Dest, Operand *Src0) { | 141 void _adc(Variable *Dest, Operand *Src0) { |
| 140 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); | 142 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); |
| 141 } | 143 } |
| 142 void _add(Variable *Dest, Operand *Src0) { | 144 void _add(Variable *Dest, Operand *Src0) { |
| 143 Context.insert(InstX8632Add::create(Func, Dest, Src0)); | 145 Context.insert(InstX8632Add::create(Func, Dest, Src0)); |
| 144 } | 146 } |
| 145 void _addss(Variable *Dest, Operand *Src0) { | 147 void _addss(Variable *Dest, Operand *Src0) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // as infinite register allocation weight, and returned through the | 194 // as infinite register allocation weight, and returned through the |
| 193 // in/out Dest argument. | 195 // in/out Dest argument. |
| 194 void _mov(Variable *&Dest, Operand *Src0, | 196 void _mov(Variable *&Dest, Operand *Src0, |
| 195 int32_t RegNum = Variable::NoRegister) { | 197 int32_t RegNum = Variable::NoRegister) { |
| 196 if (Dest == NULL) { | 198 if (Dest == NULL) { |
| 197 Dest = legalizeToVar(Src0, false, RegNum); | 199 Dest = legalizeToVar(Src0, false, RegNum); |
| 198 } else { | 200 } else { |
| 199 Context.insert(InstX8632Mov::create(Func, Dest, Src0)); | 201 Context.insert(InstX8632Mov::create(Func, Dest, Src0)); |
| 200 } | 202 } |
| 201 } | 203 } |
| 204 void _movp(Variable *Dest, Operand *Src0) { |
| 205 Context.insert(InstX8632Movp::create(Func, Dest, Src0)); |
| 206 } |
| 202 void _movq(Variable *Dest, Operand *Src0) { | 207 void _movq(Variable *Dest, Operand *Src0) { |
| 203 Context.insert(InstX8632Movq::create(Func, Dest, Src0)); | 208 Context.insert(InstX8632Movq::create(Func, Dest, Src0)); |
| 204 } | 209 } |
| 205 void _movsx(Variable *Dest, Operand *Src0) { | 210 void _movsx(Variable *Dest, Operand *Src0) { |
| 206 Context.insert(InstX8632Movsx::create(Func, Dest, Src0)); | 211 Context.insert(InstX8632Movsx::create(Func, Dest, Src0)); |
| 207 } | 212 } |
| 208 void _movzx(Variable *Dest, Operand *Src0) { | 213 void _movzx(Variable *Dest, Operand *Src0) { |
| 209 Context.insert(InstX8632Movzx::create(Func, Dest, Src0)); | 214 Context.insert(InstX8632Movzx::create(Func, Dest, Src0)); |
| 210 } | 215 } |
| 211 void _mul(Variable *Dest, Variable *Src0, Operand *Src1) { | 216 void _mul(Variable *Dest, Variable *Src0, Operand *Src1) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 llvm::SmallBitVector RegsUsed; | 286 llvm::SmallBitVector RegsUsed; |
| 282 SizeT NextLabelNumber; | 287 SizeT NextLabelNumber; |
| 283 bool ComputedLiveRanges; | 288 bool ComputedLiveRanges; |
| 284 VarList PhysicalRegisters; | 289 VarList PhysicalRegisters; |
| 285 static IceString RegNames[]; | 290 static IceString RegNames[]; |
| 286 | 291 |
| 287 private: | 292 private: |
| 288 TargetX8632(const TargetX8632 &) LLVM_DELETED_FUNCTION; | 293 TargetX8632(const TargetX8632 &) LLVM_DELETED_FUNCTION; |
| 289 TargetX8632 &operator=(const TargetX8632 &) LLVM_DELETED_FUNCTION; | 294 TargetX8632 &operator=(const TargetX8632 &) LLVM_DELETED_FUNCTION; |
| 290 virtual ~TargetX8632() {} | 295 virtual ~TargetX8632() {} |
| 291 template <typename T> void emitConstantPool() const; | 296 template <typename T> void emitScalarConstantPool() const; |
| 297 void emitVectorConstantPool() const; |
| 292 }; | 298 }; |
| 293 | 299 |
| 300 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
| 294 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 301 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 295 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 302 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
| 303 template <> void ConstantVector::emit(GlobalContext *Ctx) const; |
| 304 template <> void ConstantBitVector::emit(GlobalContext *Ctx) const; |
| 296 | 305 |
| 297 } // end of namespace Ice | 306 } // end of namespace Ice |
| 298 | 307 |
| 299 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 308 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| OLD | NEW |