| OLD | NEW |
| 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// | 1 //===- subzero/src/IceInstX8632.cpp - X86-32 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 MachineTraits<TargetX8632>::Assembler *Asm) const { | 199 MachineTraits<TargetX8632>::Assembler *Asm) const { |
| 200 int32_t Disp = 0; | 200 int32_t Disp = 0; |
| 201 AssemblerFixup *Fixup = nullptr; | 201 AssemblerFixup *Fixup = nullptr; |
| 202 // Determine the offset (is it relocatable?) | 202 // Determine the offset (is it relocatable?) |
| 203 if (getOffset()) { | 203 if (getOffset()) { |
| 204 if (const auto CI = llvm::dyn_cast<ConstantInteger32>(getOffset())) { | 204 if (const auto CI = llvm::dyn_cast<ConstantInteger32>(getOffset())) { |
| 205 Disp = static_cast<int32_t>(CI->getValue()); | 205 Disp = static_cast<int32_t>(CI->getValue()); |
| 206 } else if (const auto CR = | 206 } else if (const auto CR = |
| 207 llvm::dyn_cast<ConstantRelocatable>(getOffset())) { | 207 llvm::dyn_cast<ConstantRelocatable>(getOffset())) { |
| 208 Disp = CR->getOffset(); | 208 Disp = CR->getOffset(); |
| 209 Fixup = Asm->createFixup(llvm::ELF::R_386_32, CR); | 209 Fixup = Asm->createFixup(RelFixup, CR); |
| 210 } else { | 210 } else { |
| 211 llvm_unreachable("Unexpected offset type"); | 211 llvm_unreachable("Unexpected offset type"); |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 // Now convert to the various possible forms. | 215 // Now convert to the various possible forms. |
| 216 if (getBase() && getIndex()) { | 216 if (getBase() && getIndex()) { |
| 217 return X8632::Traits::Address( | 217 return X8632::Traits::Address( |
| 218 RegX8632::getEncodedGPR(getBase()->getRegNum()), | 218 RegX8632::getEncodedGPR(getBase()->getRegNum()), |
| 219 RegX8632::getEncodedGPR(getIndex()->getRegNum()), | 219 RegX8632::getEncodedGPR(getIndex()->getRegNum()), |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 Var->dump(Func); | 274 Var->dump(Func); |
| 275 else | 275 else |
| 276 Var->dump(Str); | 276 Var->dump(Str); |
| 277 Str << ")"; | 277 Str << ")"; |
| 278 } | 278 } |
| 279 | 279 |
| 280 } // namespace X86Internal | 280 } // namespace X86Internal |
| 281 } // end of namespace Ice | 281 } // end of namespace Ice |
| 282 | 282 |
| 283 X86INSTS_DEFINE_STATIC_DATA(TargetX8632); | 283 X86INSTS_DEFINE_STATIC_DATA(TargetX8632); |
| OLD | NEW |