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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 249 } |
249 void _shr(Variable *Dest, Operand *Src0) { | 250 void _shr(Variable *Dest, Operand *Src0) { |
250 Context.insert(InstX8632Shr::create(Func, Dest, Src0)); | 251 Context.insert(InstX8632Shr::create(Func, Dest, Src0)); |
251 } | 252 } |
252 void _shrd(Variable *Dest, Variable *Src0, Variable *Src1) { | 253 void _shrd(Variable *Dest, Variable *Src0, Variable *Src1) { |
253 Context.insert(InstX8632Shrd::create(Func, Dest, Src0, Src1)); | 254 Context.insert(InstX8632Shrd::create(Func, Dest, Src0, Src1)); |
254 } | 255 } |
255 void _store(Operand *Value, OperandX8632 *Mem) { | 256 void _store(Operand *Value, OperandX8632 *Mem) { |
256 Context.insert(InstX8632Store::create(Func, Value, Mem)); | 257 Context.insert(InstX8632Store::create(Func, Value, Mem)); |
257 } | 258 } |
| 259 void _storep(Operand *Value, OperandX8632 *Mem) { |
| 260 Context.insert(InstX8632Storep::create(Func, Value, Mem)); |
| 261 } |
258 void _storeq(Operand *Value, OperandX8632 *Mem) { | 262 void _storeq(Operand *Value, OperandX8632 *Mem) { |
259 Context.insert(InstX8632StoreQ::create(Func, Value, Mem)); | 263 Context.insert(InstX8632StoreQ::create(Func, Value, Mem)); |
260 } | 264 } |
261 void _sub(Variable *Dest, Operand *Src0) { | 265 void _sub(Variable *Dest, Operand *Src0) { |
262 Context.insert(InstX8632Sub::create(Func, Dest, Src0)); | 266 Context.insert(InstX8632Sub::create(Func, Dest, Src0)); |
263 } | 267 } |
264 void _subss(Variable *Dest, Operand *Src0) { | 268 void _subss(Variable *Dest, Operand *Src0) { |
265 Context.insert(InstX8632Subss::create(Func, Dest, Src0)); | 269 Context.insert(InstX8632Subss::create(Func, Dest, Src0)); |
266 } | 270 } |
267 void _test(Operand *Src0, Operand *Src1) { | 271 void _test(Operand *Src0, Operand *Src1) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 virtual ~TargetGlobalInitX8632() {} | 325 virtual ~TargetGlobalInitX8632() {} |
322 }; | 326 }; |
323 | 327 |
324 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 328 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
325 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 329 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
326 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 330 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
327 | 331 |
328 } // end of namespace Ice | 332 } // end of namespace Ice |
329 | 333 |
330 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 334 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |