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

Side by Side Diff: src/IceInstX8664.cpp

Issue 1676123002: Subzero: Use a proper RegNumT type instead of int32_t/SizeT. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Make it possible to do "auto NewReg = RegNumT::NoRegister;" Created 4 years, 10 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 SizeT I = 0; 82 SizeT I = 0;
83 if (Base) 83 if (Base)
84 Vars[I++] = Base; 84 Vars[I++] = Base;
85 if (Index) 85 if (Index)
86 Vars[I++] = Index; 86 Vars[I++] = Index;
87 assert(I == NumVars); 87 assert(I == NumVars);
88 } 88 }
89 } 89 }
90 90
91 namespace { 91 namespace {
92 static int32_t 92 int32_t getRematerializableOffset(Variable *Var,
93 getRematerializableOffset(Variable *Var, 93 const ::Ice::X8664::TargetX8664 *Target) {
94 const ::Ice::X8664::TargetX8664 *Target) {
95 int32_t Disp = Var->getStackOffset(); 94 int32_t Disp = Var->getStackOffset();
96 SizeT RegNum = static_cast<SizeT>(Var->getRegNum()); 95 const auto RegNum = Var->getRegNum();
97 if (RegNum == Target->getFrameReg()) { 96 if (RegNum == Target->getFrameReg()) {
98 Disp += Target->getFrameFixedAllocaOffset(); 97 Disp += Target->getFrameFixedAllocaOffset();
99 } else if (RegNum != Target->getStackReg()) { 98 } else if (RegNum != Target->getStackReg()) {
100 llvm::report_fatal_error("Unexpected rematerializable register type"); 99 llvm::report_fatal_error("Unexpected rematerializable register type");
101 } 100 }
102 return Disp; 101 return Disp;
103 } 102 }
104 } // end of anonymous namespace 103 } // end of anonymous namespace
105 104
106 void TargetX8664Traits::X86OperandMem::emit(const Cfg *Func) const { 105 void TargetX8664Traits::X86OperandMem::emit(const Cfg *Func) const {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 Var->dump(Func); 356 Var->dump(Func);
358 else 357 else
359 Var->dump(Str); 358 Var->dump(Str);
360 Str << ")"; 359 Str << ")";
361 } 360 }
362 361
363 } // namespace X8664 362 } // namespace X8664
364 } // end of namespace Ice 363 } // end of namespace Ice
365 364
366 X86INSTS_DEFINE_STATIC_DATA(X8664, X8664::Traits) 365 X86INSTS_DEFINE_STATIC_DATA(X8664, X8664::Traits)
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