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

Unified Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 2077503002: Subzero: Build a better bitcast. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/bitcast.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX86BaseImpl.h
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
index b28c00944af1149af8191627cae5a3e7079dd687..3ed27cbb69a30ce31b43c4100b4241570821ef25 100644
--- a/src/IceTargetLoweringX86BaseImpl.h
+++ b/src/IceTargetLoweringX86BaseImpl.h
@@ -3059,24 +3059,10 @@ void TargetX86Base<TraitsType>::lowerCast(const InstCast *Instr) {
} break;
case IceType_i32:
case IceType_f32: {
- Operand *Src0RM = legalize(Src0, Legal_Reg | Legal_Mem);
- Type SrcType = Src0RM->getType();
- assert((DestTy == IceType_i32 && SrcType == IceType_f32) ||
- (DestTy == IceType_f32 && SrcType == IceType_i32));
- // a.i32 = bitcast b.f32 ==>
- // t.f32 = b.f32
- // s.f32 = spill t.f32
- // a.i32 = s.f32
- Variable *T = nullptr;
- // TODO: Should be able to force a spill setup by calling legalize() with
- // Legal_Mem and not Legal_Reg or Legal_Imm.
- SpillVariable *SpillVar = Func->makeVariable<SpillVariable>(SrcType);
- SpillVar->setLinkedTo(Dest);
- Variable *Spill = SpillVar;
- Spill->setMustNotHaveReg();
- _mov(T, Src0RM);
- _mov(Spill, T);
- _mov(Dest, Spill);
+ Variable *Src0R = legalizeToReg(Src0);
+ Variable *T = makeReg(DestTy);
+ _movd(T, Src0R);
+ _mov(Dest, T);
} break;
case IceType_i64: {
assert(Src0->getType() == IceType_f64);
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/bitcast.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698