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

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2027773002: Subzero, MIPS32: Handling floating point instructions fadd, fsub, fmul, fdiv (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 7 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.arith.ll » ('j') | tests_lit/llvm2ice_tests/fp.arith.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 66116e3c2f9a7f008623fdd55742a49015f6f097..87dc762de7ecc9e40def779d46d5761719dcdfbb 100644
--- a/src/IceTargetLoweringMIPS32.cpp
+++ b/src/IceTargetLoweringMIPS32.cpp
@@ -690,17 +690,6 @@ void TargetMIPS32::lowerArithmetic(const InstArithmetic *Instr) {
UnimplementedLoweringError(this, Instr);
return;
}
- switch (Instr->getOp()) {
- default:
- break;
- case InstArithmetic::Fadd:
- case InstArithmetic::Fsub:
- case InstArithmetic::Fmul:
- case InstArithmetic::Fdiv:
- case InstArithmetic::Frem:
- UnimplementedLoweringError(this, Instr);
- return;
- }
// At this point Dest->getType() is non-i64 scalar
@@ -779,13 +768,54 @@ void TargetMIPS32::lowerArithmetic(const InstArithmetic *Instr) {
_mov(Dest, T);
return;
}
- case InstArithmetic::Fadd:
+ case InstArithmetic::Fadd: {
+ if (DestTy == IceType_f32) {
+ _add_s(T, Src0R, Src1R);
+ _mov_s(Dest, T);
+ return;
+ }
+ if (DestTy == IceType_f64) {
+ _add_d(T, Src0R, Src1R);
+ _mov_d(Dest, T);
+ return;
+ }
break;
+ }
case InstArithmetic::Fsub:
+ if (DestTy == IceType_f32) {
+ _sub_s(T, Src0R, Src1R);
+ _mov_s(Dest, T);
+ return;
+ }
+ if (DestTy == IceType_f64) {
+ _sub_d(T, Src0R, Src1R);
+ _mov_d(Dest, T);
+ return;
+ }
break;
case InstArithmetic::Fmul:
+ if (DestTy == IceType_f32) {
+ _mul_s(T, Src0R, Src1R);
+ _mov_s(Dest, T);
+ return;
+ }
+ if (DestTy == IceType_f64) {
+ _mul_d(T, Src0R, Src1R);
+ _mov_d(Dest, T);
+ return;
+ }
break;
case InstArithmetic::Fdiv:
+ if (DestTy == IceType_f32) {
+ _div_s(T, Src0R, Src1R);
+ _mov_s(Dest, T);
+ return;
+ }
+ if (DestTy == IceType_f64) {
+ _div_d(T, Src0R, Src1R);
+ _mov_d(Dest, T);
+ return;
+ }
break;
case InstArithmetic::Frem:
Jim Stichnoth 2016/06/01 13:52:13 For frem, all the other targets create a call to t
obucinac 2016/06/01 14:21:16 Acknowledged.
break;
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/fp.arith.ll » ('j') | tests_lit/llvm2ice_tests/fp.arith.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698