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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // instructions that guarantee that the Operand kind is one of those | 140 // instructions that guarantee that the Operand kind is one of those |
141 // indicated by the LegalMask (a bitmask of allowed kinds). If the | 141 // indicated by the LegalMask (a bitmask of allowed kinds). If the |
142 // input Operand is known to already meet the constraints, it may be | 142 // input Operand is known to already meet the constraints, it may be |
143 // simply returned as the result, without creating any new | 143 // simply returned as the result, without creating any new |
144 // instructions or operands. | 144 // instructions or operands. |
145 enum OperandLegalization { | 145 enum OperandLegalization { |
146 Legal_None = 0, | 146 Legal_None = 0, |
147 Legal_Reg = 1 << 0, // physical register, not stack location | 147 Legal_Reg = 1 << 0, // physical register, not stack location |
148 Legal_Imm = 1 << 1, | 148 Legal_Imm = 1 << 1, |
149 Legal_Mem = 1 << 2, // includes [eax+4*ecx] as well as [esp+12] | 149 Legal_Mem = 1 << 2, // includes [eax+4*ecx] as well as [esp+12] |
150 // TODO(stichnot): LEAHACK: remove Legal_Reloc once a proper | |
151 // emitter is used. | |
152 Legal_Reloc = 1 << 3, | |
153 Legal_All = ~Legal_None | 150 Legal_All = ~Legal_None |
154 }; | 151 }; |
155 typedef uint32_t LegalMask; | 152 typedef uint32_t LegalMask; |
156 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All & ~Legal_Reloc, | 153 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, |
157 int32_t RegNum = Variable::NoRegister); | 154 int32_t RegNum = Variable::NoRegister); |
158 Variable *legalizeToVar(Operand *From, int32_t RegNum = Variable::NoRegister); | 155 Variable *legalizeToVar(Operand *From, int32_t RegNum = Variable::NoRegister); |
159 // Turn a pointer operand into a memory operand that can be | 156 // Turn a pointer operand into a memory operand that can be |
160 // used by a real load/store operation. Legalizes the operand as well. | 157 // used by a real load/store operation. Legalizes the operand as well. |
161 // This is a nop if the operand is already a legal memory operand. | 158 // This is a nop if the operand is already a legal memory operand. |
162 OperandX8632Mem *FormMemoryOperand(Operand *Ptr, Type Ty); | 159 OperandX8632Mem *FormMemoryOperand(Operand *Ptr, Type Ty); |
163 | 160 |
164 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); | 161 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); |
165 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, | 162 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, |
166 SizeT MaxSrcs) { | 163 SizeT MaxSrcs) { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 }; | 510 }; |
514 | 511 |
515 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; | 512 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; |
516 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; | 513 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; |
517 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 514 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
518 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 515 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
519 | 516 |
520 } // end of namespace Ice | 517 } // end of namespace Ice |
521 | 518 |
522 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 519 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |