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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 enum Registers { | 64 enum Registers { |
65 #define X(val, init, name, name16, name8, scratch, preserved, stackptr, \ | 65 #define X(val, init, name, name16, name8, scratch, preserved, stackptr, \ |
66 frameptr, isI8, isInt, isFP) \ | 66 frameptr, isI8, isInt, isFP) \ |
67 val init, | 67 val init, |
68 REGX8632_TABLE | 68 REGX8632_TABLE |
69 #undef X | 69 #undef X |
70 Reg_NUM | 70 Reg_NUM |
71 }; | 71 }; |
72 | 72 |
| 73 enum SegmentRegisters { |
| 74 #define X(val, name) \ |
| 75 val, |
| 76 SEG_REGX8632_TABLE |
| 77 #undef X |
| 78 SegReg_NUM |
| 79 }; |
| 80 |
73 protected: | 81 protected: |
74 TargetX8632(Cfg *Func); | 82 TargetX8632(Cfg *Func); |
75 | 83 |
76 virtual void postLower(); | 84 virtual void postLower(); |
77 | 85 |
78 virtual void lowerAlloca(const InstAlloca *Inst); | 86 virtual void lowerAlloca(const InstAlloca *Inst); |
79 virtual void lowerArithmetic(const InstArithmetic *Inst); | 87 virtual void lowerArithmetic(const InstArithmetic *Inst); |
80 virtual void lowerAssign(const InstAssign *Inst); | 88 virtual void lowerAssign(const InstAssign *Inst); |
81 virtual void lowerBr(const InstBr *Inst); | 89 virtual void lowerBr(const InstBr *Inst); |
82 virtual void lowerCall(const InstCall *Inst); | 90 virtual void lowerCall(const InstCall *Inst); |
83 virtual void lowerCast(const InstCast *Inst); | 91 virtual void lowerCast(const InstCast *Inst); |
84 virtual void lowerFcmp(const InstFcmp *Inst); | 92 virtual void lowerFcmp(const InstFcmp *Inst); |
85 virtual void lowerIcmp(const InstIcmp *Inst); | 93 virtual void lowerIcmp(const InstIcmp *Inst); |
| 94 virtual void lowerIntrinsicCall(const InstIntrinsicCall *Inst); |
86 virtual void lowerLoad(const InstLoad *Inst); | 95 virtual void lowerLoad(const InstLoad *Inst); |
87 virtual void lowerPhi(const InstPhi *Inst); | 96 virtual void lowerPhi(const InstPhi *Inst); |
88 virtual void lowerRet(const InstRet *Inst); | 97 virtual void lowerRet(const InstRet *Inst); |
89 virtual void lowerSelect(const InstSelect *Inst); | 98 virtual void lowerSelect(const InstSelect *Inst); |
90 virtual void lowerStore(const InstStore *Inst); | 99 virtual void lowerStore(const InstStore *Inst); |
91 virtual void lowerSwitch(const InstSwitch *Inst); | 100 virtual void lowerSwitch(const InstSwitch *Inst); |
92 virtual void lowerUnreachable(const InstUnreachable *Inst); | 101 virtual void lowerUnreachable(const InstUnreachable *Inst); |
93 virtual void doAddressOptLoad(); | 102 virtual void doAddressOptLoad(); |
94 virtual void doAddressOptStore(); | 103 virtual void doAddressOptStore(); |
95 | 104 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 248 } |
240 void _subss(Variable *Dest, Operand *Src0) { | 249 void _subss(Variable *Dest, Operand *Src0) { |
241 Context.insert(InstX8632Subss::create(Func, Dest, Src0)); | 250 Context.insert(InstX8632Subss::create(Func, Dest, Src0)); |
242 } | 251 } |
243 void _test(Operand *Src0, Operand *Src1) { | 252 void _test(Operand *Src0, Operand *Src1) { |
244 Context.insert(InstX8632Test::create(Func, Src0, Src1)); | 253 Context.insert(InstX8632Test::create(Func, Src0, Src1)); |
245 } | 254 } |
246 void _ucomiss(Operand *Src0, Operand *Src1) { | 255 void _ucomiss(Operand *Src0, Operand *Src1) { |
247 Context.insert(InstX8632Ucomiss::create(Func, Src0, Src1)); | 256 Context.insert(InstX8632Ucomiss::create(Func, Src0, Src1)); |
248 } | 257 } |
| 258 void _ud2() { |
| 259 Context.insert(InstX8632UD2::create(Func)); |
| 260 } |
249 void _xor(Variable *Dest, Operand *Src0) { | 261 void _xor(Variable *Dest, Operand *Src0) { |
250 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); | 262 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); |
251 } | 263 } |
252 | 264 |
253 bool IsEbpBasedFrame; | 265 bool IsEbpBasedFrame; |
254 size_t FrameSizeLocals; | 266 size_t FrameSizeLocals; |
255 size_t LocalsSizeBytes; | 267 size_t LocalsSizeBytes; |
256 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 268 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
257 llvm::SmallBitVector ScratchRegs; | 269 llvm::SmallBitVector ScratchRegs; |
258 llvm::SmallBitVector RegsUsed; | 270 llvm::SmallBitVector RegsUsed; |
259 SizeT NextLabelNumber; | 271 SizeT NextLabelNumber; |
260 bool ComputedLiveRanges; | 272 bool ComputedLiveRanges; |
261 VarList PhysicalRegisters; | 273 VarList PhysicalRegisters; |
262 static IceString RegNames[]; | 274 static IceString RegNames[]; |
263 | 275 |
264 private: | 276 private: |
265 TargetX8632(const TargetX8632 &) LLVM_DELETED_FUNCTION; | 277 TargetX8632(const TargetX8632 &) LLVM_DELETED_FUNCTION; |
266 TargetX8632 &operator=(const TargetX8632 &) LLVM_DELETED_FUNCTION; | 278 TargetX8632 &operator=(const TargetX8632 &) LLVM_DELETED_FUNCTION; |
267 virtual ~TargetX8632() {} | 279 virtual ~TargetX8632() {} |
268 template <typename T> void emitConstantPool() const; | 280 template <typename T> void emitConstantPool() const; |
269 }; | 281 }; |
270 | 282 |
271 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 283 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
272 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 284 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
273 | 285 |
274 } // end of namespace Ice | 286 } // end of namespace Ice |
275 | 287 |
276 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 288 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |