Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: src/IceInstX8664.cpp

Issue 1273153002: Subzero. Native 64-bit int arithmetic on x86-64. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes tests & make format Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 MachineTraits<TargetX8664>::X86OperandMem::toAsmAddress( 172 MachineTraits<TargetX8664>::X86OperandMem::toAsmAddress(
173 MachineTraits<TargetX8664>::Assembler *Asm) const { 173 MachineTraits<TargetX8664>::Assembler *Asm) const {
174 int32_t Disp = 0; 174 int32_t Disp = 0;
175 AssemblerFixup *Fixup = nullptr; 175 AssemblerFixup *Fixup = nullptr;
176 // Determine the offset (is it relocatable?) 176 // Determine the offset (is it relocatable?)
177 if (getOffset()) { 177 if (getOffset()) {
178 if (const auto CI = llvm::dyn_cast<ConstantInteger32>(getOffset())) { 178 if (const auto CI = llvm::dyn_cast<ConstantInteger32>(getOffset())) {
179 Disp = static_cast<int32_t>(CI->getValue()); 179 Disp = static_cast<int32_t>(CI->getValue());
180 } else if (const auto CR = 180 } else if (const auto CR =
181 llvm::dyn_cast<ConstantRelocatable>(getOffset())) { 181 llvm::dyn_cast<ConstantRelocatable>(getOffset())) {
182 Disp = CR->getOffset(); 182 Disp = CR->getOffset() - 4;
183 Fixup = Asm->createFixup(llvm::ELF::R_386_32, CR); 183 Fixup = Asm->createFixup(PcRelFixup, CR);
184 } else { 184 } else {
185 llvm_unreachable("Unexpected offset type"); 185 llvm_unreachable("Unexpected offset type");
186 } 186 }
187 } 187 }
188 188
189 // Now convert to the various possible forms. 189 // Now convert to the various possible forms.
190 if (getBase() && getIndex()) { 190 if (getBase() && getIndex()) {
191 return X8664::Traits::Address( 191 return X8664::Traits::Address(
192 RegX8664::getEncodedGPR(getBase()->getRegNum()), 192 RegX8664::getEncodedGPR(getBase()->getRegNum()),
193 RegX8664::getEncodedGPR(getIndex()->getRegNum()), 193 RegX8664::getEncodedGPR(getIndex()->getRegNum()),
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 Var->dump(Func); 248 Var->dump(Func);
249 else 249 else
250 Var->dump(Str); 250 Var->dump(Str);
251 Str << ")"; 251 Str << ")";
252 } 252 }
253 253
254 } // namespace X86Internal 254 } // namespace X86Internal
255 } // end of namespace Ice 255 } // end of namespace Ice
256 256
257 X86INSTS_DEFINE_STATIC_DATA(TargetX8664); 257 X86INSTS_DEFINE_STATIC_DATA(TargetX8664);
OLDNEW
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698