1 ; RUN: llc < %s -march=ppc32 | \ 2 ; RUN: egrep {fn?madd|fn?msub} | count 8 3 4 define double @test_FMADD1(double %A, double %B, double %C) { 5 %D = fmul double %A, %B ; <double> [#uses=1] 6 %E = fadd double %D, %C ; <double> [#uses=1] 7 ret double %E 8 } 9 10 define double @test_FMADD2(double %A, double %B, double %C) { 11 %D = fmul double %A, %B ; <double> [#uses=1] 12 %E = fadd double %D, %C ; <double> [#uses=1] 13 ret double %E 14 } 15 16 define double @test_FMSUB(double %A, double %B, double %C) { 17 %D = fmul double %A, %B ; <double> [#uses=1] 18 %E = fsub double %D, %C ; <double> [#uses=1] 19 ret double %E 20 } 21 22 define double @test_FNMADD1(double %A, double %B, double %C) { 23 %D = fmul double %A, %B ; <double> [#uses=1] 24 %E = fadd double %D, %C ; <double> [#uses=1] 25 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] 26 ret double %F 27 } 28 29 define double @test_FNMADD2(double %A, double %B, double %C) { 30 %D = fmul double %A, %B ; <double> [#uses=1] 31 %E = fadd double %C, %D ; <double> [#uses=1] 32 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] 33 ret double %F 34 } 35 36 define double @test_FNMSUB1(double %A, double %B, double %C) { 37 %D = fmul double %A, %B ; <double> [#uses=1] 38 %E = fsub double %C, %D ; <double> [#uses=1] 39 ret double %E 40 } 41 42 define double @test_FNMSUB2(double %A, double %B, double %C) { 43 %D = fmul double %A, %B ; <double> [#uses=1] 44 %E = fsub double %D, %C ; <double> [#uses=1] 45 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] 46 ret double %F 47 } 48 49 define float @test_FNMSUBS(float %A, float %B, float %C) { 50 %D = fmul float %A, %B ; <float> [#uses=1] 51 %E = fsub float %D, %C ; <float> [#uses=1] 52 %F = fsub float -0.000000e+00, %E ; <float> [#uses=1] 53 ret float %F 54 } 55