| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===// |
| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 #undef X | 96 #undef X |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 const size_t TargetX8664Traits::TableTypeX8664AttributesSize = | 99 const size_t TargetX8664Traits::TableTypeX8664AttributesSize = |
| 100 llvm::array_lengthof(TableTypeX8664Attributes); | 100 llvm::array_lengthof(TableTypeX8664Attributes); |
| 101 | 101 |
| 102 const uint32_t TargetX8664Traits::X86_STACK_ALIGNMENT_BYTES = 16; | 102 const uint32_t TargetX8664Traits::X86_STACK_ALIGNMENT_BYTES = 16; |
| 103 const char *TargetX8664Traits::TargetName = "X8664"; | 103 const char *TargetX8664Traits::TargetName = "X8664"; |
| 104 | 104 |
| 105 template <> | 105 template <> |
| 106 std::array<llvm::SmallBitVector, RCX86_NUM> | 106 std::array<SmallBitVector, RCX86_NUM> |
| 107 TargetX86Base<X8664::Traits>::TypeToRegisterSet = {{}}; | 107 TargetX86Base<X8664::Traits>::TypeToRegisterSet = {{}}; |
| 108 | 108 |
| 109 template <> | 109 template <> |
| 110 std::array<llvm::SmallBitVector, RCX86_NUM> | 110 std::array<SmallBitVector, RCX86_NUM> |
| 111 TargetX86Base<X8664::Traits>::TypeToRegisterSetUnfiltered = {{}}; | 111 TargetX86Base<X8664::Traits>::TypeToRegisterSetUnfiltered = {{}}; |
| 112 | 112 |
| 113 template <> | 113 template <> |
| 114 std::array<llvm::SmallBitVector, | 114 std::array<SmallBitVector, |
| 115 TargetX86Base<X8664::Traits>::Traits::RegisterSet::Reg_NUM> | 115 TargetX86Base<X8664::Traits>::Traits::RegisterSet::Reg_NUM> |
| 116 TargetX86Base<X8664::Traits>::RegisterAliases = {{}}; | 116 TargetX86Base<X8664::Traits>::RegisterAliases = {{}}; |
| 117 | 117 |
| 118 template <> | 118 template <> |
| 119 FixupKind TargetX86Base<X8664::Traits>::PcRelFixup = | 119 FixupKind TargetX86Base<X8664::Traits>::PcRelFixup = |
| 120 TargetX86Base<X8664::Traits>::Traits::FK_PcRel; | 120 TargetX86Base<X8664::Traits>::Traits::FK_PcRel; |
| 121 | 121 |
| 122 template <> | 122 template <> |
| 123 FixupKind TargetX86Base<X8664::Traits>::AbsFixup = | 123 FixupKind TargetX86Base<X8664::Traits>::AbsFixup = |
| 124 TargetX86Base<X8664::Traits>::Traits::FK_Abs; | 124 TargetX86Base<X8664::Traits>::Traits::FK_Abs; |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 // | 619 // |
| 620 // ReturnReloc has an offset that is only known during binary emission. | 620 // ReturnReloc has an offset that is only known during binary emission. |
| 621 // Therefore, we set a custom emit string for ReturnReloc that will be | 621 // Therefore, we set a custom emit string for ReturnReloc that will be |
| 622 // used instead. In this particular case, the code will be emitted as | 622 // used instead. In this particular case, the code will be emitted as |
| 623 // | 623 // |
| 624 // push .after_call | 624 // push .after_call |
| 625 InstX86Label *ReturnAddress = InstX86Label::create(Func, this); | 625 InstX86Label *ReturnAddress = InstX86Label::create(Func, this); |
| 626 auto *ReturnRelocOffset = RelocOffset::create(Ctx); | 626 auto *ReturnRelocOffset = RelocOffset::create(Ctx); |
| 627 ReturnAddress->setRelocOffset(ReturnRelocOffset); | 627 ReturnAddress->setRelocOffset(ReturnRelocOffset); |
| 628 constexpr bool SuppressMangling = true; | 628 constexpr bool SuppressMangling = true; |
| 629 constexpr RelocOffsetT NoFixedOffset = 0; |
| 629 const IceString EmitString = ReturnAddress->getName(Func); | 630 const IceString EmitString = ReturnAddress->getName(Func); |
| 630 auto *ReturnReloc = llvm::cast<ConstantRelocatable>(Ctx->getConstantSym( | 631 auto *ReturnReloc = llvm::cast<ConstantRelocatable>( |
| 631 {ReturnRelocOffset}, Ctx->mangleName(Func->getFunctionName()), | 632 Ctx->getConstantSym(NoFixedOffset, {ReturnRelocOffset}, |
| 632 EmitString, SuppressMangling)); | 633 Ctx->mangleName(Func->getFunctionName()), |
| 634 EmitString, SuppressMangling)); |
| 633 /* AutoBundle scoping */ { | 635 /* AutoBundle scoping */ { |
| 634 std::unique_ptr<AutoBundle> Bundler; | 636 std::unique_ptr<AutoBundle> Bundler; |
| 635 if (CallTargetR == nullptr) { | 637 if (CallTargetR == nullptr) { |
| 636 Bundler = makeUnique<AutoBundle>(this, InstBundleLock::Opt_PadToEnd); | 638 Bundler = makeUnique<AutoBundle>(this, InstBundleLock::Opt_PadToEnd); |
| 637 _push(ReturnReloc); | 639 _push(ReturnReloc); |
| 638 } else { | 640 } else { |
| 639 Variable *T = makeReg(IceType_i32); | 641 Variable *T = makeReg(IceType_i32); |
| 640 Variable *T64 = makeReg(IceType_i64); | 642 Variable *T64 = makeReg(IceType_i64); |
| 641 Variable *r15 = | 643 Variable *r15 = |
| 642 getPhysicalRegister(Traits::RegisterSet::Reg_r15, IceType_i64); | 644 getPhysicalRegister(Traits::RegisterSet::Reg_r15, IceType_i64); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \ | 807 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \ |
| 806 static_assert(_table1_##tag == _table2_##tag, \ | 808 static_assert(_table1_##tag == _table2_##tag, \ |
| 807 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); | 809 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); |
| 808 ICETYPE_TABLE | 810 ICETYPE_TABLE |
| 809 #undef X | 811 #undef X |
| 810 } // end of namespace dummy3 | 812 } // end of namespace dummy3 |
| 811 } // end of anonymous namespace | 813 } // end of anonymous namespace |
| 812 | 814 |
| 813 } // end of namespace X8664 | 815 } // end of namespace X8664 |
| 814 } // end of namespace Ice | 816 } // end of namespace Ice |
| OLD | NEW |