1 ; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=avx < %s | FileCheck %s
3 define float @test1(float %a) #0 {
6 ; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm0
8 %t1 = fadd nnan reassoc nsz float %a, %a
9 %r = fadd nnan reassoc nsz float %t1, %t1
13 define float @test2(float %a) #0 {
16 ; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm0
18 %t1 = fmul nnan reassoc nsz float 4.0, %a
19 %t2 = fadd nnan reassoc nsz float %a, %a
20 %r = fadd nnan reassoc nsz float %t1, %t2
24 define float @test3(float %a) #0 {
27 ; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm0
29 %t1 = fmul nnan reassoc nsz float %a, 4.0
30 %t2 = fadd nnan reassoc nsz float %a, %a
31 %r = fadd nnan reassoc nsz float %t1, %t2
35 define float @test4(float %a) #0 {
38 ; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm0
40 %t1 = fadd nnan reassoc nsz float %a, %a
41 %t2 = fmul nnan reassoc nsz float 4.0, %a
42 %r = fadd nnan reassoc nsz float %t1, %t2
46 define float @test5(float %a) #0 {
49 ; CHECK-NEXT: vmulss {{.*}}(%rip), %xmm0, %xmm0
51 %t1 = fadd nnan reassoc nsz float %a, %a
52 %t2 = fmul nnan reassoc nsz float %a, 4.0
53 %r = fadd nnan reassoc nsz float %t1, %t2
57 define float @test6(float %a) #0 {
60 ; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
62 %t1 = fmul nnan reassoc nsz float 2.0, %a
63 %t2 = fadd nnan reassoc nsz float %a, %a
64 %r = fsub nnan reassoc nsz float %t1, %t2
68 define float @test7(float %a) #0 {
71 ; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
73 %t1 = fmul nnan reassoc nsz float %a, 2.0
74 %t2 = fadd nnan reassoc nsz float %a, %a
75 %r = fsub nnan reassoc nsz float %t1, %t2
79 define float @test8(float %a) #0 {
83 %t1 = fmul nsz float %a, 0.0
84 %t2 = fadd nnan reassoc nsz float %a, %t1
88 define float @test9(float %a) #0 {
92 %t1 = fmul nsz float 0.0, %a
93 %t2 = fadd nnan reassoc nsz float %t1, %a
97 define float @test10(float %a) #0 {
98 ; CHECK-LABEL: test10:
100 ; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
102 %t1 = fsub nsz float -0.0, %a
103 %t2 = fadd nnan reassoc nsz float %a, %t1