llvm/test/CodeGen/X86/fmul-combines.ll: Appease Windows x64. <4 x float> is passed...
[oota-llvm.git] / test / CodeGen / X86 / fmul-combines.ll
1 ; RUN: llc -march=x86-64 < %s | FileCheck %s
2
3 ; CHECK-LABEL: fmul2_f32:
4 ; CHECK: addss %xmm0, %xmm0
5 define float @fmul2_f32(float %x) {
6   %y = fmul float %x, 2.0
7   ret float %y
8 }
9
10 ; fmul 2.0, x -> fadd x, x for vectors.
11
12 ; CHECK-LABEL: fmul2_v4f32:
13 ; CHECK: addps %xmm0, %xmm0
14 ; CHECK-NEXT: retq
15 define <4 x float> @fmul2_v4f32(<4 x float> %x) {
16   %y = fmul <4 x float> %x, <float 2.0, float 2.0, float 2.0, float 2.0>
17   ret <4 x float> %y
18 }
19
20 ; CHECK-LABEL: constant_fold_fmul_v4f32:
21 ; CHECK: movaps
22 ; CHECK-NEXT: ret
23 define <4 x float> @constant_fold_fmul_v4f32(<4 x float> %x) {
24   %y = fmul <4 x float> <float 4.0, float 4.0, float 4.0, float 4.0>, <float 2.0, float 2.0, float 2.0, float 2.0>
25   ret <4 x float> %y
26 }
27
28 ; CHECK-LABEL: fmul0_v4f32:
29 ; CHECK: xorps %xmm0, %xmm0
30 ; CHECK-NEXT: retq
31 define <4 x float> @fmul0_v4f32(<4 x float> %x) #0 {
32   %y = fmul <4 x float> %x, <float 0.0, float 0.0, float 0.0, float 0.0>
33   ret <4 x float> %y
34 }
35
36 ; CHECK-LABEL: fmul_c2_c4_v4f32:
37 ; CHECK-NOT: addps
38 ; CHECK: mulps
39 ; CHECK-NOT: mulps
40 ; CHECK-NEXT: ret
41 define <4 x float> @fmul_c2_c4_v4f32(<4 x float> %x) #0 {
42   %y = fmul <4 x float> %x, <float 2.0, float 2.0, float 2.0, float 2.0>
43   %z = fmul <4 x float> %y, <float 4.0, float 4.0, float 4.0, float 4.0>
44   ret <4 x float> %z
45 }
46
47 ; CHECK-LABEL: fmul_c3_c4_v4f32:
48 ; CHECK-NOT: addps
49 ; CHECK: mulps
50 ; CHECK-NOT: mulps
51 ; CHECK-NEXT: ret
52 define <4 x float> @fmul_c3_c4_v4f32(<4 x float> %x) #0 {
53   %y = fmul <4 x float> %x, <float 3.0, float 3.0, float 3.0, float 3.0>
54   %z = fmul <4 x float> %y, <float 4.0, float 4.0, float 4.0, float 4.0>
55   ret <4 x float> %z
56 }
57
58 ; CHECK-LABEL: fmul_c2_c4_f32:
59 ; CHECK-NOT: addss
60 ; CHECK: mulss
61 ; CHECK-NOT: mulss
62 ; CHECK-NEXT: ret
63 define float @fmul_c2_c4_f32(float %x) #0 {
64   %y = fmul float %x, 2.0
65   %z = fmul float %y, 4.0
66   ret float %z
67 }
68
69 ; CHECK-LABEL: fmul_c3_c4_f32:
70 ; CHECK-NOT: addss
71 ; CHECK: mulss
72 ; CHECK-NOT: mulss
73 ; CHECK-NET: ret
74 define float @fmul_c3_c4_f32(float %x) #0 {
75   %y = fmul float %x, 3.0
76   %z = fmul float %y, 4.0
77   ret float %z
78 }
79
80 ; CHECK-LABEL: fmul_fneg_fneg_f32:
81 ; CHECK: mulss %xmm1, %xmm0
82 ; CHECK-NEXT: retq
83 define float @fmul_fneg_fneg_f32(float %x, float %y) {
84   %x.neg = fsub float -0.0, %x
85   %y.neg = fsub float -0.0, %y
86   %mul = fmul float %x.neg, %y.neg
87   ret float %mul
88 }
89 ; CHECK-LABEL: fmul_fneg_fneg_v4f32:
90 ; CHECK: mulps {{%xmm1|\(%rdx\)}}, %xmm0
91 ; CHECK-NEXT: retq
92 define <4 x float> @fmul_fneg_fneg_v4f32(<4 x float> %x, <4 x float> %y) {
93   %x.neg = fsub <4 x float> <float -0.0, float -0.0, float -0.0, float -0.0>, %x
94   %y.neg = fsub <4 x float> <float -0.0, float -0.0, float -0.0, float -0.0>, %y
95   %mul = fmul <4 x float> %x.neg, %y.neg
96   ret <4 x float> %mul
97 }
98
99 attributes #0 = { "less-precise-fpmad"="true" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "unsafe-fp-math"="true" }