X86 cost model: Model cost for uitofp and sitofp on SSE2
[oota-llvm.git] / test / Analysis / CostModel / X86 / sitofp.ll
1 ; RUN: opt -mtriple=x86_64-apple-darwin -mcpu=core2 -cost-model -analyze < %s | FileCheck --check-prefix=SSE2 %s
2
3 define <2 x double> @sitofpv2i8v2double(<2 x i8> %a) {
4   ; SSE2: sitofpv2i8v2double
5   ; SSE2: cost of 20 {{.*}} sitofp
6   %1 = sitofp <2 x i8> %a to <2 x double>
7   ret <2 x double> %1
8 }
9
10 define <4 x double> @sitofpv4i8v4double(<4 x i8> %a) {
11   ; SSE2: sitofpv4i8v4double
12   ; SSE2: cost of 40 {{.*}} sitofp
13   %1 = sitofp <4 x i8> %a to <4 x double>
14   ret <4 x double> %1
15 }
16
17 define <8 x double> @sitofpv8i8v8double(<8 x i8> %a) {
18   ; SSE2: sitofpv8i8v8double
19   ; SSE2: cost of 80 {{.*}} sitofp
20 %1 = sitofp <8 x i8> %a to <8 x double>
21   ret <8 x double> %1
22 }
23
24 define <16 x double> @sitofpv16i8v16double(<16 x i8> %a) {
25   ; SSE2: sitofpv16i8v16double
26   ; SSE2: cost of 160 {{.*}} sitofp
27   %1 = sitofp <16 x i8> %a to <16 x double>
28   ret <16 x double> %1
29 }
30
31 define <32 x double> @sitofpv32i8v32double(<32 x i8> %a) {
32   ; SSE2: sitofpv32i8v32double
33   ; SSE2: cost of 320 {{.*}} sitofp
34   %1 = sitofp <32 x i8> %a to <32 x double>
35   ret <32 x double> %1
36 }
37
38 define <2 x double> @sitofpv2i16v2double(<2 x i16> %a) {
39   ; SSE2: sitofpv2i16v2double
40   ; SSE2: cost of 20 {{.*}} sitofp
41   %1 = sitofp <2 x i16> %a to <2 x double>
42   ret <2 x double> %1
43 }
44
45 define <4 x double> @sitofpv4i16v4double(<4 x i16> %a) {
46   ; SSE2: sitofpv4i16v4double
47   ; SSE2: cost of 40 {{.*}} sitofp
48   %1 = sitofp <4 x i16> %a to <4 x double>
49   ret <4 x double> %1
50 }
51
52 define <8 x double> @sitofpv8i16v8double(<8 x i16> %a) {
53   ; SSE2: sitofpv8i16v8double
54   ; SSE2: cost of 80 {{.*}} sitofp
55   %1 = sitofp <8 x i16> %a to <8 x double>
56   ret <8 x double> %1
57 }
58
59 define <16 x double> @sitofpv16i16v16double(<16 x i16> %a) {
60   ; SSE2: sitofpv16i16v16double
61   ; SSE2: cost of 160 {{.*}} sitofp
62   %1 = sitofp <16 x i16> %a to <16 x double>
63   ret <16 x double> %1
64 }
65
66 define <32 x double> @sitofpv32i16v32double(<32 x i16> %a) {
67   ; SSE2: sitofpv32i16v32double
68   ; SSE2: cost of 320 {{.*}} sitofp
69   %1 = sitofp <32 x i16> %a to <32 x double>
70   ret <32 x double> %1
71 }
72
73 define <2 x double> @sitofpv2i32v2double(<2 x i32> %a) {
74   ; SSE2: sitofpv2i32v2double
75   ; SSE2: cost of 20 {{.*}} sitofp
76   %1 = sitofp <2 x i32> %a to <2 x double>
77   ret <2 x double> %1
78 }
79
80 define <4 x double> @sitofpv4i32v4double(<4 x i32> %a) {
81   ; SSE2: sitofpv4i32v4double
82   ; SSE2: cost of 40 {{.*}} sitofp
83   %1 = sitofp <4 x i32> %a to <4 x double>
84   ret <4 x double> %1
85 }
86
87 define <8 x double> @sitofpv8i32v8double(<8 x i32> %a) {
88   ; SSE2: sitofpv8i32v8double
89   ; SSE2: cost of 80 {{.*}} sitofp
90   %1 = sitofp <8 x i32> %a to <8 x double>
91   ret <8 x double> %1
92 }
93
94 define <16 x double> @sitofpv16i32v16double(<16 x i32> %a) {
95   ; SSE2: sitofpv16i32v16double
96   ; SSE2: cost of 160 {{.*}} sitofp
97   %1 = sitofp <16 x i32> %a to <16 x double>
98   ret <16 x double> %1
99 }
100
101 define <32 x double> @sitofpv32i32v32double(<32 x i32> %a) {
102   ; SSE2: sitofpv32i32v32double
103   ; SSE2: cost of 320 {{.*}} sitofp
104   %1 = sitofp <32 x i32> %a to <32 x double>
105   ret <32 x double> %1
106 }
107
108 define <2 x double> @sitofpv2i64v2double(<2 x i64> %a) {
109   ; SSE2: sitofpv2i64v2double
110   ; SSE2: cost of 20 {{.*}} sitofp
111   %1 = sitofp <2 x i64> %a to <2 x double>
112   ret <2 x double> %1
113 }
114
115 define <4 x double> @sitofpv4i64v4double(<4 x i64> %a) {
116   ; SSE2: sitofpv4i64v4double
117   ; SSE2: cost of 40 {{.*}} sitofp
118   %1 = sitofp <4 x i64> %a to <4 x double>
119   ret <4 x double> %1
120 }
121
122 define <8 x double> @sitofpv8i64v8double(<8 x i64> %a) {
123   %1 = sitofp <8 x i64> %a to <8 x double>
124   ; SSE2: sitofpv8i64v8double
125   ; SSE2: cost of 80 {{.*}} sitofp
126   ret <8 x double> %1
127 }
128
129 define <16 x double> @sitofpv16i64v16double(<16 x i64> %a) {
130   ; SSE2: sitofpv16i64v16double
131   ; SSE2: cost of 160 {{.*}} sitofp
132   %1 = sitofp <16 x i64> %a to <16 x double>
133   ret <16 x double> %1
134 }
135
136 define <32 x double> @sitofpv32i64v32double(<32 x i64> %a) {
137   ; SSE2: sitofpv32i64v32double
138   ; SSE2: cost of 320 {{.*}} sitofp
139   %1 = sitofp <32 x i64> %a to <32 x double>
140   ret <32 x double> %1
141 }
142
143 define <2 x float> @sitofpv2i8v2float(<2 x i8> %a) {
144   ; SSE2: sitofpv2i8v2float
145   ; SSE2: cost of 15 {{.*}} sitofp
146   %1 = sitofp <2 x i8> %a to <2 x float>
147   ret <2 x float> %1
148 }
149
150 define <4 x float> @sitofpv4i8v4float(<4 x i8> %a) {
151   ; SSE2: sitofpv4i8v4float
152   ; SSE2: cost of 15 {{.*}} sitofp
153   %1 = sitofp <4 x i8> %a to <4 x float>
154   ret <4 x float> %1
155 }
156
157 define <8 x float> @sitofpv8i8v8float(<8 x i8> %a) {
158   ; SSE2: sitofpv8i8v8float
159   ; SSE2: cost of 15 {{.*}} sitofp
160   %1 = sitofp <8 x i8> %a to <8 x float>
161   ret <8 x float> %1
162 }
163
164 define <16 x float> @sitofpv16i8v16float(<16 x i8> %a) {
165   ; SSE2: sitofpv16i8v16float
166   ; SSE2: cost of 8 {{.*}} sitofp
167   %1 = sitofp <16 x i8> %a to <16 x float>
168   ret <16 x float> %1
169 }
170
171 define <32 x float> @sitofpv32i8v32float(<32 x i8> %a) {
172   ; SSE2: sitofpv32i8v32float
173   ; SSE2: cost of 16 {{.*}} sitofp
174   %1 = sitofp <32 x i8> %a to <32 x float>
175   ret <32 x float> %1
176 }
177
178 define <2 x float> @sitofpv2i16v2float(<2 x i16> %a) {
179   ; SSE2: sitofpv2i16v2float
180   ; SSE2: cost of 15 {{.*}} sitofp
181   %1 = sitofp <2 x i16> %a to <2 x float>
182   ret <2 x float> %1
183 }
184
185 define <4 x float> @sitofpv4i16v4float(<4 x i16> %a) {
186   ; SSE2: sitofpv4i16v4float
187   ; SSE2: cost of 15 {{.*}} sitofp
188   %1 = sitofp <4 x i16> %a to <4 x float>
189   ret <4 x float> %1
190 }
191
192 define <8 x float> @sitofpv8i16v8float(<8 x i16> %a) {
193   ; SSE2: sitofpv8i16v8float
194   ; SSE2: cost of 15 {{.*}} sitofp
195   %1 = sitofp <8 x i16> %a to <8 x float>
196   ret <8 x float> %1
197 }
198
199 define <16 x float> @sitofpv16i16v16float(<16 x i16> %a) {
200   ; SSE2: sitofpv16i16v16float
201   ; SSE2: cost of 30 {{.*}} sitofp
202   %1 = sitofp <16 x i16> %a to <16 x float>
203   ret <16 x float> %1
204 }
205
206 define <32 x float> @sitofpv32i16v32float(<32 x i16> %a) {
207   ; SSE2: sitofpv32i16v32float
208   ; SSE2: cost of 60 {{.*}} sitofp
209   %1 = sitofp <32 x i16> %a to <32 x float>
210   ret <32 x float> %1
211 }
212
213 define <2 x float> @sitofpv2i32v2float(<2 x i32> %a) {
214   ; SSE2: sitofpv2i32v2float
215   ; SSE2: cost of 15 {{.*}} sitofp
216   %1 = sitofp <2 x i32> %a to <2 x float>
217   ret <2 x float> %1
218 }
219
220 define <4 x float> @sitofpv4i32v4float(<4 x i32> %a) {
221   ; SSE2: sitofpv4i32v4float
222   ; SSE2: cost of 15 {{.*}} sitofp
223   %1 = sitofp <4 x i32> %a to <4 x float>
224   ret <4 x float> %1
225 }
226
227 define <8 x float> @sitofpv8i32v8float(<8 x i32> %a) {
228   ; SSE2: sitofpv8i32v8float
229   ; SSE2: cost of 30 {{.*}} sitofp
230   %1 = sitofp <8 x i32> %a to <8 x float>
231   ret <8 x float> %1
232 }
233
234 define <16 x float> @sitofpv16i32v16float(<16 x i32> %a) {
235   ; SSE2: sitofpv16i32v16float
236   ; SSE2: cost of 60 {{.*}} sitofp
237   %1 = sitofp <16 x i32> %a to <16 x float>
238   ret <16 x float> %1
239 }
240
241 define <32 x float> @sitofpv32i32v32float(<32 x i32> %a) {
242   ; SSE2: sitofpv32i32v32float
243   ; SSE2: cost of 120 {{.*}} sitofp
244   %1 = sitofp <32 x i32> %a to <32 x float>
245   ret <32 x float> %1
246 }
247
248 define <2 x float> @sitofpv2i64v2float(<2 x i64> %a) {
249   ; SSE2: sitofpv2i64v2float
250   ; SSE2: cost of 15 {{.*}} sitofp
251   %1 = sitofp <2 x i64> %a to <2 x float>
252   ret <2 x float> %1
253 }
254
255 define <4 x float> @sitofpv4i64v4float(<4 x i64> %a) {
256   ; SSE2: sitofpv4i64v4float
257   ; SSE2: cost of 30 {{.*}} sitofp
258   %1 = sitofp <4 x i64> %a to <4 x float>
259   ret <4 x float> %1
260 }
261
262 define <8 x float> @sitofpv8i64v8float(<8 x i64> %a) {
263   ; SSE2: sitofpv8i64v8float
264   ; SSE2: cost of 60 {{.*}} sitofp
265   %1 = sitofp <8 x i64> %a to <8 x float>
266   ret <8 x float> %1
267 }
268
269 define <16 x float> @sitofpv16i64v16float(<16 x i64> %a) {
270   ; SSE2: sitofpv16i64v16float
271   ; SSE2: cost of 120 {{.*}} sitofp
272   %1 = sitofp <16 x i64> %a to <16 x float>
273   ret <16 x float> %1
274 }
275
276 define <32 x float> @sitofpv32i64v32float(<32 x i64> %a) {
277   ; SSE2: sitofpv32i64v32float
278   ; SSE2: cost of 240 {{.*}} sitofp
279   %1 = sitofp <32 x i64> %a to <32 x float>
280   ret <32 x float> %1
281 }