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

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: 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') | src/IceInstX8664.def » ('J')
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 sibilings.
Jim Stichnoth 2016/06/27 22:06:55 siblings
manasijm 2016/06/27 22:37:09 Done.
165 assert(Base->getType() == IceType_i64); 165 assert(Base->getType() == IceType_i64);
166 assert(Base->getRegNum() == RegX8664::Encoded_Reg_rsp ||
Jim Stichnoth 2016/06/27 22:06:55 This assert can/should stay. However, change "Bas
manasijm 2016/06/27 22:37:09 Done.
167 Base->getRegNum() == RegX8664::Encoded_Reg_rbp ||
168 getType() == IceType_void);
169 B = B->asType(Func, IceType_i32, X8664::Traits::getGprForType( 166 B = B->asType(Func, IceType_i32, X8664::Traits::getGprForType(
170 IceType_i32, Base->getRegNum())); 167 IceType_i32, Base->getRegNum()));
171 } 168 }
172 } 169 }
173 170
174 B->emit(Func); 171 B->emit(Func);
175 } 172 }
176 173
177 if (Index != nullptr) { 174 if (Index != nullptr) {
178 Variable *I = Index; 175 Variable *I = Index;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 Var->dump(Func); 350 Var->dump(Func);
354 else 351 else
355 Var->dump(Str); 352 Var->dump(Str);
356 Str << ")"; 353 Str << ")";
357 } 354 }
358 355
359 } // namespace X8664 356 } // namespace X8664
360 } // end of namespace Ice 357 } // end of namespace Ice
361 358
362 X86INSTS_DEFINE_STATIC_DATA(X8664, X8664::Traits) 359 X86INSTS_DEFINE_STATIC_DATA(X8664, X8664::Traits)
OLDNEW
« no previous file with comments | « no previous file | src/IceInstX8664.def » ('j') | src/IceInstX8664.def » ('J')

Powered by Google App Engine
This is Rietveld 408576698