| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 | 155 |
| 156 Str << "("; | 156 Str << "("; |
| 157 if (Base != nullptr) { | 157 if (Base != nullptr) { |
| 158 const Variable *B = Base; | 158 const Variable *B = Base; |
| 159 if (!NeedSandboxing) { | 159 if (!NeedSandboxing) { |
| 160 // TODO(jpp): stop abusing the operand's type to identify LEAs. | 160 // TODO(jpp): stop abusing the operand's type to identify LEAs. |
| 161 const Type MemType = getType(); | 161 const Type MemType = getType(); |
| 162 if (Base->getType() != IceType_i32 && MemType != IceType_void) { | 162 if (Base->getType() != IceType_i32 && MemType != IceType_void) { |
| 163 // X86-64 is ILP32, but %rsp and %rbp are accessed as 64-bit registers. | 163 // X86-64 is ILP32, but %rsp and %rbp are accessed as 64-bit registers. |
| 164 // For filetype=asm, they need to be emitted as their 32-bit sibilings. | 164 // For filetype=asm, they need to be emitted as their 32-bit siblings. |
| 165 assert(Base->getType() == IceType_i64); | 165 assert(Base->getType() == IceType_i64); |
| 166 assert(Base->getRegNum() == RegX8664::Encoded_Reg_rsp || | 166 assert(getEncodedGPR(Base->getRegNum()) == RegX8664::Encoded_Reg_rsp || |
| 167 Base->getRegNum() == RegX8664::Encoded_Reg_rbp || | 167 getEncodedGPR(Base->getRegNum()) == RegX8664::Encoded_Reg_rbp || |
| 168 getType() == IceType_void); | 168 getType() == IceType_void); |
| 169 B = B->asType(Func, IceType_i32, X8664::Traits::getGprForType( | 169 B = B->asType(Func, IceType_i32, X8664::Traits::getGprForType( |
| 170 IceType_i32, Base->getRegNum())); | 170 IceType_i32, Base->getRegNum())); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 B->emit(Func); | 174 B->emit(Func); |
| 175 } | 175 } |
| 176 | 176 |
| 177 if (Index != nullptr) { | 177 if (Index != nullptr) { |
| (...skipping 175 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 |