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