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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 339783002: Add support for undef values in ICE IR. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Clarify that we expect backends to lower undef to 0 Created 6 years, 6 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/IceOperand.h ('k') | src/llvm2ice.cpp » ('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/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===//
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 // This file implements the TargetLoweringX8632 class, which 10 // This file implements the TargetLoweringX8632 class, which
(...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2145 } 2145 }
2146 2146
2147 if (!(Allowed & Legal_Mem)) { 2147 if (!(Allowed & Legal_Mem)) {
2148 Variable *Reg = makeReg(From->getType(), RegNum); 2148 Variable *Reg = makeReg(From->getType(), RegNum);
2149 _mov(Reg, From, RegNum); 2149 _mov(Reg, From, RegNum);
2150 From = Reg; 2150 From = Reg;
2151 } 2151 }
2152 return From; 2152 return From;
2153 } 2153 }
2154 if (llvm::isa<Constant>(From)) { 2154 if (llvm::isa<Constant>(From)) {
2155 if (llvm::isa<ConstantUndef>(From)) {
2156 // Lower undefs to zero. Another option is to lower undefs to an
Jim Stichnoth 2014/06/18 13:43:33 Please help future developers. :) Leave the FakeD
2157 // uninitialized register; however, using an uninitialized register
2158 // results in less predictable code.
2159 From = Ctx->getConstantZero(From->getType());
2160 }
2155 if (!(Allowed & Legal_Imm)) { 2161 if (!(Allowed & Legal_Imm)) {
2156 Variable *Reg = makeReg(From->getType(), RegNum); 2162 Variable *Reg = makeReg(From->getType(), RegNum);
2157 _mov(Reg, From); 2163 _mov(Reg, From);
2158 From = Reg; 2164 From = Reg;
2159 } 2165 }
2160 return From; 2166 return From;
2161 } 2167 }
2162 if (Variable *Var = llvm::dyn_cast<Variable>(From)) { 2168 if (Variable *Var = llvm::dyn_cast<Variable>(From)) {
2163 // We need a new physical register for the operand if: 2169 // We need a new physical register for the operand if:
2164 // Mem is not allowed and Var->getRegNum() is unknown, or 2170 // Mem is not allowed and Var->getRegNum() is unknown, or
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2261 // llvm-mc doesn't parse "dword ptr [.L$foo]". 2267 // llvm-mc doesn't parse "dword ptr [.L$foo]".
2262 Str << "dword ptr [L$" << IceType_f32 << "$" << getPoolEntryID() << "]"; 2268 Str << "dword ptr [L$" << IceType_f32 << "$" << getPoolEntryID() << "]";
2263 } 2269 }
2264 2270
2265 template <> void ConstantDouble::emit(GlobalContext *Ctx) const { 2271 template <> void ConstantDouble::emit(GlobalContext *Ctx) const {
2266 Ostream &Str = Ctx->getStrEmit(); 2272 Ostream &Str = Ctx->getStrEmit();
2267 Str << "qword ptr [L$" << IceType_f64 << "$" << getPoolEntryID() << "]"; 2273 Str << "qword ptr [L$" << IceType_f64 << "$" << getPoolEntryID() << "]";
2268 } 2274 }
2269 2275
2270 } // end of namespace Ice 2276 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceOperand.h ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698