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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 bool hasFramePointer() const override { return IsEbpBasedFrame; } | 47 bool hasFramePointer() const override { return IsEbpBasedFrame; } |
48 SizeT getFrameOrStackReg() const override { | 48 SizeT getFrameOrStackReg() const override { |
49 return IsEbpBasedFrame ? RegX8632::Reg_ebp : RegX8632::Reg_esp; | 49 return IsEbpBasedFrame ? RegX8632::Reg_ebp : RegX8632::Reg_esp; |
50 } | 50 } |
51 size_t typeWidthInBytesOnStack(Type Ty) const override { | 51 size_t typeWidthInBytesOnStack(Type Ty) const override { |
52 // Round up to the next multiple of 4 bytes. In particular, i1, | 52 // Round up to the next multiple of 4 bytes. In particular, i1, |
53 // i8, and i16 are rounded up to 4 bytes. | 53 // i8, and i16 are rounded up to 4 bytes. |
54 return (typeWidthInBytes(Ty) + 3) & ~3; | 54 return (typeWidthInBytes(Ty) + 3) & ~3; |
55 } | 55 } |
56 void emitVariable(const Variable *Var) const override; | 56 void emitVariable(const Variable *Var) const override; |
| 57 |
| 58 const char *getConstantPrefix() const final { return "$"; } |
| 59 void emit(const ConstantUndef *C) const final; |
| 60 void emit(const ConstantInteger32 *C) const final; |
| 61 void emit(const ConstantInteger64 *C) const final; |
| 62 void emit(const ConstantFloat *C) const final; |
| 63 void emit(const ConstantDouble *C) const final; |
| 64 |
57 void lowerArguments() override; | 65 void lowerArguments() override; |
58 void addProlog(CfgNode *Node) override; | 66 void addProlog(CfgNode *Node) override; |
59 void addEpilog(CfgNode *Node) override; | 67 void addEpilog(CfgNode *Node) override; |
60 // Ensure that a 64-bit Variable has been split into 2 32-bit | 68 // Ensure that a 64-bit Variable has been split into 2 32-bit |
61 // Variables, creating them if necessary. This is needed for all | 69 // Variables, creating them if necessary. This is needed for all |
62 // I64 operations, and it is needed for pushing F64 arguments for | 70 // I64 operations, and it is needed for pushing F64 arguments for |
63 // function calls using the 32-bit push instruction (though the | 71 // function calls using the 32-bit push instruction (though the |
64 // latter could be done by directly writing to the stack). | 72 // latter could be done by directly writing to the stack). |
65 void split64(Variable *Var); | 73 void split64(Variable *Var); |
66 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, | 74 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 524 |
517 protected: | 525 protected: |
518 explicit TargetDataX8632(GlobalContext *Ctx); | 526 explicit TargetDataX8632(GlobalContext *Ctx); |
519 | 527 |
520 private: | 528 private: |
521 void lowerGlobal(const VariableDeclaration &Var) const; | 529 void lowerGlobal(const VariableDeclaration &Var) const; |
522 ~TargetDataX8632() override {} | 530 ~TargetDataX8632() override {} |
523 template <typename T> static void emitConstantPool(GlobalContext *Ctx); | 531 template <typename T> static void emitConstantPool(GlobalContext *Ctx); |
524 }; | 532 }; |
525 | 533 |
526 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; | |
527 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; | |
528 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | |
529 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | |
530 | |
531 } // end of namespace Ice | 534 } // end of namespace Ice |
532 | 535 |
533 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 536 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |