OLD | NEW |
1 //===- subzero/src/IceInstX8664.cpp - X86-64 instruction implementation ---===// | 1 //===- subzero/src/IceInstX8664.cpp - X86-64 instruction implementation ---===// |
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 } else if (getOffset() == nullptr && Disp != 0) { | 127 } else if (getOffset() == nullptr && Disp != 0) { |
128 Str << Disp; | 128 Str << Disp; |
129 } else if (const auto *CI = llvm::dyn_cast<ConstantInteger32>(Offset)) { | 129 } else if (const auto *CI = llvm::dyn_cast<ConstantInteger32>(Offset)) { |
130 if (Base == nullptr || CI->getValue() || Disp != 0) | 130 if (Base == nullptr || CI->getValue() || Disp != 0) |
131 // Emit a non-zero offset without a leading '$'. | 131 // Emit a non-zero offset without a leading '$'. |
132 Str << CI->getValue() + Disp; | 132 Str << CI->getValue() + Disp; |
133 } else if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) { | 133 } else if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) { |
134 // TODO(sehr): ConstantRelocatable still needs updating for | 134 // TODO(sehr): ConstantRelocatable still needs updating for |
135 // rematerializable base/index and Disp. | 135 // rematerializable base/index and Disp. |
136 assert(Disp == 0); | 136 assert(Disp == 0); |
137 const bool UseNonsfi = Func->getContext()->getFlags().getUseNonsfi(); | 137 const bool UseNonsfi = getFlags().getUseNonsfi(); |
138 CR->emitWithoutPrefix(Target, UseNonsfi ? "@GOTOFF" : ""); | 138 CR->emitWithoutPrefix(Target, UseNonsfi ? "@GOTOFF" : ""); |
139 assert(!UseNonsfi); | 139 assert(!UseNonsfi); |
140 if (Base == nullptr && Index == nullptr) { | 140 if (Base == nullptr && Index == nullptr) { |
141 // rip-relative addressing. | 141 // rip-relative addressing. |
142 if (NeedSandboxing) { | 142 if (NeedSandboxing) { |
143 Str << "(%rip)"; | 143 Str << "(%rip)"; |
144 } else { | 144 } else { |
145 Str << "(%eip)"; | 145 Str << "(%eip)"; |
146 } | 146 } |
147 } | 147 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 Var->dump(Func); | 353 Var->dump(Func); |
354 else | 354 else |
355 Var->dump(Str); | 355 Var->dump(Str); |
356 Str << ")"; | 356 Str << ")"; |
357 } | 357 } |
358 | 358 |
359 } // namespace X8664 | 359 } // namespace X8664 |
360 } // end of namespace Ice | 360 } // end of namespace Ice |
361 | 361 |
362 X86INSTS_DEFINE_STATIC_DATA(X8664, X8664::Traits) | 362 X86INSTS_DEFINE_STATIC_DATA(X8664, X8664::Traits) |
OLD | NEW |