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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 539743002: Subzero: Render constants in dump() to be more like LLVM. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 3 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') | szdiff.py » ('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 3901 matching lines...) Expand 10 before | Expand all | Expand 10 after
3912 // cmp a,val[0]; jeq label[0]; cmp a,val[1]; jeq label[1]; ... jmp default 3912 // cmp a,val[0]; jeq label[0]; cmp a,val[1]; jeq label[1]; ... jmp default
3913 Operand *Src0 = Inst->getComparison(); 3913 Operand *Src0 = Inst->getComparison();
3914 SizeT NumCases = Inst->getNumCases(); 3914 SizeT NumCases = Inst->getNumCases();
3915 // OK, we'll be slightly less naive by forcing Src into a physical 3915 // OK, we'll be slightly less naive by forcing Src into a physical
3916 // register if there are 2 or more uses. 3916 // register if there are 2 or more uses.
3917 if (NumCases >= 2) 3917 if (NumCases >= 2)
3918 Src0 = legalizeToVar(Src0, true); 3918 Src0 = legalizeToVar(Src0, true);
3919 else 3919 else
3920 Src0 = legalize(Src0, Legal_Reg | Legal_Mem, true); 3920 Src0 = legalize(Src0, Legal_Reg | Legal_Mem, true);
3921 for (SizeT I = 0; I < NumCases; ++I) { 3921 for (SizeT I = 0; I < NumCases; ++I) {
3922 // TODO(stichnot): Correct lowering for IceType_i64.
3922 Operand *Value = Ctx->getConstantInt(IceType_i32, Inst->getValue(I)); 3923 Operand *Value = Ctx->getConstantInt(IceType_i32, Inst->getValue(I));
3923 _cmp(Src0, Value); 3924 _cmp(Src0, Value);
3924 _br(InstX8632Br::Br_e, Inst->getLabel(I)); 3925 _br(InstX8632Br::Br_e, Inst->getLabel(I));
3925 } 3926 }
3926 3927
3927 _br(Inst->getLabelDefault()); 3928 _br(Inst->getLabelDefault());
3928 } 3929 }
3929 3930
3930 void TargetX8632::scalarizeArithmetic(InstArithmetic::OpKind Kind, 3931 void TargetX8632::scalarizeArithmetic(InstArithmetic::OpKind Kind,
3931 Variable *Dest, Operand *Src0, 3932 Variable *Dest, Operand *Src0,
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
4418 Str << "\t.align\t" << Align << "\n"; 4419 Str << "\t.align\t" << Align << "\n";
4419 Str << MangledName << ":\n"; 4420 Str << MangledName << ":\n";
4420 for (SizeT i = 0; i < Size; ++i) { 4421 for (SizeT i = 0; i < Size; ++i) {
4421 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; 4422 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
4422 } 4423 }
4423 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; 4424 Str << "\t.size\t" << MangledName << ", " << Size << "\n";
4424 } 4425 }
4425 } 4426 }
4426 4427
4427 } // end of namespace Ice 4428 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceOperand.h ('k') | szdiff.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698