| 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 28 matching lines...) Expand all Loading... |
| 39 virtual bool hasFramePointer() const { return IsEbpBasedFrame; } | 39 virtual bool hasFramePointer() const { return IsEbpBasedFrame; } |
| 40 virtual SizeT getFrameOrStackReg() const { | 40 virtual SizeT getFrameOrStackReg() const { |
| 41 return IsEbpBasedFrame ? Reg_ebp : Reg_esp; | 41 return IsEbpBasedFrame ? Reg_ebp : Reg_esp; |
| 42 } | 42 } |
| 43 virtual size_t typeWidthInBytesOnStack(Type Ty) { | 43 virtual size_t typeWidthInBytesOnStack(Type Ty) { |
| 44 // Round up to the next multiple of 4 bytes. In particular, i1, | 44 // Round up to the next multiple of 4 bytes. In particular, i1, |
| 45 // i8, and i16 are rounded up to 4 bytes. | 45 // i8, and i16 are rounded up to 4 bytes. |
| 46 return (typeWidthInBytes(Ty) + 3) & ~3; | 46 return (typeWidthInBytes(Ty) + 3) & ~3; |
| 47 } | 47 } |
| 48 virtual void emitVariable(const Variable *Var, const Cfg *Func) const; | 48 virtual void emitVariable(const Variable *Var, const Cfg *Func) const; |
| 49 virtual void lowerArguments(); |
| 49 virtual void addProlog(CfgNode *Node); | 50 virtual void addProlog(CfgNode *Node); |
| 50 virtual void addEpilog(CfgNode *Node); | 51 virtual void addEpilog(CfgNode *Node); |
| 51 virtual void emitConstants() const; | 52 virtual void emitConstants() const; |
| 52 SizeT makeNextLabelNumber() { return NextLabelNumber++; } | 53 SizeT makeNextLabelNumber() { return NextLabelNumber++; } |
| 53 // Ensure that a 64-bit Variable has been split into 2 32-bit | 54 // Ensure that a 64-bit Variable has been split into 2 32-bit |
| 54 // Variables, creating them if necessary. This is needed for all | 55 // Variables, creating them if necessary. This is needed for all |
| 55 // I64 operations, and it is needed for pushing F64 arguments for | 56 // I64 operations, and it is needed for pushing F64 arguments for |
| 56 // function calls using the 32-bit push instruction (though the | 57 // function calls using the 32-bit push instruction (though the |
| 57 // latter could be done by directly writing to the stack). | 58 // latter could be done by directly writing to the stack). |
| 58 void split64(Variable *Var); | 59 void split64(Variable *Var); |
| 59 void setArgOffsetAndCopy(Variable *Arg, Variable *FramePtr, | 60 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, |
| 60 size_t BasicFrameOffset, size_t &InArgsSizeBytes); | 61 size_t BasicFrameOffset, size_t &InArgsSizeBytes); |
| 61 Operand *loOperand(Operand *Operand); | 62 Operand *loOperand(Operand *Operand); |
| 62 Operand *hiOperand(Operand *Operand); | 63 Operand *hiOperand(Operand *Operand); |
| 63 | 64 |
| 64 enum Registers { | 65 enum Registers { |
| 65 #define X(val, init, name, name16, name8, scratch, preserved, stackptr, \ | 66 #define X(val, init, name, name16, name8, scratch, preserved, stackptr, \ |
| 66 frameptr, isI8, isInt, isFP) \ | 67 frameptr, isI8, isInt, isFP) \ |
| 67 val init, | 68 val init, |
| 68 REGX8632_TABLE | 69 REGX8632_TABLE |
| 69 #undef X | 70 #undef X |
| 70 Reg_NUM | 71 Reg_NUM |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 virtual ~TargetGlobalInitX8632() {} | 322 virtual ~TargetGlobalInitX8632() {} |
| 322 }; | 323 }; |
| 323 | 324 |
| 324 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 325 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
| 325 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 326 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 326 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 327 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
| 327 | 328 |
| 328 } // end of namespace Ice | 329 } // end of namespace Ice |
| 329 | 330 |
| 330 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 331 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| OLD | NEW |