• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -mtriple=x86_64-apple-darwin -mattr=+sse2 -cost-model -analyze < %s | FileCheck --check-prefix=SSE --check-prefix=SSE2 %s
2; RUN: opt -mtriple=x86_64-apple-darwin -mattr=+avx  -cost-model -analyze < %s | FileCheck --check-prefix=AVX --check-prefix=AVX1 %s
3; RUN: opt -mtriple=x86_64-apple-darwin -mattr=+avx2 -cost-model -analyze < %s | FileCheck --check-prefix=AVX --check-prefix=AVX2 %s
4; RUN: opt -mtriple=x86_64-apple-darwin -mattr=+avx512f -cost-model -analyze < %s | FileCheck --check-prefix=AVX512F %s
5
6define <2 x double> @sitofpv2i8v2double(<2 x i8> %a) {
7  ; SSE2-LABEL: sitofpv2i8v2double
8  ; SSE2: cost of 20 {{.*}} sitofp
9  ;
10  ; AVX1-LABEL: sitofpv2i8v2double
11  ; AVX1: cost of 4 {{.*}} sitofp
12  ;
13  ; AVX2-LABEL: sitofpv2i8v2double
14  ; AVX2: cost of 4 {{.*}} sitofp
15  ;
16  ; AVX512F-LABEL: sitofpv2i8v2double
17  ; AVX512F: cost of 4 {{.*}} sitofp
18  %1 = sitofp <2 x i8> %a to <2 x double>
19  ret <2 x double> %1
20}
21
22define <4 x double> @sitofpv4i8v4double(<4 x i8> %a) {
23  ; SSE2-LABEL: sitofpv4i8v4double
24  ; SSE2: cost of 40 {{.*}} sitofp
25  ;
26  ; AVX1-LABEL: sitofpv4i8v4double
27  ; AVX1: cost of 3 {{.*}} sitofp
28  ;
29  ; AVX2-LABEL: sitofpv4i8v4double
30  ; AVX2: cost of 3 {{.*}} sitofp
31  ;
32  ; AVX512F-LABEL: sitofpv4i8v4double
33  ; AVX512F: cost of 3 {{.*}} sitofp
34  %1 = sitofp <4 x i8> %a to <4 x double>
35  ret <4 x double> %1
36}
37
38define <8 x double> @sitofpv8i8v8double(<8 x i8> %a) {
39  ; SSE2-LABEL: sitofpv8i8v8double
40  ; SSE2: cost of 80 {{.*}} sitofp
41  ;
42  ; AVX1-LABEL: sitofpv8i8v8double
43  ; AVX1: cost of 20 {{.*}} sitofp
44  ;
45  ; AVX2-LABEL: sitofpv8i8v8double
46  ; AVX2: cost of 20 {{.*}} sitofp
47  ;
48  ; AVX512F-LABEL: sitofpv8i8v8double
49  ; AVX512F: cost of 2 {{.*}} sitofp
50  %1 = sitofp <8 x i8> %a to <8 x double>
51  ret <8 x double> %1
52}
53
54define <16 x double> @sitofpv16i8v16double(<16 x i8> %a) {
55  ; SSE2-LABEL: sitofpv16i8v16double
56  ; SSE2: cost of 160 {{.*}} sitofp
57  ;
58  ; AVX1-LABEL: sitofpv16i8v16double
59  ; AVX1: cost of 40 {{.*}} sitofp
60  ;
61  ; AVX2-LABEL: sitofpv16i8v16double
62  ; AVX2: cost of 40 {{.*}} sitofp
63  ;
64  ; AVX512F-LABEL: sitofpv16i8v16double
65  ; AVX512F: cost of 44 {{.*}} sitofp
66  %1 = sitofp <16 x i8> %a to <16 x double>
67  ret <16 x double> %1
68}
69
70define <32 x double> @sitofpv32i8v32double(<32 x i8> %a) {
71  ; SSE2-LABEL: sitofpv32i8v32double
72  ; SSE2: cost of 320 {{.*}} sitofp
73  ;
74  ; AVX1-LABEL: sitofpv32i8v32double
75  ; AVX1: cost of 80 {{.*}} sitofp
76  ;
77  ; AVX2-LABEL: sitofpv32i8v32double
78  ; AVX2: cost of 80 {{.*}} sitofp
79  ;
80  ; AVX512F-LABEL: sitofpv32i8v32double
81  ; AVX512F: cost of 88 {{.*}} sitofp
82  %1 = sitofp <32 x i8> %a to <32 x double>
83  ret <32 x double> %1
84}
85
86define <2 x double> @sitofpv2i16v2double(<2 x i16> %a) {
87  ; SSE2-LABEL: sitofpv2i16v2double
88  ; SSE2: cost of 20 {{.*}} sitofp
89  ;
90  ; AVX1-LABEL: sitofpv2i16v2double
91  ; AVX1: cost of 4 {{.*}} sitofp
92  ;
93  ; AVX2-LABEL: sitofpv2i16v2double
94  ; AVX2: cost of 4 {{.*}} sitofp
95  ;
96  ; AVX512F-LABEL: sitofpv2i16v2double
97  ; AVX512F: cost of 4 {{.*}} sitofp
98  %1 = sitofp <2 x i16> %a to <2 x double>
99  ret <2 x double> %1
100}
101
102define <4 x double> @sitofpv4i16v4double(<4 x i16> %a) {
103  ; SSE2-LABEL: sitofpv4i16v4double
104  ; SSE2: cost of 40 {{.*}} sitofp
105  ;
106  ; AVX1-LABEL: sitofpv4i16v4double
107  ; AVX1: cost of 3 {{.*}} sitofp
108  ;
109  ; AVX2-LABEL: sitofpv4i16v4double
110  ; AVX2: cost of 3 {{.*}} sitofp
111  ;
112  ; AVX512F-LABEL: sitofpv4i16v4double
113  ; AVX512F: cost of 3 {{.*}} sitofp
114  %1 = sitofp <4 x i16> %a to <4 x double>
115  ret <4 x double> %1
116}
117
118define <8 x double> @sitofpv8i16v8double(<8 x i16> %a) {
119  ; SSE2-LABEL: sitofpv8i16v8double
120  ; SSE2: cost of 80 {{.*}} sitofp
121  ;
122  ; AVX1-LABEL: sitofpv8i16v8double
123  ; AVX1: cost of 20 {{.*}} sitofp
124  ;
125  ; AVX2-LABEL: sitofpv8i16v8double
126  ; AVX2: cost of 20 {{.*}} sitofp
127  ;
128  ; AVX512F-LABEL: sitofpv8i16v8double
129  ; AVX512F: cost of 2 {{.*}} sitofp
130  %1 = sitofp <8 x i16> %a to <8 x double>
131  ret <8 x double> %1
132}
133
134define <16 x double> @sitofpv16i16v16double(<16 x i16> %a) {
135  ; SSE2-LABEL: sitofpv16i16v16double
136  ; SSE2: cost of 160 {{.*}} sitofp
137  ;
138  ; AVX1-LABEL: sitofpv16i16v16double
139  ; AVX1: cost of 40 {{.*}} sitofp
140  ;
141  ; AVX2-LABEL: sitofpv16i16v16double
142  ; AVX2: cost of 40 {{.*}} sitofp
143  ;
144  ; AVX512F-LABEL: sitofpv16i16v16double
145  ; AVX512F: cost of 44 {{.*}} sitofp
146  %1 = sitofp <16 x i16> %a to <16 x double>
147  ret <16 x double> %1
148}
149
150define <32 x double> @sitofpv32i16v32double(<32 x i16> %a) {
151  ; SSE2-LABEL: sitofpv32i16v32double
152  ; SSE2: cost of 320 {{.*}} sitofp
153  ;
154  ; AVX1-LABEL: sitofpv32i16v32double
155  ; AVX1: cost of 80 {{.*}} sitofp
156  ;
157  ; AVX2-LABEL: sitofpv32i16v32double
158  ; AVX2: cost of 80 {{.*}} sitofp
159  ;
160  ; AVX512F-LABEL: sitofpv32i16v32double
161  ; AVX512F: cost of 88 {{.*}} sitofp
162  %1 = sitofp <32 x i16> %a to <32 x double>
163  ret <32 x double> %1
164}
165
166define <2 x double> @sitofpv2i32v2double(<2 x i32> %a) {
167  ; SSE2-LABEL: sitofpv2i32v2double
168  ; SSE2: cost of 20 {{.*}} sitofp
169  ;
170  ; AVX1-LABEL: sitofpv2i32v2double
171  ; AVX1: cost of 4 {{.*}} sitofp
172  ;
173  ; AVX2-LABEL: sitofpv2i32v2double
174  ; AVX2: cost of 4 {{.*}} sitofp
175  ;
176  ; AVX512F-LABEL: sitofpv2i32v2double
177  ; AVX512F: cost of 4 {{.*}} sitofp
178  %1 = sitofp <2 x i32> %a to <2 x double>
179  ret <2 x double> %1
180}
181
182define <4 x double> @sitofpv4i32v4double(<4 x i32> %a) {
183  ; SSE2-LABEL: sitofpv4i32v4double
184  ; SSE2: cost of 40 {{.*}} sitofp
185  ;
186  ; AVX1-LABEL: sitofpv4i32v4double
187  ; AVX1: cost of 1 {{.*}} sitofp
188  ;
189  ; AVX2-LABEL: sitofpv4i32v4double
190  ; AVX2: cost of 1 {{.*}} sitofp
191  ;
192  ; AVX512F-LABEL: sitofpv4i32v4double
193  ; AVX512F: cost of 1 {{.*}} sitofp
194  %1 = sitofp <4 x i32> %a to <4 x double>
195  ret <4 x double> %1
196}
197
198define <8 x double> @sitofpv8i32v8double(<8 x i32> %a) {
199  ; SSE2-LABEL: sitofpv8i32v8double
200  ; SSE2: cost of 80 {{.*}} sitofp
201  ;
202  ; AVX1-LABEL: sitofpv8i32v8double
203  ; AVX1: cost of 20 {{.*}} sitofp
204  ;
205  ; AVX2-LABEL: sitofpv8i32v8double
206  ; AVX2: cost of 20 {{.*}} sitofp
207  ;
208  ; AVX512F-LABEL: sitofpv8i32v8double
209  ; AVX512F: cost of 1 {{.*}} sitofp
210  %1 = sitofp <8 x i32> %a to <8 x double>
211  ret <8 x double> %1
212}
213
214define <16 x double> @sitofpv16i32v16double(<16 x i32> %a) {
215  ; SSE2-LABEL: sitofpv16i32v16double
216  ; SSE2: cost of 160 {{.*}} sitofp
217  ;
218  ; AVX1-LABEL: sitofpv16i32v16double
219  ; AVX1: cost of 40 {{.*}} sitofp
220  ;
221  ; AVX2-LABEL: sitofpv16i32v16double
222  ; AVX2: cost of 40 {{.*}} sitofp
223  ;
224  ; AVX512F-LABEL: sitofpv16i32v16double
225  ; AVX512F: cost of 44 {{.*}} sitofp
226  %1 = sitofp <16 x i32> %a to <16 x double>
227  ret <16 x double> %1
228}
229
230define <32 x double> @sitofpv32i32v32double(<32 x i32> %a) {
231  ; SSE2-LABEL: sitofpv32i32v32double
232  ; SSE2: cost of 320 {{.*}} sitofp
233  ;
234  ; AVX1-LABEL: sitofpv32i32v32double
235  ; AVX1: cost of 80 {{.*}} sitofp
236  ;
237  ; AVX2-LABEL: sitofpv32i32v32double
238  ; AVX2: cost of 80 {{.*}} sitofp
239  ;
240  ; AVX512F-LABEL: sitofpv32i32v32double
241  ; AVX512F: cost of 88 {{.*}} sitofp
242  %1 = sitofp <32 x i32> %a to <32 x double>
243  ret <32 x double> %1
244}
245
246define <2 x double> @sitofpv2i64v2double(<2 x i64> %a) {
247  ; SSE2-LABEL: sitofpv2i64v2double
248  ; SSE2: cost of 20 {{.*}} sitofp
249  ;
250  ; AVX1-LABEL: sitofpv2i64v2double
251  ; AVX1: cost of 20 {{.*}} sitofp
252  ;
253  ; AVX2-LABEL: sitofpv2i64v2double
254  ; AVX2: cost of 20 {{.*}} sitofp
255  ;
256  ; AVX512F-LABEL: sitofpv2i64v2double
257  ; AVX512F: cost of 20 {{.*}} sitofp
258  %1 = sitofp <2 x i64> %a to <2 x double>
259  ret <2 x double> %1
260}
261
262define <4 x double> @sitofpv4i64v4double(<4 x i64> %a) {
263  ; SSE2-LABEL: sitofpv4i64v4double
264  ; SSE2: cost of 40 {{.*}} sitofp
265  ;
266  ; AVX1-LABEL: sitofpv4i64v4double
267  ; AVX1: cost of 10 {{.*}} sitofp
268  ;
269  ; AVX2-LABEL: sitofpv4i64v4double
270  ; AVX2: cost of 10 {{.*}} sitofp
271  ;
272  ; AVX512F-LABEL: sitofpv4i64v4double
273  ; AVX512F: cost of 10 {{.*}} sitofp
274  %1 = sitofp <4 x i64> %a to <4 x double>
275  ret <4 x double> %1
276}
277
278define <8 x double> @sitofpv8i64v8double(<8 x i64> %a) {
279  ; SSE2-LABEL: sitofpv8i64v8double
280  ; SSE2: cost of 80 {{.*}} sitofp
281  ;
282  ; AVX1-LABEL: sitofpv8i64v8double
283  ; AVX1: cost of 20 {{.*}} sitofp
284  ;
285  ; AVX2-LABEL: sitofpv8i64v8double
286  ; AVX2: cost of 20 {{.*}} sitofp
287  ;
288  ; AVX512F-LABEL: sitofpv8i64v8double
289  ; AVX512F: cost of 22 {{.*}} sitofp
290  %1 = sitofp <8 x i64> %a to <8 x double>
291  ret <8 x double> %1
292}
293
294define <16 x double> @sitofpv16i64v16double(<16 x i64> %a) {
295  ; SSE2-LABEL: sitofpv16i64v16double
296  ; SSE2: cost of 160 {{.*}} sitofp
297  ;
298  ; AVX1-LABEL: sitofpv16i64v16double
299  ; AVX1: cost of 40 {{.*}} sitofp
300  ;
301  ; AVX2-LABEL: sitofpv16i64v16double
302  ; AVX2: cost of 40 {{.*}} sitofp
303  ;
304  ; AVX512F-LABEL: sitofpv16i64v16double
305  ; AVX512F: cost of 44 {{.*}} sitofp
306  %1 = sitofp <16 x i64> %a to <16 x double>
307  ret <16 x double> %1
308}
309
310define <32 x double> @sitofpv32i64v32double(<32 x i64> %a) {
311  ; SSE2-LABEL: sitofpv32i64v32double
312  ; SSE2: cost of 320 {{.*}} sitofp
313  ;
314  ; AVX1-LABEL: sitofpv32i64v32double
315  ; AVX1: cost of 80 {{.*}} sitofp
316  ;
317  ; AVX2-LABEL: sitofpv32i64v32double
318  ; AVX2: cost of 80 {{.*}} sitofp
319  ;
320  ; AVX512F-LABEL: sitofpv32i64v32double
321  ; AVX512F: cost of 88 {{.*}} sitofp
322  %1 = sitofp <32 x i64> %a to <32 x double>
323  ret <32 x double> %1
324}
325
326define <2 x float> @sitofpv2i8v2float(<2 x i8> %a) {
327  ; SSE2-LABEL: sitofpv2i8v2float
328  ; SSE2: cost of 15 {{.*}} sitofp
329  ;
330  ; AVX1-LABEL: sitofpv2i8v2float
331  ; AVX1: cost of 4 {{.*}} sitofp
332  ;
333  ; AVX2-LABEL: sitofpv2i8v2float
334  ; AVX2: cost of 4 {{.*}} sitofp
335  ;
336  ; AVX512F-LABEL: sitofpv2i8v2float
337  ; AVX512F: cost of 4 {{.*}} sitofp
338  %1 = sitofp <2 x i8> %a to <2 x float>
339  ret <2 x float> %1
340}
341
342define <4 x float> @sitofpv4i8v4float(<4 x i8> %a) {
343  ; SSE2-LABEL: sitofpv4i8v4float
344  ; SSE2: cost of 15 {{.*}} sitofp
345  ;
346  ; AVX1-LABEL: sitofpv4i8v4float
347  ; AVX1: cost of 3 {{.*}} sitofp
348  ;
349  ; AVX2-LABEL: sitofpv4i8v4float
350  ; AVX2: cost of 3 {{.*}} sitofp
351  ;
352  ; AVX512F-LABEL: sitofpv4i8v4float
353  ; AVX512F: cost of 3 {{.*}} sitofp
354  %1 = sitofp <4 x i8> %a to <4 x float>
355  ret <4 x float> %1
356}
357
358define <8 x float> @sitofpv8i8v8float(<8 x i8> %a) {
359  ; SSE2-LABEL: sitofpv8i8v8float
360  ; SSE2: cost of 15 {{.*}} sitofp
361  ;
362  ; AVX1-LABEL: sitofpv8i8v8float
363  ; AVX1: cost of 8 {{.*}} sitofp
364  ;
365  ; AVX2-LABEL: sitofpv8i8v8float
366  ; AVX2: cost of 8 {{.*}} sitofp
367  ;
368  ; AVX512F-LABEL: sitofpv8i8v8float
369  ; AVX512F: cost of 8 {{.*}} sitofp
370  %1 = sitofp <8 x i8> %a to <8 x float>
371  ret <8 x float> %1
372}
373
374define <16 x float> @sitofpv16i8v16float(<16 x i8> %a) {
375  ; SSE2-LABEL: sitofpv16i8v16float
376  ; SSE2: cost of 8 {{.*}} sitofp
377  ;
378  ; AVX1-LABEL: sitofpv16i8v16float
379  ; AVX1: cost of 44 {{.*}} sitofp
380  ;
381  ; AVX2-LABEL: sitofpv16i8v16float
382  ; AVX2: cost of 44 {{.*}} sitofp
383  ;
384  ; AVX512F-LABEL: sitofpv16i8v16float
385  ; AVX512F: cost of 2 {{.*}} sitofp
386  %1 = sitofp <16 x i8> %a to <16 x float>
387  ret <16 x float> %1
388}
389
390define <32 x float> @sitofpv32i8v32float(<32 x i8> %a) {
391  ; SSE2-LABEL: sitofpv32i8v32float
392  ; SSE2: cost of 16 {{.*}} sitofp
393  ;
394  ; AVX1-LABEL: sitofpv32i8v32float
395  ; AVX1: cost of 88 {{.*}} sitofp
396  ;
397  ; AVX2-LABEL: sitofpv32i8v32float
398  ; AVX2: cost of 88 {{.*}} sitofp
399  ;
400  ; AVX512F-LABEL: sitofpv32i8v32float
401  ; AVX512F: cost of 92 {{.*}} sitofp
402  %1 = sitofp <32 x i8> %a to <32 x float>
403  ret <32 x float> %1
404}
405
406define <2 x float> @sitofpv2i16v2float(<2 x i16> %a) {
407  ; SSE2-LABEL: sitofpv2i16v2float
408  ; SSE2: cost of 15 {{.*}} sitofp
409  ;
410  ; AVX1-LABEL: sitofpv2i16v2float
411  ; AVX1: cost of 4 {{.*}} sitofp
412  ;
413  ; AVX2-LABEL: sitofpv2i16v2float
414  ; AVX2: cost of 4 {{.*}} sitofp
415  ;
416  ; AVX512F-LABEL: sitofpv2i16v2float
417  ; AVX512F: cost of 4 {{.*}} sitofp
418  %1 = sitofp <2 x i16> %a to <2 x float>
419  ret <2 x float> %1
420}
421
422define <4 x float> @sitofpv4i16v4float(<4 x i16> %a) {
423  ; SSE2-LABEL: sitofpv4i16v4float
424  ; SSE2: cost of 15 {{.*}} sitofp
425  ;
426  ; AVX1-LABEL: sitofpv4i16v4float
427  ; AVX1: cost of 3 {{.*}} sitofp
428  ;
429  ; AVX2-LABEL: sitofpv4i16v4float
430  ; AVX2: cost of 3 {{.*}} sitofp
431  ;
432  ; AVX512F-LABEL: sitofpv4i16v4float
433  ; AVX512F: cost of 3 {{.*}} sitofp
434  %1 = sitofp <4 x i16> %a to <4 x float>
435  ret <4 x float> %1
436}
437
438define <8 x float> @sitofpv8i16v8float(<8 x i16> %a) {
439  ; SSE2-LABEL: sitofpv8i16v8float
440  ; SSE2: cost of 15 {{.*}} sitofp
441  ;
442  ; AVX1-LABEL: sitofpv8i16v8float
443  ; AVX1: cost of 5 {{.*}} sitofp
444  ;
445  ; AVX2-LABEL: sitofpv8i16v8float
446  ; AVX2: cost of 5 {{.*}} sitofp
447  ;
448  ; AVX512F-LABEL: sitofpv8i16v8float
449  ; AVX512F: cost of 5 {{.*}} sitofp
450  %1 = sitofp <8 x i16> %a to <8 x float>
451  ret <8 x float> %1
452}
453
454define <16 x float> @sitofpv16i16v16float(<16 x i16> %a) {
455  ; SSE2-LABEL: sitofpv16i16v16float
456  ; SSE2: cost of 30 {{.*}} sitofp
457  ;
458  ; AVX1-LABEL: sitofpv16i16v16float
459  ; AVX1: cost of 44 {{.*}} sitofp
460  ;
461  ; AVX2-LABEL: sitofpv16i16v16float
462  ; AVX2: cost of 44 {{.*}} sitofp
463  ;
464  ; AVX512F-LABEL: sitofpv16i16v16float
465  ; AVX512F: cost of 2 {{.*}} sitofp
466  %1 = sitofp <16 x i16> %a to <16 x float>
467  ret <16 x float> %1
468}
469
470define <32 x float> @sitofpv32i16v32float(<32 x i16> %a) {
471  ; SSE2-LABEL: sitofpv32i16v32float
472  ; SSE2: cost of 60 {{.*}} sitofp
473  ;
474  ; AVX1-LABEL: sitofpv32i16v32float
475  ; AVX1: cost of 88 {{.*}} sitofp
476  ;
477  ; AVX2-LABEL: sitofpv32i16v32float
478  ; AVX2: cost of 88 {{.*}} sitofp
479  ;
480  ; AVX512F-LABEL: sitofpv32i16v32float
481  ; AVX512F: cost of 92 {{.*}} sitofp
482  %1 = sitofp <32 x i16> %a to <32 x float>
483  ret <32 x float> %1
484}
485
486define <2 x float> @sitofpv2i32v2float(<2 x i32> %a) {
487  ; SSE2-LABEL: sitofpv2i32v2float
488  ; SSE2: cost of 15 {{.*}} sitofp
489  ;
490  ; AVX1-LABEL: sitofpv2i32v2float
491  ; AVX1: cost of 4 {{.*}} sitofp
492  ;
493  ; AVX2-LABEL: sitofpv2i32v2float
494  ; AVX2: cost of 4 {{.*}} sitofp
495  ;
496  ; AVX512F-LABEL: sitofpv2i32v2float
497  ; AVX512F: cost of 4 {{.*}} sitofp
498  %1 = sitofp <2 x i32> %a to <2 x float>
499  ret <2 x float> %1
500}
501
502define <4 x float> @sitofpv4i32v4float(<4 x i32> %a) {
503  ; SSE2-LABEL: sitofpv4i32v4float
504  ; SSE2: cost of 15 {{.*}} sitofp
505  ;
506  ; AVX1-LABEL: sitofpv4i32v4float
507  ; AVX1: cost of 1 {{.*}} sitofp
508  ;
509  ; AVX2-LABEL: sitofpv4i32v4float
510  ; AVX2: cost of 1 {{.*}} sitofp
511  ;
512  ; AVX512F-LABEL: sitofpv4i32v4float
513  ; AVX512F: cost of 1 {{.*}} sitofp
514  %1 = sitofp <4 x i32> %a to <4 x float>
515  ret <4 x float> %1
516}
517
518define <8 x float> @sitofpv8i32v8float(<8 x i32> %a) {
519  ; SSE2-LABEL: sitofpv8i32v8float
520  ; SSE2: cost of 30 {{.*}} sitofp
521  ;
522  ; AVX1-LABEL: sitofpv8i32v8float
523  ; AVX1: cost of 1 {{.*}} sitofp
524  ;
525  ; AVX2-LABEL: sitofpv8i32v8float
526  ; AVX2: cost of 1 {{.*}} sitofp
527  ;
528  ; AVX512F-LABEL: sitofpv8i32v8float
529  ; AVX512F: cost of 1 {{.*}} sitofp
530  %1 = sitofp <8 x i32> %a to <8 x float>
531  ret <8 x float> %1
532}
533
534define <16 x float> @sitofpv16i32v16float(<16 x i32> %a) {
535  ; SSE2-LABEL: sitofpv16i32v16float
536  ; SSE2: cost of 60 {{.*}} sitofp
537  ;
538  ; AVX1-LABEL: sitofpv16i32v16float
539  ; AVX1: cost of 44 {{.*}} sitofp
540  ;
541  ; AVX2-LABEL: sitofpv16i32v16float
542  ; AVX2: cost of 44 {{.*}} sitofp
543  ;
544  ; AVX512F-LABEL: sitofpv16i32v16float
545  ; AVX512F: cost of 1 {{.*}} sitofp
546  %1 = sitofp <16 x i32> %a to <16 x float>
547  ret <16 x float> %1
548}
549
550define <32 x float> @sitofpv32i32v32float(<32 x i32> %a) {
551  ; SSE2-LABEL: sitofpv32i32v32float
552  ; SSE2: cost of 120 {{.*}} sitofp
553  ;
554  ; AVX1-LABEL: sitofpv32i32v32float
555  ; AVX1: cost of 88 {{.*}} sitofp
556  ;
557  ; AVX2-LABEL: sitofpv32i32v32float
558  ; AVX2: cost of 88 {{.*}} sitofp
559  ;
560  ; AVX512F-LABEL: sitofpv32i32v32float
561  ; AVX512F: cost of 92 {{.*}} sitofp
562  %1 = sitofp <32 x i32> %a to <32 x float>
563  ret <32 x float> %1
564}
565
566define <2 x float> @sitofpv2i64v2float(<2 x i64> %a) {
567  ; SSE2-LABEL: sitofpv2i64v2float
568  ; SSE2: cost of 15 {{.*}} sitofp
569  ;
570  ; AVX1-LABEL: sitofpv2i64v2float
571  ; AVX1: cost of 4 {{.*}} sitofp
572  ;
573  ; AVX2-LABEL: sitofpv2i64v2float
574  ; AVX2: cost of 4 {{.*}} sitofp
575  ;
576  ; AVX512F-LABEL: sitofpv2i64v2float
577  ; AVX512F: cost of 4 {{.*}} sitofp
578  %1 = sitofp <2 x i64> %a to <2 x float>
579  ret <2 x float> %1
580}
581
582define <4 x float> @sitofpv4i64v4float(<4 x i64> %a) {
583  ; SSE2-LABEL: sitofpv4i64v4float
584  ; SSE2: cost of 30 {{.*}} sitofp
585  ;
586  ; AVX1-LABEL: sitofpv4i64v4float
587  ; AVX1: cost of 10 {{.*}} sitofp
588  ;
589  ; AVX2-LABEL: sitofpv4i64v4float
590  ; AVX2: cost of 10 {{.*}} sitofp
591  ;
592  ; AVX512F-LABEL: sitofpv4i64v4float
593  ; AVX512F: cost of 10 {{.*}} sitofp
594  %1 = sitofp <4 x i64> %a to <4 x float>
595  ret <4 x float> %1
596}
597
598define <8 x float> @sitofpv8i64v8float(<8 x i64> %a) {
599  ; SSE2-LABEL: sitofpv8i64v8float
600  ; SSE2: cost of 60 {{.*}} sitofp
601  ;
602  ; AVX1-LABEL: sitofpv8i64v8float
603  ; AVX1: cost of 22 {{.*}} sitofp
604  ;
605  ; AVX2-LABEL: sitofpv8i64v8float
606  ; AVX2: cost of 22 {{.*}} sitofp
607  ;
608  ; AVX512F-LABEL: sitofpv8i64v8float
609  ; AVX512F: cost of 22 {{.*}} sitofp
610  %1 = sitofp <8 x i64> %a to <8 x float>
611  ret <8 x float> %1
612}
613
614define <16 x float> @sitofpv16i64v16float(<16 x i64> %a) {
615  ; SSE2-LABEL: sitofpv16i64v16float
616  ; SSE2: cost of 120 {{.*}} sitofp
617  ;
618  ; AVX1-LABEL: sitofpv16i64v16float
619  ; AVX1: cost of 44 {{.*}} sitofp
620  ;
621  ; AVX2-LABEL: sitofpv16i64v16float
622  ; AVX2: cost of 44 {{.*}} sitofp
623  ;
624  ; AVX512F-LABEL: sitofpv16i64v16float
625  ; AVX512F: cost of 46 {{.*}} sitofp
626  %1 = sitofp <16 x i64> %a to <16 x float>
627  ret <16 x float> %1
628}
629
630define <32 x float> @sitofpv32i64v32float(<32 x i64> %a) {
631  ; SSE2-LABEL: sitofpv32i64v32float
632  ; SSE2: cost of 240 {{.*}} sitofp
633  ;
634  ; AVX1-LABEL: sitofpv32i64v32float
635  ; AVX1: cost of 88 {{.*}} sitofp
636  ;
637  ; AVX2-LABEL: sitofpv32i64v32float
638  ; AVX2: cost of 88 {{.*}} sitofp
639  ;
640  ; AVX512F-LABEL: sitofpv32i64v32float
641  ; AVX512F: cost of 92 {{.*}} sitofp
642  %1 = sitofp <32 x i64> %a to <32 x float>
643  ret <32 x float> %1
644}
645
646define <8 x double> @sitofpv8i1v8double(<8 x double> %a) {
647  ; SSE2-LABEL: sitofpv8i1v8double
648  ; SSE2: cost of 80 {{.*}} sitofp
649  ;
650  ; AVX1-LABEL: sitofpv8i1v8double
651  ; AVX1: cost of 20 {{.*}} sitofp
652  ;
653  ; AVX2-LABEL: sitofpv8i1v8double
654  ; AVX2: cost of 20 {{.*}} sitofp
655  ;
656  ; AVX512F-LABEL: sitofpv8i1v8double
657  ; AVX512F: cost of 4 {{.*}} sitofp
658  %cmpres = fcmp ogt <8 x double> %a, zeroinitializer
659  %1 = sitofp <8 x i1> %cmpres to <8 x double>
660  ret <8 x double> %1
661}
662
663define <16 x float> @sitofpv16i1v16float(<16 x float> %a) {
664  ; SSE2-LABEL: sitofpv16i1v16float
665  ; SSE2: cost of 8 {{.*}} sitofp
666  ;
667  ; AVX1-LABEL: sitofpv16i1v16float
668  ; AVX1: cost of 44 {{.*}} sitofp
669  ;
670  ; AVX2-LABEL: sitofpv16i1v16float
671  ; AVX2: cost of 44 {{.*}} sitofp
672  ;
673  ; AVX512F-LABEL: sitofpv16i1v16float
674  ; AVX512F: cost of 3 {{.*}} sitofp
675  %cmpres = fcmp ogt <16 x float> %a, zeroinitializer
676  %1 = sitofp <16 x i1> %cmpres to <16 x float>
677  ret <16 x float> %1
678}
679