| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 using SegmentRegisters = typename Traits::X86OperandMem::SegmentRegisters; | 72 using SegmentRegisters = typename Traits::X86OperandMem::SegmentRegisters; |
| 73 using SpillVariable = typename Traits::SpillVariable; | 73 using SpillVariable = typename Traits::SpillVariable; |
| 74 | 74 |
| 75 using InstX86Br = typename Traits::Insts::Br; | 75 using InstX86Br = typename Traits::Insts::Br; |
| 76 using InstX86FakeRMW = typename Traits::Insts::FakeRMW; | 76 using InstX86FakeRMW = typename Traits::Insts::FakeRMW; |
| 77 using InstX86Label = typename Traits::Insts::Label; | 77 using InstX86Label = typename Traits::Insts::Label; |
| 78 | 78 |
| 79 ~TargetX86Base() override = default; | 79 ~TargetX86Base() override = default; |
| 80 | 80 |
| 81 static void staticInit(GlobalContext *Ctx); | 81 static void staticInit(GlobalContext *Ctx); |
| 82 static TargetX86Base *create(Cfg *Func) { return new TargetX86Base(Func); } | |
| 83 std::unique_ptr<::Ice::Assembler> createAssembler() const override { | |
| 84 return nullptr; | |
| 85 } | |
| 86 | 82 |
| 87 static FixupKind getPcRelFixup() { return PcRelFixup; } | 83 static FixupKind getPcRelFixup() { return PcRelFixup; } |
| 88 static FixupKind getAbsFixup() { return AbsFixup; } | 84 static FixupKind getAbsFixup() { return AbsFixup; } |
| 89 | 85 |
| 90 bool needSandboxing() const { return NeedSandboxing; } | 86 bool needSandboxing() const { return NeedSandboxing; } |
| 91 | 87 |
| 92 void translateOm1() override; | 88 void translateOm1() override; |
| 93 void translateO2() override; | 89 void translateO2() override; |
| 94 void doLoadOpt(); | 90 void doLoadOpt(); |
| 95 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; | 91 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 345 |
| 350 void emitGetIP(CfgNode *Node) { | 346 void emitGetIP(CfgNode *Node) { |
| 351 dispatchToConcrete(&Traits::ConcreteTarget::emitGetIP, std::move(Node)); | 347 dispatchToConcrete(&Traits::ConcreteTarget::emitGetIP, std::move(Node)); |
| 352 } | 348 } |
| 353 /// Emit a sandboxed return sequence rather than a return. | 349 /// Emit a sandboxed return sequence rather than a return. |
| 354 void emitSandboxedReturn() { | 350 void emitSandboxedReturn() { |
| 355 dispatchToConcrete(&Traits::ConcreteTarget::emitSandboxedReturn); | 351 dispatchToConcrete(&Traits::ConcreteTarget::emitSandboxedReturn); |
| 356 } | 352 } |
| 357 /// Emit just the call instruction (without argument or return variable | 353 /// Emit just the call instruction (without argument or return variable |
| 358 /// processing), sandboxing if needed. | 354 /// processing), sandboxing if needed. |
| 359 virtual Inst *emitCallToTarget(Operand *CallTarget, Variable *ReturnReg) { | 355 virtual Inst *emitCallToTarget(Operand *CallTarget, Variable *ReturnReg) = 0; |
| 360 (void)CallTarget; | |
| 361 (void)ReturnReg; | |
| 362 return nullptr; | |
| 363 } | |
| 364 /// Materialize the moves needed to return a value of the specified type. | 356 /// Materialize the moves needed to return a value of the specified type. |
| 365 virtual Variable *moveReturnValueToRegister(Operand *Value, Type ReturnType) { | 357 virtual Variable *moveReturnValueToRegister(Operand *Value, |
| 366 (void)Value; | 358 Type ReturnType) = 0; |
| 367 (void)ReturnType; | |
| 368 return nullptr; | |
| 369 } | |
| 370 | 359 |
| 371 /// Emit a jump table to the constant pool. | 360 /// Emit a jump table to the constant pool. |
| 372 void emitJumpTable(const Cfg *Func, | 361 void emitJumpTable(const Cfg *Func, |
| 373 const InstJumpTable *JumpTable) const override; | 362 const InstJumpTable *JumpTable) const override; |
| 374 | 363 |
| 375 /// Emit a fake use of esp to make sure esp stays alive for the entire | 364 /// Emit a fake use of esp to make sure esp stays alive for the entire |
| 376 /// function. Otherwise some esp adjustments get dead-code eliminated. | 365 /// function. Otherwise some esp adjustments get dead-code eliminated. |
| 377 void keepEspLiveAtExit() { | 366 void keepEspLiveAtExit() { |
| 378 Variable *esp = | 367 Variable *esp = |
| 379 Func->getTarget()->getPhysicalRegister(getStackReg(), Traits::WordType); | 368 Func->getTarget()->getPhysicalRegister(getStackReg(), Traits::WordType); |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 | 1120 |
| 1132 explicit TargetHeaderX86(GlobalContext *Ctx) : TargetHeaderLowering(Ctx) {} | 1121 explicit TargetHeaderX86(GlobalContext *Ctx) : TargetHeaderLowering(Ctx) {} |
| 1133 }; | 1122 }; |
| 1134 | 1123 |
| 1135 } // end of namespace X86NAMESPACE | 1124 } // end of namespace X86NAMESPACE |
| 1136 } // end of namespace Ice | 1125 } // end of namespace Ice |
| 1137 | 1126 |
| 1138 #include "IceTargetLoweringX86BaseImpl.h" | 1127 #include "IceTargetLoweringX86BaseImpl.h" |
| 1139 | 1128 |
| 1140 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H | 1129 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H |
| OLD | NEW |