| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 virtual void postLower(); | 76 virtual void postLower(); |
| 77 | 77 |
| 78 virtual void lowerAlloca(const InstAlloca *Inst); | 78 virtual void lowerAlloca(const InstAlloca *Inst); |
| 79 virtual void lowerArithmetic(const InstArithmetic *Inst); | 79 virtual void lowerArithmetic(const InstArithmetic *Inst); |
| 80 virtual void lowerAssign(const InstAssign *Inst); | 80 virtual void lowerAssign(const InstAssign *Inst); |
| 81 virtual void lowerBr(const InstBr *Inst); | 81 virtual void lowerBr(const InstBr *Inst); |
| 82 virtual void lowerCall(const InstCall *Inst); | 82 virtual void lowerCall(const InstCall *Inst); |
| 83 virtual void lowerCast(const InstCast *Inst); | 83 virtual void lowerCast(const InstCast *Inst); |
| 84 virtual void lowerFcmp(const InstFcmp *Inst); | 84 virtual void lowerFcmp(const InstFcmp *Inst); |
| 85 virtual void lowerIcmp(const InstIcmp *Inst); | 85 virtual void lowerIcmp(const InstIcmp *Inst); |
| 86 virtual void lowerIntrinsicCall(const InstIntrinsicCall *Inst); |
| 86 virtual void lowerLoad(const InstLoad *Inst); | 87 virtual void lowerLoad(const InstLoad *Inst); |
| 87 virtual void lowerPhi(const InstPhi *Inst); | 88 virtual void lowerPhi(const InstPhi *Inst); |
| 88 virtual void lowerRet(const InstRet *Inst); | 89 virtual void lowerRet(const InstRet *Inst); |
| 89 virtual void lowerSelect(const InstSelect *Inst); | 90 virtual void lowerSelect(const InstSelect *Inst); |
| 90 virtual void lowerStore(const InstStore *Inst); | 91 virtual void lowerStore(const InstStore *Inst); |
| 91 virtual void lowerSwitch(const InstSwitch *Inst); | 92 virtual void lowerSwitch(const InstSwitch *Inst); |
| 92 virtual void lowerUnreachable(const InstUnreachable *Inst); | 93 virtual void lowerUnreachable(const InstUnreachable *Inst); |
| 93 virtual void doAddressOptLoad(); | 94 virtual void doAddressOptLoad(); |
| 94 virtual void doAddressOptStore(); | 95 virtual void doAddressOptStore(); |
| 95 | 96 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 116 | 117 |
| 117 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); | 118 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 118 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, | 119 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, |
| 119 SizeT MaxSrcs) { | 120 SizeT MaxSrcs) { |
| 120 bool SuppressMangling = true; | 121 bool SuppressMangling = true; |
| 121 Type Ty = Dest ? Dest->getType() : IceType_void; | 122 Type Ty = Dest ? Dest->getType() : IceType_void; |
| 122 Constant *CallTarget = Ctx->getConstantSym(Ty, 0, Name, SuppressMangling); | 123 Constant *CallTarget = Ctx->getConstantSym(Ty, 0, Name, SuppressMangling); |
| 123 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); | 124 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); |
| 124 return Call; | 125 return Call; |
| 125 } | 126 } |
| 127 static Type stackSlotType(); |
| 126 | 128 |
| 127 // The following are helpers that insert lowered x86 instructions | 129 // The following are helpers that insert lowered x86 instructions |
| 128 // with minimal syntactic overhead, so that the lowering code can | 130 // with minimal syntactic overhead, so that the lowering code can |
| 129 // look as close to assembly as practical. | 131 // look as close to assembly as practical. |
| 130 void _adc(Variable *Dest, Operand *Src0) { | 132 void _adc(Variable *Dest, Operand *Src0) { |
| 131 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); | 133 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); |
| 132 } | 134 } |
| 133 void _add(Variable *Dest, Operand *Src0) { | 135 void _add(Variable *Dest, Operand *Src0) { |
| 134 Context.insert(InstX8632Add::create(Func, Dest, Src0)); | 136 Context.insert(InstX8632Add::create(Func, Dest, Src0)); |
| 135 } | 137 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 241 } |
| 240 void _subss(Variable *Dest, Operand *Src0) { | 242 void _subss(Variable *Dest, Operand *Src0) { |
| 241 Context.insert(InstX8632Subss::create(Func, Dest, Src0)); | 243 Context.insert(InstX8632Subss::create(Func, Dest, Src0)); |
| 242 } | 244 } |
| 243 void _test(Operand *Src0, Operand *Src1) { | 245 void _test(Operand *Src0, Operand *Src1) { |
| 244 Context.insert(InstX8632Test::create(Func, Src0, Src1)); | 246 Context.insert(InstX8632Test::create(Func, Src0, Src1)); |
| 245 } | 247 } |
| 246 void _ucomiss(Operand *Src0, Operand *Src1) { | 248 void _ucomiss(Operand *Src0, Operand *Src1) { |
| 247 Context.insert(InstX8632Ucomiss::create(Func, Src0, Src1)); | 249 Context.insert(InstX8632Ucomiss::create(Func, Src0, Src1)); |
| 248 } | 250 } |
| 251 void _ud2() { Context.insert(InstX8632UD2::create(Func)); } |
| 249 void _xor(Variable *Dest, Operand *Src0) { | 252 void _xor(Variable *Dest, Operand *Src0) { |
| 250 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); | 253 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); |
| 251 } | 254 } |
| 252 | 255 |
| 253 bool IsEbpBasedFrame; | 256 bool IsEbpBasedFrame; |
| 254 size_t FrameSizeLocals; | 257 size_t FrameSizeLocals; |
| 255 size_t LocalsSizeBytes; | 258 size_t LocalsSizeBytes; |
| 256 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 259 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
| 257 llvm::SmallBitVector ScratchRegs; | 260 llvm::SmallBitVector ScratchRegs; |
| 258 llvm::SmallBitVector RegsUsed; | 261 llvm::SmallBitVector RegsUsed; |
| 259 SizeT NextLabelNumber; | 262 SizeT NextLabelNumber; |
| 260 bool ComputedLiveRanges; | 263 bool ComputedLiveRanges; |
| 261 VarList PhysicalRegisters; | 264 VarList PhysicalRegisters; |
| 262 static IceString RegNames[]; | 265 static IceString RegNames[]; |
| 263 | 266 |
| 264 private: | 267 private: |
| 265 TargetX8632(const TargetX8632 &) LLVM_DELETED_FUNCTION; | 268 TargetX8632(const TargetX8632 &) LLVM_DELETED_FUNCTION; |
| 266 TargetX8632 &operator=(const TargetX8632 &) LLVM_DELETED_FUNCTION; | 269 TargetX8632 &operator=(const TargetX8632 &) LLVM_DELETED_FUNCTION; |
| 267 virtual ~TargetX8632() {} | 270 virtual ~TargetX8632() {} |
| 268 template <typename T> void emitConstantPool() const; | 271 template <typename T> void emitConstantPool() const; |
| 269 }; | 272 }; |
| 270 | 273 |
| 271 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 274 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 272 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 275 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
| 273 | 276 |
| 274 } // end of namespace Ice | 277 } // end of namespace Ice |
| 275 | 278 |
| 276 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 279 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| OLD | NEW |