1; RUN: llc < %s -march=mipsel -mcpu=mips32r2 -enable-no-nans-fp-math | FileCheck %s -check-prefix=32R2 2; RUN: llc < %s -march=mips64el -mcpu=mips64r2 -mattr=n64 -enable-no-nans-fp-math | FileCheck %s -check-prefix=64R2 3; RUN: llc < %s -march=mipsel -mcpu=mips32r2 | FileCheck %s -check-prefix=32R2NAN 4; RUN: llc < %s -march=mips64el -mcpu=mips64r2 -mattr=n64 | FileCheck %s -check-prefix=64R2NAN 5 6define float @FOO0float(float %a, float %b, float %c) nounwind readnone { 7entry: 8; CHECK: madd.s 9 %mul = fmul float %a, %b 10 %add = fadd float %mul, %c 11 %add1 = fadd float %add, 0.000000e+00 12 ret float %add1 13} 14 15define float @FOO1float(float %a, float %b, float %c) nounwind readnone { 16entry: 17; CHECK: msub.s 18 %mul = fmul float %a, %b 19 %sub = fsub float %mul, %c 20 %add = fadd float %sub, 0.000000e+00 21 ret float %add 22} 23 24define float @FOO2float(float %a, float %b, float %c) nounwind readnone { 25entry: 26; 32R2: nmadd.s 27; 64R2: nmadd.s 28; 32R2NAN: madd.s 29; 64R2NAN: madd.s 30 %mul = fmul float %a, %b 31 %add = fadd float %mul, %c 32 %sub = fsub float 0.000000e+00, %add 33 ret float %sub 34} 35 36define float @FOO3float(float %a, float %b, float %c) nounwind readnone { 37entry: 38; 32R2: nmsub.s 39; 64R2: nmsub.s 40; 32R2NAN: msub.s 41; 64R2NAN: msub.s 42 %mul = fmul float %a, %b 43 %sub = fsub float %mul, %c 44 %sub1 = fsub float 0.000000e+00, %sub 45 ret float %sub1 46} 47 48define double @FOO10double(double %a, double %b, double %c) nounwind readnone { 49entry: 50; CHECK: madd.d 51 %mul = fmul double %a, %b 52 %add = fadd double %mul, %c 53 %add1 = fadd double %add, 0.000000e+00 54 ret double %add1 55} 56 57define double @FOO11double(double %a, double %b, double %c) nounwind readnone { 58entry: 59; CHECK: msub.d 60 %mul = fmul double %a, %b 61 %sub = fsub double %mul, %c 62 %add = fadd double %sub, 0.000000e+00 63 ret double %add 64} 65 66define double @FOO12double(double %a, double %b, double %c) nounwind readnone { 67entry: 68; 32R2: nmadd.d 69; 64R2: nmadd.d 70; 32R2NAN: madd.d 71; 64R2NAN: madd.d 72 %mul = fmul double %a, %b 73 %add = fadd double %mul, %c 74 %sub = fsub double 0.000000e+00, %add 75 ret double %sub 76} 77 78define double @FOO13double(double %a, double %b, double %c) nounwind readnone { 79entry: 80; 32R2: nmsub.d 81; 64R2: nmsub.d 82; 32R2NAN: msub.d 83; 64R2NAN: msub.d 84 %mul = fmul double %a, %b 85 %sub = fsub double %mul, %c 86 %sub1 = fsub double 0.000000e+00, %sub 87 ret double %sub1 88} 89