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; |