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

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2324903002: Subzero, MIPS32: Handling fptrunc and fpext casting (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/fp.convert.ll » ('j') | tests_lit/llvm2ice_tests/fp.convert.ll » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringMIPS32.cpp
diff --git a/src/IceTargetLoweringMIPS32.cpp b/src/IceTargetLoweringMIPS32.cpp
index 7bdf723d3796b4da898c12e1f0a54380a7fbff89..8a9470dcf49d718a1f1406633d0f90fbdfb18063 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -2018,22 +2018,31 @@ void TargetMIPS32::lowerCast(const InstCast *Instr) {
_mov(Dest, T);
break;
}
- case InstCast::Fptrunc:
- // Use _cvt_d_s
- UnimplementedLoweringError(this, Instr);
+ case InstCast::Fptrunc: {
+ assert(Dest->getType() == IceType_f32);
+ assert(Src0->getType() == IceType_f64);
+ auto *DestR = legalizeToReg(Dest);
+ auto *Src0R = legalizeToReg(Src0);
+ _cvt_s_d(DestR, Src0R);
+ _mov(Dest, DestR);
break;
+ }
case InstCast::Fpext: {
- // Use _cvt_s_d
- UnimplementedLoweringError(this, Instr);
+ assert(Dest->getType() == IceType_f64);
+ assert(Src0->getType() == IceType_f32);
+ auto *DestR = legalizeToReg(Dest);
+ auto *Src0R = legalizeToReg(Src0);
+ _cvt_d_s(DestR, Src0R);
+ _mov(Dest, DestR);
break;
}
- case InstCast::Fptosi:
+ case InstCast::Fptosi: //
UnimplementedLoweringError(this, Instr);
break;
case InstCast::Fptoui:
UnimplementedLoweringError(this, Instr);
break;
- case InstCast::Sitofp:
+ case InstCast::Sitofp: //
UnimplementedLoweringError(this, Instr);
break;
case InstCast::Uitofp: {
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/fp.convert.ll » ('j') | tests_lit/llvm2ice_tests/fp.convert.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698