OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 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 /// \file | 10 /// \file |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const override { | 76 const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const override { |
77 return TypeToRegisterSet[Ty]; | 77 return TypeToRegisterSet[Ty]; |
78 } | 78 } |
79 | 79 |
80 const llvm::SmallBitVector &getAliasesForRegister(SizeT Reg) const override { | 80 const llvm::SmallBitVector &getAliasesForRegister(SizeT Reg) const override { |
81 assert(Reg < Traits::RegisterSet::Reg_NUM); | 81 assert(Reg < Traits::RegisterSet::Reg_NUM); |
82 return RegisterAliases[Reg]; | 82 return RegisterAliases[Reg]; |
83 } | 83 } |
84 | 84 |
85 bool hasFramePointer() const override { return IsEbpBasedFrame; } | 85 bool hasFramePointer() const override { return IsEbpBasedFrame; } |
| 86 void setHasFramePointer() override { IsEbpBasedFrame = true; } |
86 SizeT getStackReg() const override { return Traits::RegisterSet::Reg_esp; } | 87 SizeT getStackReg() const override { return Traits::RegisterSet::Reg_esp; } |
87 SizeT getFrameOrStackReg() const override { | 88 SizeT getFrameOrStackReg() const override { |
88 return IsEbpBasedFrame ? Traits::RegisterSet::Reg_ebp | 89 return IsEbpBasedFrame ? Traits::RegisterSet::Reg_ebp |
89 : Traits::RegisterSet::Reg_esp; | 90 : Traits::RegisterSet::Reg_esp; |
90 } | 91 } |
91 size_t typeWidthInBytesOnStack(Type Ty) const override { | 92 size_t typeWidthInBytesOnStack(Type Ty) const override { |
92 // Round up to the next multiple of WordType bytes. | 93 // Round up to the next multiple of WordType bytes. |
93 const uint32_t WordSizeInBytes = typeWidthInBytes(Traits::WordType); | 94 const uint32_t WordSizeInBytes = typeWidthInBytes(Traits::WordType); |
94 return Utils::applyAlignment(typeWidthInBytes(Ty), WordSizeInBytes); | 95 return Utils::applyAlignment(typeWidthInBytes(Ty), WordSizeInBytes); |
95 } | 96 } |
| 97 uint32_t getStackAlignment() const override { |
| 98 return Traits::X86_STACK_ALIGNMENT_BYTES; |
| 99 } |
96 | 100 |
97 bool shouldSplitToVariable64On32(Type Ty) const override { | 101 bool shouldSplitToVariable64On32(Type Ty) const override { |
98 return Traits::Is64Bit ? false : Ty == IceType_i64; | 102 return Traits::Is64Bit ? false : Ty == IceType_i64; |
99 } | 103 } |
100 | 104 |
101 SizeT getMinJumpTableSize() const override { return 4; } | 105 SizeT getMinJumpTableSize() const override { return 4; } |
102 | 106 |
103 void emitVariable(const Variable *Var) const override; | 107 void emitVariable(const Variable *Var) const override; |
104 | 108 |
105 const char *getConstantPrefix() const final { return "$"; } | 109 const char *getConstantPrefix() const final { return "$"; } |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 lowerIcmp64(const InstIcmp *Icmp, const InstBr *Br); | 740 lowerIcmp64(const InstIcmp *Icmp, const InstBr *Br); |
737 | 741 |
738 BoolFolding FoldingInfo; | 742 BoolFolding FoldingInfo; |
739 }; | 743 }; |
740 } // end of namespace X86Internal | 744 } // end of namespace X86Internal |
741 } // end of namespace Ice | 745 } // end of namespace Ice |
742 | 746 |
743 #include "IceTargetLoweringX86BaseImpl.h" | 747 #include "IceTargetLoweringX86BaseImpl.h" |
744 | 748 |
745 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H | 749 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H |
OLD | NEW |