107 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=avx < %s | FileCheck %s2 3define float @test1(float %a) #0 {4; CHECK-LABEL: test1:5; CHECK: # %bb.0:6; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm07; CHECK-NEXT: retq8 %t1 = fadd nnan reassoc nsz float %a, %a9 %r = fadd nnan reassoc nsz float %t1, %t110 ret float %r11}12 13define float @test2(float %a) #0 {14; CHECK-LABEL: test2:15; CHECK: # %bb.0:16; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm017; CHECK-NEXT: retq18 %t1 = fmul nnan reassoc nsz float 4.0, %a19 %t2 = fadd nnan reassoc nsz float %a, %a20 %r = fadd nnan reassoc nsz float %t1, %t221 ret float %r22}23 24define float @test3(float %a) #0 {25; CHECK-LABEL: test3:26; CHECK: # %bb.0:27; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm028; CHECK-NEXT: retq29 %t1 = fmul nnan reassoc nsz float %a, 4.030 %t2 = fadd nnan reassoc nsz float %a, %a31 %r = fadd nnan reassoc nsz float %t1, %t232 ret float %r33}34 35define float @test4(float %a) #0 {36; CHECK-LABEL: test4:37; CHECK: # %bb.0:38; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm039; CHECK-NEXT: retq40 %t1 = fadd nnan reassoc nsz float %a, %a41 %t2 = fmul nnan reassoc nsz float 4.0, %a42 %r = fadd nnan reassoc nsz float %t1, %t243 ret float %r44}45 46define float @test5(float %a) #0 {47; CHECK-LABEL: test5:48; CHECK: # %bb.0:49; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm050; CHECK-NEXT: retq51 %t1 = fadd nnan reassoc nsz float %a, %a52 %t2 = fmul nnan reassoc nsz float %a, 4.053 %r = fadd nnan reassoc nsz float %t1, %t254 ret float %r55}56 57define float @test6(float %a) #0 {58; CHECK-LABEL: test6:59; CHECK: # %bb.0:60; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm061; CHECK-NEXT: retq62 %t1 = fmul nnan reassoc nsz float 2.0, %a63 %t2 = fadd nnan reassoc nsz float %a, %a64 %r = fsub nnan reassoc nsz float %t1, %t265 ret float %r66}67 68define float @test7(float %a) #0 {69; CHECK-LABEL: test7:70; CHECK: # %bb.0:71; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm072; CHECK-NEXT: retq73 %t1 = fmul nnan reassoc nsz float %a, 2.074 %t2 = fadd nnan reassoc nsz float %a, %a75 %r = fsub nnan reassoc nsz float %t1, %t276 ret float %r77}78 79define float @test8(float %a) #0 {80; CHECK-LABEL: test8:81; CHECK: # %bb.0:82; CHECK-NEXT: retq83 %t1 = fmul nsz float %a, 0.084 %t2 = fadd nnan reassoc nsz float %a, %t185 ret float %t286}87 88define float @test9(float %a) #0 {89; CHECK-LABEL: test9:90; CHECK: # %bb.0:91; CHECK-NEXT: retq92 %t1 = fmul nsz float 0.0, %a93 %t2 = fadd nnan reassoc nsz float %t1, %a94 ret float %t295}96 97define float @test10(float %a) #0 {98; CHECK-LABEL: test10:99; CHECK: # %bb.0:100; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0101; CHECK-NEXT: retq102 %t1 = fsub nsz float -0.0, %a103 %t2 = fadd nnan reassoc nsz float %a, %t1104 ret float %t2105}106 107