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 int32_t RegNum = Variable::NoRegister); | 129 int32_t RegNum = Variable::NoRegister); |
130 // Turn a pointer operand into a memory operand that can be | 130 // Turn a pointer operand into a memory operand that can be |
131 // used by a real load/store operation. Legalizes the operand as well. | 131 // used by a real load/store operation. Legalizes the operand as well. |
132 // This is a nop if the operand is already a legal memory operand. | 132 // This is a nop if the operand is already a legal memory operand. |
133 OperandX8632Mem *FormMemoryOperand(Operand *Ptr, Type Ty); | 133 OperandX8632Mem *FormMemoryOperand(Operand *Ptr, Type Ty); |
134 | 134 |
135 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); | 135 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); |
136 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, | 136 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, |
137 SizeT MaxSrcs) { | 137 SizeT MaxSrcs) { |
138 bool SuppressMangling = true; | 138 bool SuppressMangling = true; |
139 Type Ty = Dest ? Dest->getType() : IceType_void; | 139 const Type FunctionPointerType = IceType_i32; |
140 Constant *CallTarget = Ctx->getConstantSym(Ty, 0, Name, SuppressMangling); | 140 Constant *CallTarget = |
| 141 Ctx->getConstantSym(FunctionPointerType, 0, Name, SuppressMangling); |
141 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); | 142 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); |
142 return Call; | 143 return Call; |
143 } | 144 } |
144 static Type stackSlotType(); | 145 static Type stackSlotType(); |
145 | 146 |
146 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); | 147 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
147 | 148 |
148 // The following are helpers that insert lowered x86 instructions | 149 // The following are helpers that insert lowered x86 instructions |
149 // with minimal syntactic overhead, so that the lowering code can | 150 // with minimal syntactic overhead, so that the lowering code can |
150 // look as close to assembly as practical. | 151 // look as close to assembly as practical. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 virtual ~TargetGlobalInitX8632() {} | 370 virtual ~TargetGlobalInitX8632() {} |
370 }; | 371 }; |
371 | 372 |
372 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 373 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
373 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 374 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
374 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 375 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
375 | 376 |
376 } // end of namespace Ice | 377 } // end of namespace Ice |
377 | 378 |
378 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 379 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |