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

Side by Side Diff: src/IceInstX8664.cpp

Issue 2100333002: Reorder X8664 Register Defs so that scratch registers are allocated first (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Address Comments Created 4 years, 5 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 | « no previous file | src/IceInstX8664.def » ('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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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)
OLDNEW
« no previous file with comments | « no previous file | src/IceInstX8664.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698