llvm.org GIT mirror llvm / 1cc6333
Emit neg.s or neg.d only if -enable-no-nans-fp-math is supplied by user, otherwise expand FNEG during legalization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154546 91177308-0d34-0410-b5e6-96231b3b80d8 Akira Hatanaka 8 years ago
3 changed file(s) with 26 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
214214 setOperationAction(ISD::FMA, MVT::f64, Expand);
215215 setOperationAction(ISD::FREM, MVT::f32, Expand);
216216 setOperationAction(ISD::FREM, MVT::f64, Expand);
217
218 if (!TM.Options.NoNaNsFPMath) {
219 setOperationAction(ISD::FNEG, MVT::f32, Expand);
220 setOperationAction(ISD::FNEG, MVT::f64, Expand);
221 }
217222
218223 setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand);
219224 setOperationAction(ISD::EXCEPTIONADDR, MVT::i64, Expand);
189189 def CVT_D64_L : FFR1<0x21, 21, "cvt", "d.l", FGR64, FGR64>;
190190 }
191191
192 let Predicates = [NoNaNsFPMath] in
193 defm FABS : FFR1P_M<0x5, "abs", fabs>;
194 defm FNEG : FFR1P_M<0x7, "neg", fneg>;
192 let Predicates = [NoNaNsFPMath] in {
193 defm FABS : FFR1P_M<0x5, "abs", fabs>;
194 defm FNEG : FFR1P_M<0x7, "neg", fneg>;
195 }
195196 defm FSQRT : FFR1P_M<0x4, "sqrt", fsqrt>;
196197
197198 // The odd-numbered registers are only referenced when doing loads,
0 ; RUN: llc < %s -march=mipsel -mcpu=mips32 | FileCheck %s
1
2 define float @foo0(i32 %a, float %d) nounwind readnone {
3 entry:
4 ; CHECK-NOT: fabs.s
5 %sub = fsub float -0.000000e+00, %d
6 ret float %sub
7 }
8
9 define double @foo1(i32 %a, double %d) nounwind readnone {
10 entry:
11 ; CHECK: foo1
12 ; CHECK-NOT: fabs.d
13 ; CHECK: jr
14 %sub = fsub double -0.000000e+00, %d
15 ret double %sub
16 }