1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=ALL --check-prefix=NOVL --check-prefix=NODQ --check-prefix=NOVLDQ --check-prefix=KNL
3 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq | FileCheck %s --check-prefix=ALL --check-prefix=VL --check-prefix=VLDQ --check-prefix=VLBW --check-prefix=SKX
4 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512vl | FileCheck %s --check-prefix=ALL --check-prefix=NODQ --check-prefix=VL --check-prefix=VLNODQ --check-prefix=VLNOBW --check-prefix=AVX512VL
5 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512dq | FileCheck %s --check-prefix=ALL --check-prefix=NOVL --check-prefix=DQNOVL --check-prefix=AVX512DQ
6 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=NOVL --check-prefix=NODQ --check-prefix=NOVLDQ --check-prefix=AVX512BW
7 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512vl,avx512dq | FileCheck %s --check-prefix=ALL --check-prefix=VL --check-prefix=VLDQ --check-prefix=VLNOBW --check-prefix=AVX512VLDQ
8 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512vl,avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=NODQ --check-prefix=VL --check-prefix=VLNODQ --check-prefix=VLBW --check-prefix=AVX512VLBW
11 define <16 x float> @sitof32(<16 x i32> %a) nounwind {
14 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
16 %b = sitofp <16 x i32> %a to <16 x float>
20 define <8 x double> @sltof864(<8 x i64> %a) {
21 ; NODQ-LABEL: sltof864:
23 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm1
24 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
25 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm2, %xmm2
26 ; NODQ-NEXT: vmovq %xmm1, %rax
27 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm1
28 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
29 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
30 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
31 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
32 ; NODQ-NEXT: vmovq %xmm2, %rax
33 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
34 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
35 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
36 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm2
37 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
38 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
39 ; NODQ-NEXT: vmovq %xmm2, %rax
40 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
41 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
42 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
43 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
44 ; NODQ-NEXT: vmovq %xmm0, %rax
45 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm0
46 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm3[0]
47 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
48 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
51 ; VLDQ-LABEL: sltof864:
53 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
56 ; DQNOVL-LABEL: sltof864:
58 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
60 %b = sitofp <8 x i64> %a to <8 x double>
64 define <4 x double> @slto4f64(<4 x i64> %a) {
65 ; NODQ-LABEL: slto4f64:
67 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm1
68 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
69 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm2, %xmm2
70 ; NODQ-NEXT: vmovq %xmm1, %rax
71 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm1
72 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
73 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
74 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm2
75 ; NODQ-NEXT: vmovq %xmm0, %rax
76 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm0
77 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm2[0]
78 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
81 ; VLDQ-LABEL: slto4f64:
83 ; VLDQ-NEXT: vcvtqq2pd %ymm0, %ymm0
86 ; DQNOVL-LABEL: slto4f64:
88 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
89 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
90 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
92 %b = sitofp <4 x i64> %a to <4 x double>
96 define <2 x double> @slto2f64(<2 x i64> %a) {
97 ; NODQ-LABEL: slto2f64:
99 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
100 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm1, %xmm1
101 ; NODQ-NEXT: vmovq %xmm0, %rax
102 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm2, %xmm0
103 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
106 ; VLDQ-LABEL: slto2f64:
108 ; VLDQ-NEXT: vcvtqq2pd %xmm0, %xmm0
111 ; DQNOVL-LABEL: slto2f64:
113 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
114 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
115 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
116 ; DQNOVL-NEXT: vzeroupper
118 %b = sitofp <2 x i64> %a to <2 x double>
122 define <2 x float> @sltof2f32(<2 x i64> %a) {
123 ; NOVLDQ-LABEL: sltof2f32:
125 ; NOVLDQ-NEXT: vpextrq $1, %xmm0, %rax
126 ; NOVLDQ-NEXT: vcvtsi2ss %rax, %xmm1, %xmm1
127 ; NOVLDQ-NEXT: vmovq %xmm0, %rax
128 ; NOVLDQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm0
129 ; NOVLDQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],zero,zero
132 ; VLDQ-LABEL: sltof2f32:
134 ; VLDQ-NEXT: vcvtqq2ps %xmm0, %xmm0
137 ; VLNODQ-LABEL: sltof2f32:
139 ; VLNODQ-NEXT: vpextrq $1, %xmm0, %rax
140 ; VLNODQ-NEXT: vcvtsi2ss %rax, %xmm1, %xmm1
141 ; VLNODQ-NEXT: vmovq %xmm0, %rax
142 ; VLNODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm0
143 ; VLNODQ-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
144 ; VLNODQ-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero
147 ; DQNOVL-LABEL: sltof2f32:
149 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
150 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
151 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
152 ; DQNOVL-NEXT: vzeroupper
154 %b = sitofp <2 x i64> %a to <2 x float>
158 define <4 x float> @slto4f32_mem(<4 x i64>* %a) {
159 ; NODQ-LABEL: slto4f32_mem:
161 ; NODQ-NEXT: vmovdqu (%rdi), %xmm0
162 ; NODQ-NEXT: vmovdqu 16(%rdi), %xmm1
163 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
164 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
165 ; NODQ-NEXT: vmovq %xmm0, %rax
166 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm0
167 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
168 ; NODQ-NEXT: vmovq %xmm1, %rax
169 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm2
170 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm2[0],xmm0[3]
171 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
172 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm1
173 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm1[0]
176 ; VLDQ-LABEL: slto4f32_mem:
178 ; VLDQ-NEXT: vcvtqq2psy (%rdi), %xmm0
181 ; DQNOVL-LABEL: slto4f32_mem:
183 ; DQNOVL-NEXT: vmovups (%rdi), %ymm0
184 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
185 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
186 ; DQNOVL-NEXT: vzeroupper
188 %a1 = load <4 x i64>, <4 x i64>* %a, align 8
189 %b = sitofp <4 x i64> %a1 to <4 x float>
193 define <4 x i64> @f64to4sl(<4 x double> %a) {
194 ; NODQ-LABEL: f64to4sl:
196 ; NODQ-NEXT: vextractf128 $1, %ymm0, %xmm1
197 ; NODQ-NEXT: vcvttsd2si %xmm1, %rax
198 ; NODQ-NEXT: vmovq %rax, %xmm2
199 ; NODQ-NEXT: vpermilpd {{.*#+}} xmm1 = xmm1[1,0]
200 ; NODQ-NEXT: vcvttsd2si %xmm1, %rax
201 ; NODQ-NEXT: vmovq %rax, %xmm1
202 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
203 ; NODQ-NEXT: vcvttsd2si %xmm0, %rax
204 ; NODQ-NEXT: vmovq %rax, %xmm2
205 ; NODQ-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0]
206 ; NODQ-NEXT: vcvttsd2si %xmm0, %rax
207 ; NODQ-NEXT: vmovq %rax, %xmm0
208 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
209 ; NODQ-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
212 ; VLDQ-LABEL: f64to4sl:
214 ; VLDQ-NEXT: vcvttpd2qq %ymm0, %ymm0
217 ; DQNOVL-LABEL: f64to4sl:
219 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
220 ; DQNOVL-NEXT: vcvttpd2qq %zmm0, %zmm0
221 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
223 %b = fptosi <4 x double> %a to <4 x i64>
227 define <4 x i64> @f32to4sl(<4 x float> %a) {
228 ; NODQ-LABEL: f32to4sl:
230 ; NODQ-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[3,1,2,3]
231 ; NODQ-NEXT: vcvttss2si %xmm1, %rax
232 ; NODQ-NEXT: vmovq %rax, %xmm1
233 ; NODQ-NEXT: vpermilpd {{.*#+}} xmm2 = xmm0[1,0]
234 ; NODQ-NEXT: vcvttss2si %xmm2, %rax
235 ; NODQ-NEXT: vmovq %rax, %xmm2
236 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
237 ; NODQ-NEXT: vcvttss2si %xmm0, %rax
238 ; NODQ-NEXT: vmovq %rax, %xmm2
239 ; NODQ-NEXT: vmovshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
240 ; NODQ-NEXT: vcvttss2si %xmm0, %rax
241 ; NODQ-NEXT: vmovq %rax, %xmm0
242 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
243 ; NODQ-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
246 ; VLDQ-LABEL: f32to4sl:
248 ; VLDQ-NEXT: vcvttps2qq %xmm0, %ymm0
251 ; DQNOVL-LABEL: f32to4sl:
253 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
254 ; DQNOVL-NEXT: vcvttps2qq %ymm0, %zmm0
255 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
257 %b = fptosi <4 x float> %a to <4 x i64>
261 define <4 x float> @slto4f32(<4 x i64> %a) {
262 ; NODQ-LABEL: slto4f32:
264 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
265 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm1, %xmm1
266 ; NODQ-NEXT: vmovq %xmm0, %rax
267 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
268 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
269 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
270 ; NODQ-NEXT: vmovq %xmm0, %rax
271 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm2
272 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
273 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
274 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm0
275 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
276 ; NODQ-NEXT: vzeroupper
279 ; VLDQ-LABEL: slto4f32:
281 ; VLDQ-NEXT: vcvtqq2ps %ymm0, %xmm0
282 ; VLDQ-NEXT: vzeroupper
285 ; DQNOVL-LABEL: slto4f32:
287 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
288 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
289 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
290 ; DQNOVL-NEXT: vzeroupper
292 %b = sitofp <4 x i64> %a to <4 x float>
296 define <4 x float> @ulto4f32(<4 x i64> %a) {
297 ; NODQ-LABEL: ulto4f32:
299 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
300 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm1, %xmm1
301 ; NODQ-NEXT: vmovq %xmm0, %rax
302 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm2, %xmm2
303 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
304 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
305 ; NODQ-NEXT: vmovq %xmm0, %rax
306 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm2
307 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
308 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
309 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm0
310 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
311 ; NODQ-NEXT: vzeroupper
314 ; VLDQ-LABEL: ulto4f32:
316 ; VLDQ-NEXT: vcvtuqq2ps %ymm0, %xmm0
317 ; VLDQ-NEXT: vzeroupper
320 ; DQNOVL-LABEL: ulto4f32:
322 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
323 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
324 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
325 ; DQNOVL-NEXT: vzeroupper
327 %b = uitofp <4 x i64> %a to <4 x float>
331 define <8 x double> @ulto8f64(<8 x i64> %a) {
332 ; NODQ-LABEL: ulto8f64:
334 ; NODQ-NEXT: vpandq {{.*}}(%rip){1to8}, %zmm0, %zmm1
335 ; NODQ-NEXT: vporq {{.*}}(%rip){1to8}, %zmm1, %zmm1
336 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
337 ; NODQ-NEXT: vporq {{.*}}(%rip){1to8}, %zmm0, %zmm0
338 ; NODQ-NEXT: vsubpd {{.*}}(%rip){1to8}, %zmm0, %zmm0
339 ; NODQ-NEXT: vaddpd %zmm0, %zmm1, %zmm0
342 ; VLDQ-LABEL: ulto8f64:
344 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
347 ; DQNOVL-LABEL: ulto8f64:
349 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
351 %b = uitofp <8 x i64> %a to <8 x double>
355 define <16 x double> @ulto16f64(<16 x i64> %a) {
356 ; NODQ-LABEL: ulto16f64:
358 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295]
359 ; NODQ-NEXT: vpandq %zmm2, %zmm0, %zmm3
360 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm4 = [4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200]
361 ; NODQ-NEXT: vporq %zmm4, %zmm3, %zmm3
362 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
363 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm5 = [4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072]
364 ; NODQ-NEXT: vporq %zmm5, %zmm0, %zmm0
365 ; NODQ-NEXT: vbroadcastsd {{.*#+}} zmm6 = [1.9342813118337666E+25,1.9342813118337666E+25,1.9342813118337666E+25,1.9342813118337666E+25,1.9342813118337666E+25,1.9342813118337666E+25,1.9342813118337666E+25,1.9342813118337666E+25]
366 ; NODQ-NEXT: vsubpd %zmm6, %zmm0, %zmm0
367 ; NODQ-NEXT: vaddpd %zmm0, %zmm3, %zmm0
368 ; NODQ-NEXT: vpandq %zmm2, %zmm1, %zmm2
369 ; NODQ-NEXT: vporq %zmm4, %zmm2, %zmm2
370 ; NODQ-NEXT: vpsrlq $32, %zmm1, %zmm1
371 ; NODQ-NEXT: vporq %zmm5, %zmm1, %zmm1
372 ; NODQ-NEXT: vsubpd %zmm6, %zmm1, %zmm1
373 ; NODQ-NEXT: vaddpd %zmm1, %zmm2, %zmm1
376 ; VLDQ-LABEL: ulto16f64:
378 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
379 ; VLDQ-NEXT: vcvtuqq2pd %zmm1, %zmm1
382 ; DQNOVL-LABEL: ulto16f64:
384 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
385 ; DQNOVL-NEXT: vcvtuqq2pd %zmm1, %zmm1
387 %b = uitofp <16 x i64> %a to <16 x double>
391 define <16 x i32> @f64to16si(<16 x float> %a) nounwind {
392 ; ALL-LABEL: f64to16si:
394 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
396 %b = fptosi <16 x float> %a to <16 x i32>
400 define <16 x i8> @f32to16sc(<16 x float> %f) {
401 ; ALL-LABEL: f32to16sc:
403 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
404 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
405 ; ALL-NEXT: vzeroupper
407 %res = fptosi <16 x float> %f to <16 x i8>
411 define <16 x i16> @f32to16ss(<16 x float> %f) {
412 ; ALL-LABEL: f32to16ss:
414 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
415 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
417 %res = fptosi <16 x float> %f to <16 x i16>
421 define <16 x i32> @f32to16ui(<16 x float> %a) nounwind {
422 ; ALL-LABEL: f32to16ui:
424 ; ALL-NEXT: vcvttps2udq %zmm0, %zmm0
426 %b = fptoui <16 x float> %a to <16 x i32>
430 define <16 x i8> @f32to16uc(<16 x float> %f) {
431 ; ALL-LABEL: f32to16uc:
433 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
434 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
435 ; ALL-NEXT: vzeroupper
437 %res = fptoui <16 x float> %f to <16 x i8>
441 define <16 x i16> @f32to16us(<16 x float> %f) {
442 ; ALL-LABEL: f32to16us:
444 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
445 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
447 %res = fptoui <16 x float> %f to <16 x i16>
451 define <8 x i32> @f32to8ui(<8 x float> %a) nounwind {
452 ; NOVL-LABEL: f32to8ui:
454 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
455 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
456 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
459 ; VL-LABEL: f32to8ui:
461 ; VL-NEXT: vcvttps2udq %ymm0, %ymm0
463 %b = fptoui <8 x float> %a to <8 x i32>
467 define <4 x i32> @f32to4ui(<4 x float> %a) nounwind {
468 ; NOVL-LABEL: f32to4ui:
470 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
471 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
472 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
473 ; NOVL-NEXT: vzeroupper
476 ; VL-LABEL: f32to4ui:
478 ; VL-NEXT: vcvttps2udq %xmm0, %xmm0
480 %b = fptoui <4 x float> %a to <4 x i32>
484 define <8 x i32> @f64to8ui(<8 x double> %a) nounwind {
485 ; ALL-LABEL: f64to8ui:
487 ; ALL-NEXT: vcvttpd2udq %zmm0, %ymm0
489 %b = fptoui <8 x double> %a to <8 x i32>
493 define <8 x i16> @f64to8us(<8 x double> %f) {
494 ; NOVL-LABEL: f64to8us:
496 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
497 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
498 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
499 ; NOVL-NEXT: vzeroupper
502 ; VL-LABEL: f64to8us:
504 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
505 ; VL-NEXT: vpmovdw %ymm0, %xmm0
506 ; VL-NEXT: vzeroupper
508 %res = fptoui <8 x double> %f to <8 x i16>
512 define <8 x i8> @f64to8uc(<8 x double> %f) {
513 ; NOVL-LABEL: f64to8uc:
515 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
516 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
517 ; NOVL-NEXT: vzeroupper
520 ; VL-LABEL: f64to8uc:
522 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
523 ; VL-NEXT: vpmovdb %ymm0, %xmm0
524 ; VL-NEXT: vzeroupper
526 %res = fptoui <8 x double> %f to <8 x i8>
530 define <4 x i32> @f64to4ui(<4 x double> %a) nounwind {
531 ; NOVL-LABEL: f64to4ui:
533 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
534 ; NOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
535 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
536 ; NOVL-NEXT: vzeroupper
539 ; VL-LABEL: f64to4ui:
541 ; VL-NEXT: vcvttpd2udq %ymm0, %xmm0
542 ; VL-NEXT: vzeroupper
544 %b = fptoui <4 x double> %a to <4 x i32>
548 define <8 x double> @sito8f64(<8 x i32> %a) {
549 ; ALL-LABEL: sito8f64:
551 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
553 %b = sitofp <8 x i32> %a to <8 x double>
556 define <8 x double> @i32to8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
557 ; KNL-LABEL: i32to8f64_mask:
559 ; KNL-NEXT: kmovw %edi, %k1
560 ; KNL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
563 ; VLBW-LABEL: i32to8f64_mask:
565 ; VLBW-NEXT: kmovd %edi, %k1
566 ; VLBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
569 ; VLNOBW-LABEL: i32to8f64_mask:
571 ; VLNOBW-NEXT: kmovw %edi, %k1
572 ; VLNOBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
575 ; DQNOVL-LABEL: i32to8f64_mask:
577 ; DQNOVL-NEXT: kmovw %edi, %k1
578 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
581 ; AVX512BW-LABEL: i32to8f64_mask:
583 ; AVX512BW-NEXT: kmovd %edi, %k1
584 ; AVX512BW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
585 ; AVX512BW-NEXT: retq
586 %1 = bitcast i8 %c to <8 x i1>
587 %2 = sitofp <8 x i32> %b to <8 x double>
588 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
591 define <8 x double> @sito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
592 ; KNL-LABEL: sito8f64_maskz:
594 ; KNL-NEXT: kmovw %edi, %k1
595 ; KNL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
598 ; VLBW-LABEL: sito8f64_maskz:
600 ; VLBW-NEXT: kmovd %edi, %k1
601 ; VLBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
604 ; VLNOBW-LABEL: sito8f64_maskz:
606 ; VLNOBW-NEXT: kmovw %edi, %k1
607 ; VLNOBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
610 ; DQNOVL-LABEL: sito8f64_maskz:
612 ; DQNOVL-NEXT: kmovw %edi, %k1
613 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
616 ; AVX512BW-LABEL: sito8f64_maskz:
618 ; AVX512BW-NEXT: kmovd %edi, %k1
619 ; AVX512BW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
620 ; AVX512BW-NEXT: retq
621 %1 = bitcast i8 %b to <8 x i1>
622 %2 = sitofp <8 x i32> %a to <8 x double>
623 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
627 define <8 x i32> @f64to8si(<8 x double> %a) {
628 ; ALL-LABEL: f64to8si:
630 ; ALL-NEXT: vcvttpd2dq %zmm0, %ymm0
632 %b = fptosi <8 x double> %a to <8 x i32>
636 define <8 x i16> @f64to8ss(<8 x double> %f) {
637 ; NOVL-LABEL: f64to8ss:
639 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
640 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
641 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
642 ; NOVL-NEXT: vzeroupper
645 ; VL-LABEL: f64to8ss:
647 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
648 ; VL-NEXT: vpmovdw %ymm0, %xmm0
649 ; VL-NEXT: vzeroupper
651 %res = fptosi <8 x double> %f to <8 x i16>
655 define <8 x i8> @f64to8sc(<8 x double> %f) {
656 ; NOVL-LABEL: f64to8sc:
658 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
659 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
660 ; NOVL-NEXT: vzeroupper
663 ; VL-LABEL: f64to8sc:
665 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
666 ; VL-NEXT: vpmovdb %ymm0, %xmm0
667 ; VL-NEXT: vzeroupper
669 %res = fptosi <8 x double> %f to <8 x i8>
673 define <4 x i32> @f64to4si(<4 x double> %a) {
674 ; ALL-LABEL: f64to4si:
676 ; ALL-NEXT: vcvttpd2dq %ymm0, %xmm0
677 ; ALL-NEXT: vzeroupper
679 %b = fptosi <4 x double> %a to <4 x i32>
683 define <16 x float> @f64to16f32(<16 x double> %b) nounwind {
684 ; ALL-LABEL: f64to16f32:
686 ; ALL-NEXT: vcvtpd2ps %zmm0, %ymm0
687 ; ALL-NEXT: vcvtpd2ps %zmm1, %ymm1
688 ; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
690 %a = fptrunc <16 x double> %b to <16 x float>
694 define <4 x float> @f64to4f32(<4 x double> %b) {
695 ; ALL-LABEL: f64to4f32:
697 ; ALL-NEXT: vcvtpd2ps %ymm0, %xmm0
698 ; ALL-NEXT: vzeroupper
700 %a = fptrunc <4 x double> %b to <4 x float>
704 define <4 x float> @f64to4f32_mask(<4 x double> %b, <4 x i1> %mask) {
705 ; NOVLDQ-LABEL: f64to4f32_mask:
707 ; NOVLDQ-NEXT: vpslld $31, %xmm1, %xmm1
708 ; NOVLDQ-NEXT: vptestmd %zmm1, %zmm1, %k1
709 ; NOVLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0
710 ; NOVLDQ-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
711 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
712 ; NOVLDQ-NEXT: vzeroupper
715 ; VLDQ-LABEL: f64to4f32_mask:
717 ; VLDQ-NEXT: vpslld $31, %xmm1, %xmm1
718 ; VLDQ-NEXT: vpmovd2m %xmm1, %k1
719 ; VLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
720 ; VLDQ-NEXT: vzeroupper
723 ; VLNODQ-LABEL: f64to4f32_mask:
725 ; VLNODQ-NEXT: vpslld $31, %xmm1, %xmm1
726 ; VLNODQ-NEXT: vptestmd %xmm1, %xmm1, %k1
727 ; VLNODQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
728 ; VLNODQ-NEXT: vzeroupper
731 ; DQNOVL-LABEL: f64to4f32_mask:
733 ; DQNOVL-NEXT: vpslld $31, %xmm1, %xmm1
734 ; DQNOVL-NEXT: vpmovd2m %zmm1, %k1
735 ; DQNOVL-NEXT: vcvtpd2ps %ymm0, %xmm0
736 ; DQNOVL-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
737 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
738 ; DQNOVL-NEXT: vzeroupper
740 %a = fptrunc <4 x double> %b to <4 x float>
741 %c = select <4 x i1>%mask, <4 x float>%a, <4 x float> zeroinitializer
745 define <4 x float> @f64tof32_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
746 ; ALL-LABEL: f64tof32_inreg:
748 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm1, %xmm0
750 %ext = extractelement <2 x double> %a0, i32 0
751 %cvt = fptrunc double %ext to float
752 %res = insertelement <4 x float> %a1, float %cvt, i32 0
756 define <8 x double> @f32to8f64(<8 x float> %b) nounwind {
757 ; ALL-LABEL: f32to8f64:
759 ; ALL-NEXT: vcvtps2pd %ymm0, %zmm0
761 %a = fpext <8 x float> %b to <8 x double>
765 define <4 x double> @f32to4f64_mask(<4 x float> %b, <4 x double> %b1, <4 x double> %a1) {
766 ; NOVL-LABEL: f32to4f64_mask:
768 ; NOVL-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
769 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
770 ; NOVL-NEXT: vcvtps2pd %xmm0, %ymm0
771 ; NOVL-NEXT: vcmpltpd %zmm2, %zmm1, %k1
772 ; NOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
773 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
776 ; VL-LABEL: f32to4f64_mask:
778 ; VL-NEXT: vcmpltpd %ymm2, %ymm1, %k1
779 ; VL-NEXT: vcvtps2pd %xmm0, %ymm0 {%k1} {z}
781 %a = fpext <4 x float> %b to <4 x double>
782 %mask = fcmp ogt <4 x double> %a1, %b1
783 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
787 define <4 x double> @f32to4f64_mask_load(<4 x float>* %p, <4 x double> %b1, <4 x double> %a1, <4 x double> %passthru) {
788 ; NOVL-LABEL: f32to4f64_mask_load:
790 ; NOVL-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
791 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
792 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
793 ; NOVL-NEXT: vcvtps2pd (%rdi), %ymm3
794 ; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
795 ; NOVL-NEXT: vblendmpd %zmm3, %zmm2, %zmm0 {%k1}
796 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
799 ; VL-LABEL: f32to4f64_mask_load:
801 ; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
802 ; VL-NEXT: vcvtps2pd (%rdi), %ymm2 {%k1}
803 ; VL-NEXT: vmovaps %ymm2, %ymm0
805 %b = load <4 x float>, <4 x float>* %p
806 %a = fpext <4 x float> %b to <4 x double>
807 %mask = fcmp ogt <4 x double> %a1, %b1
808 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> %passthru
812 define <4 x double> @f32to4f64_maskz_load(<4 x float>* %p, <4 x double> %b1, <4 x double> %a1) {
813 ; NOVL-LABEL: f32to4f64_maskz_load:
815 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
816 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
817 ; NOVL-NEXT: vcvtps2pd (%rdi), %ymm2
818 ; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
819 ; NOVL-NEXT: vmovapd %zmm2, %zmm0 {%k1} {z}
820 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
823 ; VL-LABEL: f32to4f64_maskz_load:
825 ; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
826 ; VL-NEXT: vcvtps2pd (%rdi), %ymm0 {%k1} {z}
828 %b = load <4 x float>, <4 x float>* %p
829 %a = fpext <4 x float> %b to <4 x double>
830 %mask = fcmp ogt <4 x double> %a1, %b1
831 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
835 define <2 x double> @f32tof64_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
836 ; ALL-LABEL: f32tof64_inreg:
838 ; ALL-NEXT: vcvtss2sd %xmm1, %xmm0, %xmm0
840 %ext = extractelement <4 x float> %a1, i32 0
841 %cvt = fpext float %ext to double
842 %res = insertelement <2 x double> %a0, double %cvt, i32 0
843 ret <2 x double> %res
846 define double @sltof64_load(i64* nocapture %e) {
847 ; ALL-LABEL: sltof64_load:
848 ; ALL: # %bb.0: # %entry
849 ; ALL-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
852 %tmp1 = load i64, i64* %e, align 8
853 %conv = sitofp i64 %tmp1 to double
857 define double @sitof64_load(i32* %e) {
858 ; ALL-LABEL: sitof64_load:
859 ; ALL: # %bb.0: # %entry
860 ; ALL-NEXT: vcvtsi2sdl (%rdi), %xmm0, %xmm0
863 %tmp1 = load i32, i32* %e, align 4
864 %conv = sitofp i32 %tmp1 to double
868 define float @sitof32_load(i32* %e) {
869 ; ALL-LABEL: sitof32_load:
870 ; ALL: # %bb.0: # %entry
871 ; ALL-NEXT: vcvtsi2ssl (%rdi), %xmm0, %xmm0
874 %tmp1 = load i32, i32* %e, align 4
875 %conv = sitofp i32 %tmp1 to float
879 define float @sltof32_load(i64* %e) {
880 ; ALL-LABEL: sltof32_load:
881 ; ALL: # %bb.0: # %entry
882 ; ALL-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
885 %tmp1 = load i64, i64* %e, align 8
886 %conv = sitofp i64 %tmp1 to float
890 define void @f32tof64_loadstore() {
891 ; ALL-LABEL: f32tof64_loadstore:
892 ; ALL: # %bb.0: # %entry
893 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
894 ; ALL-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
895 ; ALL-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp)
898 %f = alloca float, align 4
899 %d = alloca double, align 8
900 %tmp = load float, float* %f, align 4
901 %conv = fpext float %tmp to double
902 store double %conv, double* %d, align 8
906 define void @f64tof32_loadstore() nounwind uwtable {
907 ; ALL-LABEL: f64tof32_loadstore:
908 ; ALL: # %bb.0: # %entry
909 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
910 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
911 ; ALL-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp)
914 %f = alloca float, align 4
915 %d = alloca double, align 8
916 %tmp = load double, double* %d, align 8
917 %conv = fptrunc double %tmp to float
918 store float %conv, float* %f, align 4
922 define double @long_to_double(i64 %x) {
923 ; ALL-LABEL: long_to_double:
925 ; ALL-NEXT: vmovq %rdi, %xmm0
927 %res = bitcast i64 %x to double
931 define i64 @double_to_long(double %x) {
932 ; ALL-LABEL: double_to_long:
934 ; ALL-NEXT: vmovq %xmm0, %rax
936 %res = bitcast double %x to i64
940 define float @int_to_float(i32 %x) {
941 ; ALL-LABEL: int_to_float:
943 ; ALL-NEXT: vmovd %edi, %xmm0
945 %res = bitcast i32 %x to float
949 define i32 @float_to_int(float %x) {
950 ; ALL-LABEL: float_to_int:
952 ; ALL-NEXT: vmovd %xmm0, %eax
954 %res = bitcast float %x to i32
958 define <16 x double> @uito16f64(<16 x i32> %a) nounwind {
959 ; ALL-LABEL: uito16f64:
961 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm2
962 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
963 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm1
964 ; ALL-NEXT: vmovaps %zmm2, %zmm0
966 %b = uitofp <16 x i32> %a to <16 x double>
970 define <8 x float> @slto8f32(<8 x i64> %a) {
971 ; NODQ-LABEL: slto8f32:
973 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
974 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
975 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
976 ; NODQ-NEXT: vmovq %xmm1, %rax
977 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm1
978 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
979 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
980 ; NODQ-NEXT: vmovq %xmm2, %rax
981 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
982 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
983 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
984 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
985 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
986 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
987 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
988 ; NODQ-NEXT: vmovq %xmm0, %rax
989 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
990 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
991 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
992 ; NODQ-NEXT: vmovq %xmm0, %rax
993 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
994 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
995 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
996 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm0
997 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
998 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1001 ; VLDQ-LABEL: slto8f32:
1003 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
1006 ; DQNOVL-LABEL: slto8f32:
1008 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
1010 %b = sitofp <8 x i64> %a to <8 x float>
1014 define <16 x float> @slto16f32(<16 x i64> %a) {
1015 ; NODQ-LABEL: slto16f32:
1017 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1018 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1019 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
1020 ; NODQ-NEXT: vmovq %xmm2, %rax
1021 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
1022 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1023 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1024 ; NODQ-NEXT: vmovq %xmm3, %rax
1025 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm4
1026 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1027 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1028 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1029 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1030 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1031 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1032 ; NODQ-NEXT: vmovq %xmm1, %rax
1033 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1034 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1035 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1036 ; NODQ-NEXT: vmovq %xmm1, %rax
1037 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1038 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1039 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1040 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm1
1041 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1042 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1043 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1044 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1045 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1046 ; NODQ-NEXT: vmovq %xmm2, %rax
1047 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm2
1048 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1049 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm3
1050 ; NODQ-NEXT: vmovq %xmm3, %rax
1051 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1052 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1053 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1054 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1055 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1056 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1057 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1058 ; NODQ-NEXT: vmovq %xmm0, %rax
1059 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1060 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1061 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1062 ; NODQ-NEXT: vmovq %xmm0, %rax
1063 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1064 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1065 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1066 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm0
1067 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1068 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1069 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1072 ; VLDQ-LABEL: slto16f32:
1074 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
1075 ; VLDQ-NEXT: vcvtqq2ps %zmm1, %ymm1
1076 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1079 ; DQNOVL-LABEL: slto16f32:
1081 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
1082 ; DQNOVL-NEXT: vcvtqq2ps %zmm1, %ymm1
1083 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1085 %b = sitofp <16 x i64> %a to <16 x float>
1089 define <8 x double> @slto8f64(<8 x i64> %a) {
1090 ; NODQ-LABEL: slto8f64:
1092 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm1
1093 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1094 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm2, %xmm2
1095 ; NODQ-NEXT: vmovq %xmm1, %rax
1096 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm1
1097 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
1098 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1099 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1100 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1101 ; NODQ-NEXT: vmovq %xmm2, %rax
1102 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1103 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1104 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
1105 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm2
1106 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1107 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1108 ; NODQ-NEXT: vmovq %xmm2, %rax
1109 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1110 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1111 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1112 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1113 ; NODQ-NEXT: vmovq %xmm0, %rax
1114 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm0
1115 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm3[0]
1116 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1117 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1120 ; VLDQ-LABEL: slto8f64:
1122 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1125 ; DQNOVL-LABEL: slto8f64:
1127 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1129 %b = sitofp <8 x i64> %a to <8 x double>
1133 define <16 x double> @slto16f64(<16 x i64> %a) {
1134 ; NODQ-LABEL: slto16f64:
1136 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1137 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1138 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1139 ; NODQ-NEXT: vmovq %xmm2, %rax
1140 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1141 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1142 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm3
1143 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1144 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm4
1145 ; NODQ-NEXT: vmovq %xmm3, %rax
1146 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1147 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1148 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1149 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm3
1150 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1151 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1152 ; NODQ-NEXT: vmovq %xmm3, %rax
1153 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1154 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1155 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1156 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1157 ; NODQ-NEXT: vmovq %xmm0, %rax
1158 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm0
1159 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm4[0]
1160 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0
1161 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
1162 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm2
1163 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1164 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1165 ; NODQ-NEXT: vmovq %xmm2, %rax
1166 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm2
1167 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1168 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm3
1169 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1170 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1171 ; NODQ-NEXT: vmovq %xmm3, %rax
1172 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1173 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1174 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1175 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm3
1176 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1177 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1178 ; NODQ-NEXT: vmovq %xmm3, %rax
1179 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1180 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1181 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1182 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1183 ; NODQ-NEXT: vmovq %xmm1, %rax
1184 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm1
1185 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm4[0]
1186 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1
1187 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm1, %zmm1
1190 ; VLDQ-LABEL: slto16f64:
1192 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1193 ; VLDQ-NEXT: vcvtqq2pd %zmm1, %zmm1
1196 ; DQNOVL-LABEL: slto16f64:
1198 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1199 ; DQNOVL-NEXT: vcvtqq2pd %zmm1, %zmm1
1201 %b = sitofp <16 x i64> %a to <16 x double>
1202 ret <16 x double> %b
1205 define <8 x float> @ulto8f32(<8 x i64> %a) {
1206 ; NODQ-LABEL: ulto8f32:
1208 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
1209 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1210 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm2, %xmm2
1211 ; NODQ-NEXT: vmovq %xmm1, %rax
1212 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm1
1213 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
1214 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1215 ; NODQ-NEXT: vmovq %xmm2, %rax
1216 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1217 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
1218 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1219 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1220 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
1221 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1222 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1223 ; NODQ-NEXT: vmovq %xmm0, %rax
1224 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1225 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
1226 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1227 ; NODQ-NEXT: vmovq %xmm0, %rax
1228 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1229 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
1230 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1231 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm0
1232 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
1233 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1236 ; VLDQ-LABEL: ulto8f32:
1238 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1241 ; DQNOVL-LABEL: ulto8f32:
1243 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1245 %b = uitofp <8 x i64> %a to <8 x float>
1249 define <16 x float> @ulto16f32(<16 x i64> %a) {
1250 ; NODQ-LABEL: ulto16f32:
1252 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1253 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1254 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1255 ; NODQ-NEXT: vmovq %xmm2, %rax
1256 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1257 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1258 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1259 ; NODQ-NEXT: vmovq %xmm3, %rax
1260 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm4
1261 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1262 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1263 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1264 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1265 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1266 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1267 ; NODQ-NEXT: vmovq %xmm1, %rax
1268 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1269 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1270 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1271 ; NODQ-NEXT: vmovq %xmm1, %rax
1272 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1273 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1274 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1275 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm1
1276 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1277 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1278 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1279 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1280 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1281 ; NODQ-NEXT: vmovq %xmm2, %rax
1282 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm2
1283 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1284 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm3
1285 ; NODQ-NEXT: vmovq %xmm3, %rax
1286 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1287 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1288 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1289 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1290 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1291 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1292 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1293 ; NODQ-NEXT: vmovq %xmm0, %rax
1294 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1295 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1296 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1297 ; NODQ-NEXT: vmovq %xmm0, %rax
1298 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1299 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1300 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1301 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm0
1302 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1303 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1304 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1307 ; VLDQ-LABEL: ulto16f32:
1309 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1310 ; VLDQ-NEXT: vcvtuqq2ps %zmm1, %ymm1
1311 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1314 ; DQNOVL-LABEL: ulto16f32:
1316 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1317 ; DQNOVL-NEXT: vcvtuqq2ps %zmm1, %ymm1
1318 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1320 %b = uitofp <16 x i64> %a to <16 x float>
1324 define <8 x double> @uito8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
1325 ; KNL-LABEL: uito8f64_mask:
1327 ; KNL-NEXT: kmovw %edi, %k1
1328 ; KNL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1331 ; VLBW-LABEL: uito8f64_mask:
1333 ; VLBW-NEXT: kmovd %edi, %k1
1334 ; VLBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1337 ; VLNOBW-LABEL: uito8f64_mask:
1339 ; VLNOBW-NEXT: kmovw %edi, %k1
1340 ; VLNOBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1343 ; DQNOVL-LABEL: uito8f64_mask:
1345 ; DQNOVL-NEXT: kmovw %edi, %k1
1346 ; DQNOVL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1349 ; AVX512BW-LABEL: uito8f64_mask:
1350 ; AVX512BW: # %bb.0:
1351 ; AVX512BW-NEXT: kmovd %edi, %k1
1352 ; AVX512BW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1353 ; AVX512BW-NEXT: retq
1354 %1 = bitcast i8 %c to <8 x i1>
1355 %2 = uitofp <8 x i32> %b to <8 x double>
1356 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
1359 define <8 x double> @uito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
1360 ; KNL-LABEL: uito8f64_maskz:
1362 ; KNL-NEXT: kmovw %edi, %k1
1363 ; KNL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1366 ; VLBW-LABEL: uito8f64_maskz:
1368 ; VLBW-NEXT: kmovd %edi, %k1
1369 ; VLBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1372 ; VLNOBW-LABEL: uito8f64_maskz:
1374 ; VLNOBW-NEXT: kmovw %edi, %k1
1375 ; VLNOBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1378 ; DQNOVL-LABEL: uito8f64_maskz:
1380 ; DQNOVL-NEXT: kmovw %edi, %k1
1381 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1384 ; AVX512BW-LABEL: uito8f64_maskz:
1385 ; AVX512BW: # %bb.0:
1386 ; AVX512BW-NEXT: kmovd %edi, %k1
1387 ; AVX512BW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1388 ; AVX512BW-NEXT: retq
1389 %1 = bitcast i8 %b to <8 x i1>
1390 %2 = uitofp <8 x i32> %a to <8 x double>
1391 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
1395 define <4 x double> @uito4f64(<4 x i32> %a) nounwind {
1396 ; NOVL-LABEL: uito4f64:
1398 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1399 ; NOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
1400 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1403 ; VL-LABEL: uito4f64:
1405 ; VL-NEXT: vcvtudq2pd %xmm0, %ymm0
1407 %b = uitofp <4 x i32> %a to <4 x double>
1411 define <16 x float> @uito16f32(<16 x i32> %a) nounwind {
1412 ; ALL-LABEL: uito16f32:
1414 ; ALL-NEXT: vcvtudq2ps %zmm0, %zmm0
1416 %b = uitofp <16 x i32> %a to <16 x float>
1420 define <8 x double> @uito8f64(<8 x i32> %a) {
1421 ; ALL-LABEL: uito8f64:
1423 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm0
1425 %b = uitofp <8 x i32> %a to <8 x double>
1429 define <8 x float> @uito8f32(<8 x i32> %a) nounwind {
1430 ; NOVL-LABEL: uito8f32:
1432 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1433 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1434 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1437 ; VL-LABEL: uito8f32:
1439 ; VL-NEXT: vcvtudq2ps %ymm0, %ymm0
1441 %b = uitofp <8 x i32> %a to <8 x float>
1445 define <4 x float> @uito4f32(<4 x i32> %a) nounwind {
1446 ; NOVL-LABEL: uito4f32:
1448 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1449 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1450 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1451 ; NOVL-NEXT: vzeroupper
1454 ; VL-LABEL: uito4f32:
1456 ; VL-NEXT: vcvtudq2ps %xmm0, %xmm0
1458 %b = uitofp <4 x i32> %a to <4 x float>
1462 define i32 @fptosi(float %a) nounwind {
1463 ; ALL-LABEL: fptosi:
1465 ; ALL-NEXT: vcvttss2si %xmm0, %eax
1467 %b = fptosi float %a to i32
1471 define i32 @fptoui(float %a) nounwind {
1472 ; ALL-LABEL: fptoui:
1474 ; ALL-NEXT: vcvttss2usi %xmm0, %eax
1476 %b = fptoui float %a to i32
1480 define float @uitof32(i32 %a) nounwind {
1481 ; ALL-LABEL: uitof32:
1483 ; ALL-NEXT: vcvtusi2ss %edi, %xmm0, %xmm0
1485 %b = uitofp i32 %a to float
1489 define double @uitof64(i32 %a) nounwind {
1490 ; ALL-LABEL: uitof64:
1492 ; ALL-NEXT: vcvtusi2sd %edi, %xmm0, %xmm0
1494 %b = uitofp i32 %a to double
1498 define <16 x float> @sbto16f32(<16 x i32> %a) {
1499 ; NODQ-LABEL: sbto16f32:
1501 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1502 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1503 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1504 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1507 ; VLDQ-LABEL: sbto16f32:
1509 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1510 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1511 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1514 ; DQNOVL-LABEL: sbto16f32:
1516 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1517 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1518 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1520 %mask = icmp slt <16 x i32> %a, zeroinitializer
1521 %1 = sitofp <16 x i1> %mask to <16 x float>
1525 define <16 x float> @scto16f32(<16 x i8> %a) {
1526 ; ALL-LABEL: scto16f32:
1528 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm0
1529 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1531 %1 = sitofp <16 x i8> %a to <16 x float>
1535 define <16 x float> @ssto16f32(<16 x i16> %a) {
1536 ; ALL-LABEL: ssto16f32:
1538 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1539 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1541 %1 = sitofp <16 x i16> %a to <16 x float>
1545 define <8 x double> @ssto16f64(<8 x i16> %a) {
1546 ; ALL-LABEL: ssto16f64:
1548 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1549 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1551 %1 = sitofp <8 x i16> %a to <8 x double>
1555 define <8 x double> @scto8f64(<8 x i8> %a) {
1556 ; ALL-LABEL: scto8f64:
1558 ; ALL-NEXT: vpmovsxbd %xmm0, %ymm0
1559 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1561 %1 = sitofp <8 x i8> %a to <8 x double>
1565 define <16 x double> @scto16f64(<16 x i8> %a) {
1566 ; ALL-LABEL: scto16f64:
1568 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm1
1569 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1570 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1571 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1573 %b = sitofp <16 x i8> %a to <16 x double>
1574 ret <16 x double> %b
1577 define <16 x double> @sbto16f64(<16 x double> %a) {
1578 ; NODQ-LABEL: sbto16f64:
1580 ; NODQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1581 ; NODQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1582 ; NODQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1583 ; NODQ-NEXT: kunpckbw %k0, %k1, %k1
1584 ; NODQ-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1 {%k1} {z}
1585 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1586 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1587 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1590 ; VLDQ-LABEL: sbto16f64:
1592 ; VLDQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1593 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1594 ; VLDQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1595 ; VLDQ-NEXT: kunpckbw %k0, %k1, %k0
1596 ; VLDQ-NEXT: vpmovm2d %k0, %zmm1
1597 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1598 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1599 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1602 ; DQNOVL-LABEL: sbto16f64:
1604 ; DQNOVL-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1605 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1606 ; DQNOVL-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1607 ; DQNOVL-NEXT: kunpckbw %k0, %k1, %k0
1608 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm1
1609 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1610 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1611 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1613 %cmpres = fcmp ogt <16 x double> %a, zeroinitializer
1614 %1 = sitofp <16 x i1> %cmpres to <16 x double>
1615 ret <16 x double> %1
1618 define <8 x double> @sbto8f64(<8 x double> %a) {
1619 ; NOVLDQ-LABEL: sbto8f64:
1621 ; NOVLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1622 ; NOVLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1623 ; NOVLDQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1624 ; NOVLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1627 ; VLDQ-LABEL: sbto8f64:
1629 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1630 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1631 ; VLDQ-NEXT: vpmovm2d %k0, %ymm0
1632 ; VLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1635 ; VLNODQ-LABEL: sbto8f64:
1637 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1638 ; VLNODQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1639 ; VLNODQ-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
1640 ; VLNODQ-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
1641 ; VLNODQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1644 ; DQNOVL-LABEL: sbto8f64:
1646 ; DQNOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1647 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1648 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1649 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0
1651 %cmpres = fcmp ogt <8 x double> %a, zeroinitializer
1652 %1 = sitofp <8 x i1> %cmpres to <8 x double>
1656 define <8 x float> @sbto8f32(<8 x float> %a) {
1657 ; ALL-LABEL: sbto8f32:
1659 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1660 ; ALL-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
1661 ; ALL-NEXT: vcvtdq2ps %ymm0, %ymm0
1663 %cmpres = fcmp ogt <8 x float> %a, zeroinitializer
1664 %1 = sitofp <8 x i1> %cmpres to <8 x float>
1668 define <4 x float> @sbto4f32(<4 x float> %a) {
1669 ; ALL-LABEL: sbto4f32:
1671 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1672 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1673 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1675 %cmpres = fcmp ogt <4 x float> %a, zeroinitializer
1676 %1 = sitofp <4 x i1> %cmpres to <4 x float>
1680 define <4 x double> @sbto4f64(<4 x double> %a) {
1681 ; NOVL-LABEL: sbto4f64:
1683 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1684 ; NOVL-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0
1685 ; NOVL-NEXT: vpmovqd %zmm0, %ymm0
1686 ; NOVL-NEXT: vcvtdq2pd %xmm0, %ymm0
1689 ; VLDQ-LABEL: sbto4f64:
1691 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1692 ; VLDQ-NEXT: vcmpltpd %ymm0, %ymm1, %k0
1693 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1694 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1697 ; VLNODQ-LABEL: sbto4f64:
1699 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1700 ; VLNODQ-NEXT: vcmpltpd %ymm0, %ymm1, %k1
1701 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1702 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1703 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1705 %cmpres = fcmp ogt <4 x double> %a, zeroinitializer
1706 %1 = sitofp <4 x i1> %cmpres to <4 x double>
1710 define <2 x float> @sbto2f32(<2 x float> %a) {
1711 ; ALL-LABEL: sbto2f32:
1713 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1714 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1715 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1717 %cmpres = fcmp ogt <2 x float> %a, zeroinitializer
1718 %1 = sitofp <2 x i1> %cmpres to <2 x float>
1722 define <2 x double> @sbto2f64(<2 x double> %a) {
1723 ; NOVL-LABEL: sbto2f64:
1725 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1726 ; NOVL-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
1727 ; NOVL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,2,3]
1728 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
1731 ; VLDQ-LABEL: sbto2f64:
1733 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1734 ; VLDQ-NEXT: vcmpltpd %xmm0, %xmm1, %k0
1735 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1736 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1739 ; VLNODQ-LABEL: sbto2f64:
1741 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1742 ; VLNODQ-NEXT: vcmpltpd %xmm0, %xmm1, %k1
1743 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1744 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1745 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1747 %cmpres = fcmp ogt <2 x double> %a, zeroinitializer
1748 %1 = sitofp <2 x i1> %cmpres to <2 x double>
1752 define <16 x float> @ucto16f32(<16 x i8> %a) {
1753 ; ALL-LABEL: ucto16f32:
1755 ; ALL-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
1756 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1758 %b = uitofp <16 x i8> %a to <16 x float>
1762 define <8 x double> @ucto8f64(<8 x i8> %a) {
1763 ; ALL-LABEL: ucto8f64:
1765 ; ALL-NEXT: vpmovzxbd {{.*#+}} ymm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero
1766 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1768 %b = uitofp <8 x i8> %a to <8 x double>
1772 define <16 x float> @swto16f32(<16 x i16> %a) {
1773 ; ALL-LABEL: swto16f32:
1775 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1776 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1778 %b = sitofp <16 x i16> %a to <16 x float>
1782 define <8 x double> @swto8f64(<8 x i16> %a) {
1783 ; ALL-LABEL: swto8f64:
1785 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1786 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1788 %b = sitofp <8 x i16> %a to <8 x double>
1792 define <16 x double> @swto16f64(<16 x i16> %a) {
1793 ; ALL-LABEL: swto16f64:
1795 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm1
1796 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1797 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1798 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1800 %b = sitofp <16 x i16> %a to <16 x double>
1801 ret <16 x double> %b
1804 define <16 x double> @ucto16f64(<16 x i8> %a) {
1805 ; ALL-LABEL: ucto16f64:
1807 ; ALL-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
1808 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1809 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1810 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1812 %b = uitofp <16 x i8> %a to <16 x double>
1813 ret <16 x double> %b
1816 define <16 x float> @uwto16f32(<16 x i16> %a) {
1817 ; ALL-LABEL: uwto16f32:
1819 ; ALL-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
1820 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1822 %b = uitofp <16 x i16> %a to <16 x float>
1826 define <8 x double> @uwto8f64(<8 x i16> %a) {
1827 ; ALL-LABEL: uwto8f64:
1829 ; ALL-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
1830 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1832 %b = uitofp <8 x i16> %a to <8 x double>
1836 define <16 x double> @uwto16f64(<16 x i16> %a) {
1837 ; ALL-LABEL: uwto16f64:
1839 ; ALL-NEXT: vpmovzxwd {{.*#+}} zmm1 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
1840 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1841 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1842 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1844 %b = uitofp <16 x i16> %a to <16 x double>
1845 ret <16 x double> %b
1848 define <16 x float> @sito16f32(<16 x i32> %a) {
1849 ; ALL-LABEL: sito16f32:
1851 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1853 %b = sitofp <16 x i32> %a to <16 x float>
1857 define <16 x double> @sito16f64(<16 x i32> %a) {
1858 ; ALL-LABEL: sito16f64:
1860 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm2
1861 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
1862 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm1
1863 ; ALL-NEXT: vmovaps %zmm2, %zmm0
1865 %b = sitofp <16 x i32> %a to <16 x double>
1866 ret <16 x double> %b
1869 define <16 x float> @usto16f32(<16 x i16> %a) {
1870 ; ALL-LABEL: usto16f32:
1872 ; ALL-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
1873 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1875 %b = uitofp <16 x i16> %a to <16 x float>
1879 define <16 x float> @ubto16f32(<16 x i32> %a) {
1880 ; NODQ-LABEL: ubto16f32:
1882 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1883 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1884 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1885 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm0
1886 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1889 ; VLDQ-LABEL: ubto16f32:
1891 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1892 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1893 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm0
1894 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1897 ; DQNOVL-LABEL: ubto16f32:
1899 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1900 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1901 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm0
1902 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1904 %mask = icmp slt <16 x i32> %a, zeroinitializer
1905 %1 = uitofp <16 x i1> %mask to <16 x float>
1909 define <16 x double> @ubto16f64(<16 x i32> %a) {
1910 ; NODQ-LABEL: ubto16f64:
1912 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1913 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1914 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1915 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm1
1916 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1917 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1918 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1921 ; VLDQ-LABEL: ubto16f64:
1923 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1924 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1925 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm1
1926 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1927 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1928 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1931 ; DQNOVL-LABEL: ubto16f64:
1933 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1934 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1935 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm1
1936 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1937 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1938 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1940 %mask = icmp slt <16 x i32> %a, zeroinitializer
1941 %1 = uitofp <16 x i1> %mask to <16 x double>
1942 ret <16 x double> %1
1945 define <8 x float> @ubto8f32(<8 x i32> %a) {
1946 ; NOVL-LABEL: ubto8f32:
1948 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1949 ; NOVL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1950 ; NOVL-NEXT: vpbroadcastd {{.*#+}} ymm1 = [1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216]
1951 ; NOVL-NEXT: vpand %ymm1, %ymm0, %ymm0
1954 ; VL-LABEL: ubto8f32:
1956 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1957 ; VL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1958 ; VL-NEXT: vpandd {{.*}}(%rip){1to8}, %ymm0, %ymm0
1960 %mask = icmp slt <8 x i32> %a, zeroinitializer
1961 %1 = uitofp <8 x i1> %mask to <8 x float>
1965 define <8 x double> @ubto8f64(<8 x i32> %a) {
1966 ; ALL-LABEL: ubto8f64:
1968 ; ALL-NEXT: vpsrld $31, %ymm0, %ymm0
1969 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1971 %mask = icmp slt <8 x i32> %a, zeroinitializer
1972 %1 = uitofp <8 x i1> %mask to <8 x double>
1976 define <4 x float> @ubto4f32(<4 x i32> %a) {
1977 ; NOVL-LABEL: ubto4f32:
1979 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1980 ; NOVL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1981 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
1982 ; NOVL-NEXT: vpand %xmm1, %xmm0, %xmm0
1985 ; VL-LABEL: ubto4f32:
1987 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1988 ; VL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1989 ; VL-NEXT: vpandd {{.*}}(%rip){1to4}, %xmm0, %xmm0
1991 %mask = icmp slt <4 x i32> %a, zeroinitializer
1992 %1 = uitofp <4 x i1> %mask to <4 x float>
1996 define <4 x double> @ubto4f64(<4 x i32> %a) {
1997 ; ALL-LABEL: ubto4f64:
1999 ; ALL-NEXT: vpsrld $31, %xmm0, %xmm0
2000 ; ALL-NEXT: vcvtdq2pd %xmm0, %ymm0
2002 %mask = icmp slt <4 x i32> %a, zeroinitializer
2003 %1 = uitofp <4 x i1> %mask to <4 x double>
2007 define <2 x float> @ubto2f32(<2 x i32> %a) {
2008 ; NOVL-LABEL: ubto2f32:
2010 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2011 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2012 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
2013 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
2016 ; VL-LABEL: ubto2f32:
2018 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2019 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2020 ; VL-NEXT: vpandnd {{.*}}(%rip){1to4}, %xmm0, %xmm0
2022 %mask = icmp ne <2 x i32> %a, zeroinitializer
2023 %1 = uitofp <2 x i1> %mask to <2 x float>
2027 define <2 x double> @ubto2f64(<2 x i32> %a) {
2028 ; NOVL-LABEL: ubto2f64:
2030 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2031 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2032 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1,1,1,1]
2033 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
2034 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
2037 ; VL-LABEL: ubto2f64:
2039 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2040 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2041 ; VL-NEXT: vpandnd {{.*}}(%rip){1to4}, %xmm0, %xmm0
2042 ; VL-NEXT: vcvtdq2pd %xmm0, %xmm0
2044 %mask = icmp ne <2 x i32> %a, zeroinitializer
2045 %1 = uitofp <2 x i1> %mask to <2 x double>
2049 define <2 x i64> @test_2f64toub(<2 x double> %a, <2 x i64> %passthru) {
2050 ; NOVLDQ-LABEL: test_2f64toub:
2052 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2053 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2054 ; NOVLDQ-NEXT: vcvttpd2udq %zmm0, %ymm0
2055 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2056 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2057 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2058 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2059 ; NOVLDQ-NEXT: vzeroupper
2062 ; VLDQ-LABEL: test_2f64toub:
2064 ; VLDQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2065 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2066 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2067 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2070 ; VLNODQ-LABEL: test_2f64toub:
2072 ; VLNODQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2073 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2074 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2075 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2078 ; DQNOVL-LABEL: test_2f64toub:
2080 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2081 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2082 ; DQNOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
2083 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2084 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2085 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2086 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2087 ; DQNOVL-NEXT: vzeroupper
2089 %mask = fptoui <2 x double> %a to <2 x i1>
2090 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2091 ret <2 x i64> %select
2094 define <4 x i64> @test_4f64toub(<4 x double> %a, <4 x i64> %passthru) {
2095 ; NOVLDQ-LABEL: test_4f64toub:
2097 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2098 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2099 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2100 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2101 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2102 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2105 ; VLDQ-LABEL: test_4f64toub:
2107 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2108 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2109 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2110 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2113 ; VLNODQ-LABEL: test_4f64toub:
2115 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2116 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2117 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2118 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2121 ; DQNOVL-LABEL: test_4f64toub:
2123 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2124 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2125 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2126 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2127 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2128 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2130 %mask = fptoui <4 x double> %a to <4 x i1>
2131 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2132 ret <4 x i64> %select
2135 define <8 x i64> @test_8f64toub(<8 x double> %a, <8 x i64> %passthru) {
2136 ; NOVLDQ-LABEL: test_8f64toub:
2138 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2139 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2140 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2141 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2144 ; VLDQ-LABEL: test_8f64toub:
2146 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2147 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2148 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2149 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2152 ; VLNODQ-LABEL: test_8f64toub:
2154 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2155 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2156 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2157 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2160 ; DQNOVL-LABEL: test_8f64toub:
2162 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2163 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2164 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2165 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2167 %mask = fptoui <8 x double> %a to <8 x i1>
2168 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2169 ret <8 x i64> %select
2172 define <2 x i64> @test_2f32toub(<2 x float> %a, <2 x i64> %passthru) {
2173 ; NOVLDQ-LABEL: test_2f32toub:
2175 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2176 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2177 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2178 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2179 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2180 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2181 ; NOVLDQ-NEXT: vzeroupper
2184 ; VLDQ-LABEL: test_2f32toub:
2186 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2187 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2188 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2189 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2192 ; VLNODQ-LABEL: test_2f32toub:
2194 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2195 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2196 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2197 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2200 ; DQNOVL-LABEL: test_2f32toub:
2202 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2203 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2204 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2205 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2206 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2207 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2208 ; DQNOVL-NEXT: vzeroupper
2210 %mask = fptoui <2 x float> %a to <2 x i1>
2211 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2212 ret <2 x i64> %select
2215 define <4 x i64> @test_4f32toub(<4 x float> %a, <4 x i64> %passthru) {
2216 ; NOVLDQ-LABEL: test_4f32toub:
2218 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2219 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2220 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2221 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2222 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2223 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2226 ; VLDQ-LABEL: test_4f32toub:
2228 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2229 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2230 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2231 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2234 ; VLNODQ-LABEL: test_4f32toub:
2236 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2237 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2238 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2239 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2242 ; DQNOVL-LABEL: test_4f32toub:
2244 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2245 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2246 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2247 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2248 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2249 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2251 %mask = fptoui <4 x float> %a to <4 x i1>
2252 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2253 ret <4 x i64> %select
2256 define <8 x i64> @test_8f32toub(<8 x float> %a, <8 x i64> %passthru) {
2257 ; NOVLDQ-LABEL: test_8f32toub:
2259 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2260 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2261 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2262 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2265 ; VLDQ-LABEL: test_8f32toub:
2267 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2268 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2269 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2270 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2273 ; VLNODQ-LABEL: test_8f32toub:
2275 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2276 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2277 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2278 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2281 ; DQNOVL-LABEL: test_8f32toub:
2283 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2284 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2285 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2286 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2288 %mask = fptoui <8 x float> %a to <8 x i1>
2289 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2290 ret <8 x i64> %select
2293 define <16 x i32> @test_16f32toub(<16 x float> %a, <16 x i32> %passthru) {
2294 ; NODQ-LABEL: test_16f32toub:
2296 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2297 ; NODQ-NEXT: vpslld $31, %zmm0, %zmm0
2298 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2299 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2302 ; VLDQ-LABEL: test_16f32toub:
2304 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2305 ; VLDQ-NEXT: vpslld $31, %zmm0, %zmm0
2306 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2307 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2310 ; DQNOVL-LABEL: test_16f32toub:
2312 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2313 ; DQNOVL-NEXT: vpslld $31, %zmm0, %zmm0
2314 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2315 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2317 %mask = fptoui <16 x float> %a to <16 x i1>
2318 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2319 ret <16 x i32> %select
2322 define <2 x i64> @test_2f64tosb(<2 x double> %a, <2 x i64> %passthru) {
2323 ; NOVLDQ-LABEL: test_2f64tosb:
2325 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2326 ; NOVLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2327 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2328 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2329 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2330 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2331 ; NOVLDQ-NEXT: vzeroupper
2334 ; VLDQ-LABEL: test_2f64tosb:
2336 ; VLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2337 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2338 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2339 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2342 ; VLNODQ-LABEL: test_2f64tosb:
2344 ; VLNODQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2345 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2346 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2347 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2350 ; DQNOVL-LABEL: test_2f64tosb:
2352 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2353 ; DQNOVL-NEXT: vcvttpd2dq %xmm0, %xmm0
2354 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2355 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2356 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2357 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2358 ; DQNOVL-NEXT: vzeroupper
2360 %mask = fptosi <2 x double> %a to <2 x i1>
2361 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2362 ret <2 x i64> %select
2365 define <4 x i64> @test_4f64tosb(<4 x double> %a, <4 x i64> %passthru) {
2366 ; NOVLDQ-LABEL: test_4f64tosb:
2368 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2369 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2370 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2371 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2372 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2375 ; VLDQ-LABEL: test_4f64tosb:
2377 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2378 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2379 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2382 ; VLNODQ-LABEL: test_4f64tosb:
2384 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2385 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2386 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2389 ; DQNOVL-LABEL: test_4f64tosb:
2391 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2392 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2393 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2394 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2395 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2397 %mask = fptosi <4 x double> %a to <4 x i1>
2398 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2399 ret <4 x i64> %select
2402 define <8 x i64> @test_8f64tosb(<8 x double> %a, <8 x i64> %passthru) {
2403 ; NOVLDQ-LABEL: test_8f64tosb:
2405 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2406 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2407 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2410 ; VLDQ-LABEL: test_8f64tosb:
2412 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2413 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2414 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2417 ; VLNODQ-LABEL: test_8f64tosb:
2419 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2420 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2421 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2424 ; DQNOVL-LABEL: test_8f64tosb:
2426 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2427 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2428 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2430 %mask = fptosi <8 x double> %a to <8 x i1>
2431 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2432 ret <8 x i64> %select
2435 define <2 x i64> @test_2f32tosb(<2 x float> %a, <2 x i64> %passthru) {
2436 ; NOVLDQ-LABEL: test_2f32tosb:
2438 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2439 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2440 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2441 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2442 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2443 ; NOVLDQ-NEXT: vzeroupper
2446 ; VLDQ-LABEL: test_2f32tosb:
2448 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2449 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2450 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2453 ; VLNODQ-LABEL: test_2f32tosb:
2455 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2456 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2457 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2460 ; DQNOVL-LABEL: test_2f32tosb:
2462 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2463 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2464 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2465 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2466 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2467 ; DQNOVL-NEXT: vzeroupper
2469 %mask = fptosi <2 x float> %a to <2 x i1>
2470 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2471 ret <2 x i64> %select
2474 define <4 x i64> @test_4f32tosb(<4 x float> %a, <4 x i64> %passthru) {
2475 ; NOVLDQ-LABEL: test_4f32tosb:
2477 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2478 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2479 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2480 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2481 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2484 ; VLDQ-LABEL: test_4f32tosb:
2486 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2487 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2488 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2491 ; VLNODQ-LABEL: test_4f32tosb:
2493 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2494 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2495 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2498 ; DQNOVL-LABEL: test_4f32tosb:
2500 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2501 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2502 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2503 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2504 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2506 %mask = fptosi <4 x float> %a to <4 x i1>
2507 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2508 ret <4 x i64> %select
2511 define <8 x i64> @test_8f32tosb(<8 x float> %a, <8 x i64> %passthru) {
2512 ; NOVLDQ-LABEL: test_8f32tosb:
2514 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2515 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2516 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2519 ; VLDQ-LABEL: test_8f32tosb:
2521 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2522 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2523 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2526 ; VLNODQ-LABEL: test_8f32tosb:
2528 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2529 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2530 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2533 ; DQNOVL-LABEL: test_8f32tosb:
2535 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2536 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2537 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2539 %mask = fptosi <8 x float> %a to <8 x i1>
2540 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2541 ret <8 x i64> %select
2544 define <16 x i32> @test_16f32tosb(<16 x float> %a, <16 x i32> %passthru) {
2545 ; NODQ-LABEL: test_16f32tosb:
2547 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2548 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2549 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2552 ; VLDQ-LABEL: test_16f32tosb:
2554 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2555 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2556 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2559 ; DQNOVL-LABEL: test_16f32tosb:
2561 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2562 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2563 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2565 %mask = fptosi <16 x float> %a to <16 x i1>
2566 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2567 ret <16 x i32> %select
2570 define <2 x double> @test_sito2f64_mask_load(<2 x i32> *%a, <2 x i64> %c) {
2571 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2573 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2576 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2578 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2580 ; NOVLDQ-LABEL: test_sito2f64_mask_load:
2582 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2583 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2584 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2585 ; NOVLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0
2586 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2587 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2588 ; NOVLDQ-NEXT: vzeroupper
2591 ; VLDQ-LABEL: test_sito2f64_mask_load:
2593 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2594 ; VLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2597 ; VLNODQ-LABEL: test_sito2f64_mask_load:
2599 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2600 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2601 ; VLNODQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2604 ; DQNOVL-LABEL: test_sito2f64_mask_load:
2606 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2607 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2608 ; DQNOVL-NEXT: vcvtdq2pd (%rdi), %xmm0
2609 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2610 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2611 ; DQNOVL-NEXT: vzeroupper
2613 %mask = icmp slt <2 x i64> %c, zeroinitializer
2614 %ld = load <2 x i32>, <2 x i32> *%a
2615 %cvt = sitofp <2 x i32> %ld to <2 x double>
2616 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2617 ret <2 x double> %sel
2620 define <2 x double> @test_uito2f64_mask_load(<2 x i32> *%a, <2 x i64> %c) {
2621 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2623 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2626 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2628 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2630 ; NOVLDQ-LABEL: test_uito2f64_mask_load:
2632 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2633 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2634 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2635 ; NOVLDQ-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2636 ; NOVLDQ-NEXT: vcvtudq2pd %ymm0, %zmm0
2637 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2638 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2639 ; NOVLDQ-NEXT: vzeroupper
2642 ; VLDQ-LABEL: test_uito2f64_mask_load:
2644 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2645 ; VLDQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2648 ; VLNODQ-LABEL: test_uito2f64_mask_load:
2650 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2651 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2652 ; VLNODQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2655 ; DQNOVL-LABEL: test_uito2f64_mask_load:
2657 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2658 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2659 ; DQNOVL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2660 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
2661 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2662 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2663 ; DQNOVL-NEXT: vzeroupper
2665 %mask = icmp slt <2 x i64> %c, zeroinitializer
2666 %ld = load <2 x i32>, <2 x i32> *%a
2667 %cvt = uitofp <2 x i32> %ld to <2 x double>
2668 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2669 ret <2 x double> %sel