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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 | 190 |
191 explicit TargetX86Base(Cfg *Func); | 191 explicit TargetX86Base(Cfg *Func); |
192 | 192 |
193 void postLower() override; | 193 void postLower() override; |
194 | 194 |
195 void initSandbox() { | 195 void initSandbox() { |
196 dispatchToConcrete(&Traits::ConcreteTarget::initSandbox); | 196 dispatchToConcrete(&Traits::ConcreteTarget::initSandbox); |
197 } | 197 } |
198 | 198 |
199 void lowerAlloca(const InstAlloca *Inst) override; | 199 void lowerAlloca(const InstAlloca *Inst) override; |
200 void lowerArguments() override; | |
200 void lowerArithmetic(const InstArithmetic *Inst) override; | 201 void lowerArithmetic(const InstArithmetic *Inst) override; |
201 void lowerAssign(const InstAssign *Inst) override; | 202 void lowerAssign(const InstAssign *Inst) override; |
202 void lowerBr(const InstBr *Inst) override; | 203 void lowerBr(const InstBr *Inst) override; |
204 void lowerCall(const InstCall *Inst) override; | |
203 void lowerCast(const InstCast *Inst) override; | 205 void lowerCast(const InstCast *Inst) override; |
204 void lowerExtractElement(const InstExtractElement *Inst) override; | 206 void lowerExtractElement(const InstExtractElement *Inst) override; |
205 void lowerFcmp(const InstFcmp *Inst) override; | 207 void lowerFcmp(const InstFcmp *Inst) override; |
206 void lowerIcmp(const InstIcmp *Inst) override; | 208 void lowerIcmp(const InstIcmp *Inst) override; |
207 | 209 |
208 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; | 210 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; |
209 void lowerInsertElement(const InstInsertElement *Inst) override; | 211 void lowerInsertElement(const InstInsertElement *Inst) override; |
210 void lowerLoad(const InstLoad *Inst) override; | 212 void lowerLoad(const InstLoad *Inst) override; |
211 void lowerPhi(const InstPhi *Inst) override; | 213 void lowerPhi(const InstPhi *Inst) override; |
214 void lowerRet(const InstRet *Inst) override; | |
212 void lowerSelect(const InstSelect *Inst) override; | 215 void lowerSelect(const InstSelect *Inst) override; |
213 void lowerStore(const InstStore *Inst) override; | 216 void lowerStore(const InstStore *Inst) override; |
214 void lowerSwitch(const InstSwitch *Inst) override; | 217 void lowerSwitch(const InstSwitch *Inst) override; |
215 void lowerUnreachable(const InstUnreachable *Inst) override; | 218 void lowerUnreachable(const InstUnreachable *Inst) override; |
216 void lowerOther(const Inst *Instr) override; | 219 void lowerOther(const Inst *Instr) override; |
217 void lowerRMW(const InstX86FakeRMW *RMW); | 220 void lowerRMW(const InstX86FakeRMW *RMW); |
218 void prelowerPhis() override; | 221 void prelowerPhis() override; |
219 uint32_t getCallStackArgumentsSizeBytes(const std::vector<Type> &ArgTypes, | 222 uint32_t getCallStackArgumentsSizeBytes(const std::vector<Type> &ArgTypes, |
220 Type ReturnType); | 223 Type ReturnType); |
221 uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) override; | 224 uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) override; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 | 275 |
273 using LowerBinOp = void (TargetX86Base::*)(Variable *, Operand *); | 276 using LowerBinOp = void (TargetX86Base::*)(Variable *, Operand *); |
274 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, | 277 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, |
275 Variable *Dest, Operand *Ptr, Operand *Val); | 278 Variable *Dest, Operand *Ptr, Operand *Val); |
276 | 279 |
277 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); | 280 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); |
278 | 281 |
279 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, | 282 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, |
280 Operand *Src0, Operand *Src1); | 283 Operand *Src0, Operand *Src1); |
281 | 284 |
285 /// Emit just the call instruction (without argument or return variable | |
286 /// processing), sandboxing if needed. | |
287 virtual Inst *emitCallToTarget(Operand *CallTarget, Variable *ReturnReg) = 0; | |
288 /// Materialize the moves needed to return a value of the specified type. | |
289 virtual Variable *moveReturnValueToRegister(Operand *Value, | |
290 const Type ReturnType) = 0; | |
Jim Stichnoth
2016/01/19 20:54:05
I find it a bit odd/unusual to declare a scalar pa
sehr
2016/01/19 21:47:35
Done.
| |
291 | |
282 /// Emit a fake use of esp to make sure esp stays alive for the entire | 292 /// Emit a fake use of esp to make sure esp stays alive for the entire |
283 /// function. Otherwise some esp adjustments get dead-code eliminated. | 293 /// function. Otherwise some esp adjustments get dead-code eliminated. |
284 void keepEspLiveAtExit() { | 294 void keepEspLiveAtExit() { |
285 Variable *esp = | 295 Variable *esp = |
286 Func->getTarget()->getPhysicalRegister(getStackReg(), Traits::WordType); | 296 Func->getTarget()->getPhysicalRegister(getStackReg(), Traits::WordType); |
287 Context.insert<InstFakeUse>(esp); | 297 Context.insert<InstFakeUse>(esp); |
288 } | 298 } |
289 | 299 |
290 /// Operand legalization helpers. To deal with address mode constraints, the | 300 /// Operand legalization helpers. To deal with address mode constraints, the |
291 /// helpers will create a new Operand and emit instructions that guarantee | 301 /// helpers will create a new Operand and emit instructions that guarantee |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 | 1006 |
997 static FixupKind PcRelFixup; | 1007 static FixupKind PcRelFixup; |
998 static FixupKind AbsFixup; | 1008 static FixupKind AbsFixup; |
999 }; | 1009 }; |
1000 } // end of namespace X86NAMESPACE | 1010 } // end of namespace X86NAMESPACE |
1001 } // end of namespace Ice | 1011 } // end of namespace Ice |
1002 | 1012 |
1003 #include "IceTargetLoweringX86BaseImpl.h" | 1013 #include "IceTargetLoweringX86BaseImpl.h" |
1004 | 1014 |
1005 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H | 1015 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H |
OLD | NEW |