1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -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 -x86-experimental-vector-widening-legalization -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 -x86-experimental-vector-widening-legalization -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 -x86-experimental-vector-widening-legalization -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 -x86-experimental-vector-widening-legalization -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 -x86-experimental-vector-widening-legalization -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 -x86-experimental-vector-widening-legalization -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) {
788 ; NOVL-LABEL: f32to4f64_mask_load:
790 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
791 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
792 ; NOVL-NEXT: vcvtps2pd (%rdi), %ymm2
793 ; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
794 ; NOVL-NEXT: vmovapd %zmm2, %zmm0 {%k1} {z}
795 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
798 ; VL-LABEL: f32to4f64_mask_load:
800 ; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
801 ; VL-NEXT: vcvtps2pd (%rdi), %ymm0 {%k1} {z}
803 %b = load <4 x float>, <4 x float>* %p
804 %a = fpext <4 x float> %b to <4 x double>
805 %mask = fcmp ogt <4 x double> %a1, %b1
806 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
810 define <2 x double> @f32tof64_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
811 ; ALL-LABEL: f32tof64_inreg:
813 ; ALL-NEXT: vcvtss2sd %xmm1, %xmm0, %xmm0
815 %ext = extractelement <4 x float> %a1, i32 0
816 %cvt = fpext float %ext to double
817 %res = insertelement <2 x double> %a0, double %cvt, i32 0
818 ret <2 x double> %res
821 define double @sltof64_load(i64* nocapture %e) {
822 ; ALL-LABEL: sltof64_load:
823 ; ALL: # %bb.0: # %entry
824 ; ALL-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
827 %tmp1 = load i64, i64* %e, align 8
828 %conv = sitofp i64 %tmp1 to double
832 define double @sitof64_load(i32* %e) {
833 ; ALL-LABEL: sitof64_load:
834 ; ALL: # %bb.0: # %entry
835 ; ALL-NEXT: vcvtsi2sdl (%rdi), %xmm0, %xmm0
838 %tmp1 = load i32, i32* %e, align 4
839 %conv = sitofp i32 %tmp1 to double
843 define float @sitof32_load(i32* %e) {
844 ; ALL-LABEL: sitof32_load:
845 ; ALL: # %bb.0: # %entry
846 ; ALL-NEXT: vcvtsi2ssl (%rdi), %xmm0, %xmm0
849 %tmp1 = load i32, i32* %e, align 4
850 %conv = sitofp i32 %tmp1 to float
854 define float @sltof32_load(i64* %e) {
855 ; ALL-LABEL: sltof32_load:
856 ; ALL: # %bb.0: # %entry
857 ; ALL-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
860 %tmp1 = load i64, i64* %e, align 8
861 %conv = sitofp i64 %tmp1 to float
865 define void @f32tof64_loadstore() {
866 ; ALL-LABEL: f32tof64_loadstore:
867 ; ALL: # %bb.0: # %entry
868 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
869 ; ALL-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
870 ; ALL-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp)
873 %f = alloca float, align 4
874 %d = alloca double, align 8
875 %tmp = load float, float* %f, align 4
876 %conv = fpext float %tmp to double
877 store double %conv, double* %d, align 8
881 define void @f64tof32_loadstore() nounwind uwtable {
882 ; ALL-LABEL: f64tof32_loadstore:
883 ; ALL: # %bb.0: # %entry
884 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
885 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
886 ; ALL-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp)
889 %f = alloca float, align 4
890 %d = alloca double, align 8
891 %tmp = load double, double* %d, align 8
892 %conv = fptrunc double %tmp to float
893 store float %conv, float* %f, align 4
897 define double @long_to_double(i64 %x) {
898 ; ALL-LABEL: long_to_double:
900 ; ALL-NEXT: vmovq %rdi, %xmm0
902 %res = bitcast i64 %x to double
906 define i64 @double_to_long(double %x) {
907 ; ALL-LABEL: double_to_long:
909 ; ALL-NEXT: vmovq %xmm0, %rax
911 %res = bitcast double %x to i64
915 define float @int_to_float(i32 %x) {
916 ; ALL-LABEL: int_to_float:
918 ; ALL-NEXT: vmovd %edi, %xmm0
920 %res = bitcast i32 %x to float
924 define i32 @float_to_int(float %x) {
925 ; ALL-LABEL: float_to_int:
927 ; ALL-NEXT: vmovd %xmm0, %eax
929 %res = bitcast float %x to i32
933 define <16 x double> @uito16f64(<16 x i32> %a) nounwind {
934 ; ALL-LABEL: uito16f64:
936 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm2
937 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
938 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm1
939 ; ALL-NEXT: vmovaps %zmm2, %zmm0
941 %b = uitofp <16 x i32> %a to <16 x double>
945 define <8 x float> @slto8f32(<8 x i64> %a) {
946 ; NODQ-LABEL: slto8f32:
948 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
949 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
950 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
951 ; NODQ-NEXT: vmovq %xmm1, %rax
952 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm1
953 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
954 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
955 ; NODQ-NEXT: vmovq %xmm2, %rax
956 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
957 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
958 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
959 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
960 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
961 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
962 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
963 ; NODQ-NEXT: vmovq %xmm0, %rax
964 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
965 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
966 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
967 ; NODQ-NEXT: vmovq %xmm0, %rax
968 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
969 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
970 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
971 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm0
972 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
973 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
976 ; VLDQ-LABEL: slto8f32:
978 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
981 ; DQNOVL-LABEL: slto8f32:
983 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
985 %b = sitofp <8 x i64> %a to <8 x float>
989 define <16 x float> @slto16f32(<16 x i64> %a) {
990 ; NODQ-LABEL: slto16f32:
992 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
993 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
994 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
995 ; NODQ-NEXT: vmovq %xmm2, %rax
996 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
997 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
998 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
999 ; NODQ-NEXT: vmovq %xmm3, %rax
1000 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm4
1001 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1002 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1003 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1004 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1005 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1006 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1007 ; NODQ-NEXT: vmovq %xmm1, %rax
1008 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1009 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1010 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1011 ; NODQ-NEXT: vmovq %xmm1, %rax
1012 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1013 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1014 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1015 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm1
1016 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1017 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1018 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1019 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1020 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1021 ; NODQ-NEXT: vmovq %xmm2, %rax
1022 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm2
1023 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1024 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm3
1025 ; NODQ-NEXT: vmovq %xmm3, %rax
1026 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1027 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1028 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1029 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1030 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1031 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1032 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1033 ; NODQ-NEXT: vmovq %xmm0, %rax
1034 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1035 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1036 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1037 ; NODQ-NEXT: vmovq %xmm0, %rax
1038 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1039 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1040 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1041 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm0
1042 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1043 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1044 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1047 ; VLDQ-LABEL: slto16f32:
1049 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
1050 ; VLDQ-NEXT: vcvtqq2ps %zmm1, %ymm1
1051 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1054 ; DQNOVL-LABEL: slto16f32:
1056 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
1057 ; DQNOVL-NEXT: vcvtqq2ps %zmm1, %ymm1
1058 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1060 %b = sitofp <16 x i64> %a to <16 x float>
1064 define <8 x double> @slto8f64(<8 x i64> %a) {
1065 ; NODQ-LABEL: slto8f64:
1067 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm1
1068 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1069 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm2, %xmm2
1070 ; NODQ-NEXT: vmovq %xmm1, %rax
1071 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm1
1072 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
1073 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1074 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1075 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1076 ; NODQ-NEXT: vmovq %xmm2, %rax
1077 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1078 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1079 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
1080 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm2
1081 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1082 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1083 ; NODQ-NEXT: vmovq %xmm2, %rax
1084 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1085 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1086 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1087 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1088 ; NODQ-NEXT: vmovq %xmm0, %rax
1089 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm0
1090 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm3[0]
1091 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1092 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1095 ; VLDQ-LABEL: slto8f64:
1097 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1100 ; DQNOVL-LABEL: slto8f64:
1102 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1104 %b = sitofp <8 x i64> %a to <8 x double>
1108 define <16 x double> @slto16f64(<16 x i64> %a) {
1109 ; NODQ-LABEL: slto16f64:
1111 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1112 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1113 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1114 ; NODQ-NEXT: vmovq %xmm2, %rax
1115 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1116 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1117 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm3
1118 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1119 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm4
1120 ; NODQ-NEXT: vmovq %xmm3, %rax
1121 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1122 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1123 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1124 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm3
1125 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1126 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1127 ; NODQ-NEXT: vmovq %xmm3, %rax
1128 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1129 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1130 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1131 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1132 ; NODQ-NEXT: vmovq %xmm0, %rax
1133 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm0
1134 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm4[0]
1135 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0
1136 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
1137 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm2
1138 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1139 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1140 ; NODQ-NEXT: vmovq %xmm2, %rax
1141 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm2
1142 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1143 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm3
1144 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1145 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1146 ; NODQ-NEXT: vmovq %xmm3, %rax
1147 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1148 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1149 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1150 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm3
1151 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1152 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1153 ; NODQ-NEXT: vmovq %xmm3, %rax
1154 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1155 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1156 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1157 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1158 ; NODQ-NEXT: vmovq %xmm1, %rax
1159 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm1
1160 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm4[0]
1161 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1
1162 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm1, %zmm1
1165 ; VLDQ-LABEL: slto16f64:
1167 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1168 ; VLDQ-NEXT: vcvtqq2pd %zmm1, %zmm1
1171 ; DQNOVL-LABEL: slto16f64:
1173 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1174 ; DQNOVL-NEXT: vcvtqq2pd %zmm1, %zmm1
1176 %b = sitofp <16 x i64> %a to <16 x double>
1177 ret <16 x double> %b
1180 define <8 x float> @ulto8f32(<8 x i64> %a) {
1181 ; NODQ-LABEL: ulto8f32:
1183 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
1184 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1185 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm2, %xmm2
1186 ; NODQ-NEXT: vmovq %xmm1, %rax
1187 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm1
1188 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
1189 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1190 ; NODQ-NEXT: vmovq %xmm2, %rax
1191 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1192 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
1193 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1194 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1195 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
1196 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1197 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1198 ; NODQ-NEXT: vmovq %xmm0, %rax
1199 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1200 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
1201 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1202 ; NODQ-NEXT: vmovq %xmm0, %rax
1203 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1204 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
1205 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1206 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm0
1207 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
1208 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1211 ; VLDQ-LABEL: ulto8f32:
1213 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1216 ; DQNOVL-LABEL: ulto8f32:
1218 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1220 %b = uitofp <8 x i64> %a to <8 x float>
1224 define <16 x float> @ulto16f32(<16 x i64> %a) {
1225 ; NODQ-LABEL: ulto16f32:
1227 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1228 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1229 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1230 ; NODQ-NEXT: vmovq %xmm2, %rax
1231 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1232 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1233 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1234 ; NODQ-NEXT: vmovq %xmm3, %rax
1235 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm4
1236 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1237 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1238 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1239 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1240 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1241 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1242 ; NODQ-NEXT: vmovq %xmm1, %rax
1243 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1244 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1245 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1246 ; NODQ-NEXT: vmovq %xmm1, %rax
1247 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1248 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1249 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1250 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm1
1251 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1252 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1253 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1254 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1255 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1256 ; NODQ-NEXT: vmovq %xmm2, %rax
1257 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm2
1258 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1259 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm3
1260 ; NODQ-NEXT: vmovq %xmm3, %rax
1261 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1262 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1263 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1264 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1265 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1266 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1267 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1268 ; NODQ-NEXT: vmovq %xmm0, %rax
1269 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1270 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1271 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1272 ; NODQ-NEXT: vmovq %xmm0, %rax
1273 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1274 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1275 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1276 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm0
1277 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1278 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1279 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1282 ; VLDQ-LABEL: ulto16f32:
1284 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1285 ; VLDQ-NEXT: vcvtuqq2ps %zmm1, %ymm1
1286 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1289 ; DQNOVL-LABEL: ulto16f32:
1291 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1292 ; DQNOVL-NEXT: vcvtuqq2ps %zmm1, %ymm1
1293 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1295 %b = uitofp <16 x i64> %a to <16 x float>
1299 define <8 x double> @uito8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
1300 ; KNL-LABEL: uito8f64_mask:
1302 ; KNL-NEXT: kmovw %edi, %k1
1303 ; KNL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1306 ; VLBW-LABEL: uito8f64_mask:
1308 ; VLBW-NEXT: kmovd %edi, %k1
1309 ; VLBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1312 ; VLNOBW-LABEL: uito8f64_mask:
1314 ; VLNOBW-NEXT: kmovw %edi, %k1
1315 ; VLNOBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1318 ; DQNOVL-LABEL: uito8f64_mask:
1320 ; DQNOVL-NEXT: kmovw %edi, %k1
1321 ; DQNOVL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1324 ; AVX512BW-LABEL: uito8f64_mask:
1325 ; AVX512BW: # %bb.0:
1326 ; AVX512BW-NEXT: kmovd %edi, %k1
1327 ; AVX512BW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1328 ; AVX512BW-NEXT: retq
1329 %1 = bitcast i8 %c to <8 x i1>
1330 %2 = uitofp <8 x i32> %b to <8 x double>
1331 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
1334 define <8 x double> @uito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
1335 ; KNL-LABEL: uito8f64_maskz:
1337 ; KNL-NEXT: kmovw %edi, %k1
1338 ; KNL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1341 ; VLBW-LABEL: uito8f64_maskz:
1343 ; VLBW-NEXT: kmovd %edi, %k1
1344 ; VLBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1347 ; VLNOBW-LABEL: uito8f64_maskz:
1349 ; VLNOBW-NEXT: kmovw %edi, %k1
1350 ; VLNOBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1353 ; DQNOVL-LABEL: uito8f64_maskz:
1355 ; DQNOVL-NEXT: kmovw %edi, %k1
1356 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1359 ; AVX512BW-LABEL: uito8f64_maskz:
1360 ; AVX512BW: # %bb.0:
1361 ; AVX512BW-NEXT: kmovd %edi, %k1
1362 ; AVX512BW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1363 ; AVX512BW-NEXT: retq
1364 %1 = bitcast i8 %b to <8 x i1>
1365 %2 = uitofp <8 x i32> %a to <8 x double>
1366 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
1370 define <4 x double> @uito4f64(<4 x i32> %a) nounwind {
1371 ; NOVL-LABEL: uito4f64:
1373 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1374 ; NOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
1375 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1378 ; VL-LABEL: uito4f64:
1380 ; VL-NEXT: vcvtudq2pd %xmm0, %ymm0
1382 %b = uitofp <4 x i32> %a to <4 x double>
1386 define <16 x float> @uito16f32(<16 x i32> %a) nounwind {
1387 ; ALL-LABEL: uito16f32:
1389 ; ALL-NEXT: vcvtudq2ps %zmm0, %zmm0
1391 %b = uitofp <16 x i32> %a to <16 x float>
1395 define <8 x double> @uito8f64(<8 x i32> %a) {
1396 ; ALL-LABEL: uito8f64:
1398 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm0
1400 %b = uitofp <8 x i32> %a to <8 x double>
1404 define <8 x float> @uito8f32(<8 x i32> %a) nounwind {
1405 ; NOVL-LABEL: uito8f32:
1407 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1408 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1409 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1412 ; VL-LABEL: uito8f32:
1414 ; VL-NEXT: vcvtudq2ps %ymm0, %ymm0
1416 %b = uitofp <8 x i32> %a to <8 x float>
1420 define <4 x float> @uito4f32(<4 x i32> %a) nounwind {
1421 ; NOVL-LABEL: uito4f32:
1423 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1424 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1425 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1426 ; NOVL-NEXT: vzeroupper
1429 ; VL-LABEL: uito4f32:
1431 ; VL-NEXT: vcvtudq2ps %xmm0, %xmm0
1433 %b = uitofp <4 x i32> %a to <4 x float>
1437 define i32 @fptosi(float %a) nounwind {
1438 ; ALL-LABEL: fptosi:
1440 ; ALL-NEXT: vcvttss2si %xmm0, %eax
1442 %b = fptosi float %a to i32
1446 define i32 @fptoui(float %a) nounwind {
1447 ; ALL-LABEL: fptoui:
1449 ; ALL-NEXT: vcvttss2usi %xmm0, %eax
1451 %b = fptoui float %a to i32
1455 define float @uitof32(i32 %a) nounwind {
1456 ; ALL-LABEL: uitof32:
1458 ; ALL-NEXT: vcvtusi2ss %edi, %xmm0, %xmm0
1460 %b = uitofp i32 %a to float
1464 define double @uitof64(i32 %a) nounwind {
1465 ; ALL-LABEL: uitof64:
1467 ; ALL-NEXT: vcvtusi2sd %edi, %xmm0, %xmm0
1469 %b = uitofp i32 %a to double
1473 define <16 x float> @sbto16f32(<16 x i32> %a) {
1474 ; NODQ-LABEL: sbto16f32:
1476 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1477 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1478 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1479 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1482 ; VLDQ-LABEL: sbto16f32:
1484 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1485 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1486 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1489 ; DQNOVL-LABEL: sbto16f32:
1491 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1492 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1493 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1495 %mask = icmp slt <16 x i32> %a, zeroinitializer
1496 %1 = sitofp <16 x i1> %mask to <16 x float>
1500 define <16 x float> @scto16f32(<16 x i8> %a) {
1501 ; ALL-LABEL: scto16f32:
1503 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm0
1504 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1506 %1 = sitofp <16 x i8> %a to <16 x float>
1510 define <16 x float> @ssto16f32(<16 x i16> %a) {
1511 ; ALL-LABEL: ssto16f32:
1513 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1514 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1516 %1 = sitofp <16 x i16> %a to <16 x float>
1520 define <8 x double> @ssto16f64(<8 x i16> %a) {
1521 ; ALL-LABEL: ssto16f64:
1523 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1524 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1526 %1 = sitofp <8 x i16> %a to <8 x double>
1530 define <8 x double> @scto8f64(<8 x i8> %a) {
1531 ; ALL-LABEL: scto8f64:
1533 ; ALL-NEXT: vpmovsxbd %xmm0, %ymm0
1534 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1536 %1 = sitofp <8 x i8> %a to <8 x double>
1540 define <16 x double> @scto16f64(<16 x i8> %a) {
1541 ; ALL-LABEL: scto16f64:
1543 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm1
1544 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1545 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1546 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1548 %b = sitofp <16 x i8> %a to <16 x double>
1549 ret <16 x double> %b
1552 define <16 x double> @sbto16f64(<16 x double> %a) {
1553 ; NODQ-LABEL: sbto16f64:
1555 ; NODQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1556 ; NODQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1557 ; NODQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1558 ; NODQ-NEXT: kunpckbw %k0, %k1, %k1
1559 ; NODQ-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1 {%k1} {z}
1560 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1561 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1562 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1565 ; VLDQ-LABEL: sbto16f64:
1567 ; VLDQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1568 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1569 ; VLDQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1570 ; VLDQ-NEXT: kunpckbw %k0, %k1, %k0
1571 ; VLDQ-NEXT: vpmovm2d %k0, %zmm1
1572 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1573 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1574 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1577 ; DQNOVL-LABEL: sbto16f64:
1579 ; DQNOVL-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1580 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1581 ; DQNOVL-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1582 ; DQNOVL-NEXT: kunpckbw %k0, %k1, %k0
1583 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm1
1584 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1585 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1586 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1588 %cmpres = fcmp ogt <16 x double> %a, zeroinitializer
1589 %1 = sitofp <16 x i1> %cmpres to <16 x double>
1590 ret <16 x double> %1
1593 define <8 x double> @sbto8f64(<8 x double> %a) {
1594 ; NOVLDQ-LABEL: sbto8f64:
1596 ; NOVLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1597 ; NOVLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1598 ; NOVLDQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1599 ; NOVLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1602 ; VLDQ-LABEL: sbto8f64:
1604 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1605 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1606 ; VLDQ-NEXT: vpmovm2d %k0, %ymm0
1607 ; VLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1610 ; VLNODQ-LABEL: sbto8f64:
1612 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1613 ; VLNODQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1614 ; VLNODQ-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
1615 ; VLNODQ-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
1616 ; VLNODQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1619 ; DQNOVL-LABEL: sbto8f64:
1621 ; DQNOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1622 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1623 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1624 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0
1626 %cmpres = fcmp ogt <8 x double> %a, zeroinitializer
1627 %1 = sitofp <8 x i1> %cmpres to <8 x double>
1631 define <8 x float> @sbto8f32(<8 x float> %a) {
1632 ; ALL-LABEL: sbto8f32:
1634 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1635 ; ALL-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
1636 ; ALL-NEXT: vcvtdq2ps %ymm0, %ymm0
1638 %cmpres = fcmp ogt <8 x float> %a, zeroinitializer
1639 %1 = sitofp <8 x i1> %cmpres to <8 x float>
1643 define <4 x float> @sbto4f32(<4 x float> %a) {
1644 ; ALL-LABEL: sbto4f32:
1646 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1647 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1648 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1650 %cmpres = fcmp ogt <4 x float> %a, zeroinitializer
1651 %1 = sitofp <4 x i1> %cmpres to <4 x float>
1655 define <4 x double> @sbto4f64(<4 x double> %a) {
1656 ; NOVL-LABEL: sbto4f64:
1658 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1659 ; NOVL-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0
1660 ; NOVL-NEXT: vpmovqd %zmm0, %ymm0
1661 ; NOVL-NEXT: vcvtdq2pd %xmm0, %ymm0
1664 ; VLDQ-LABEL: sbto4f64:
1666 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1667 ; VLDQ-NEXT: vcmpltpd %ymm0, %ymm1, %k0
1668 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1669 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1672 ; VLNODQ-LABEL: sbto4f64:
1674 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1675 ; VLNODQ-NEXT: vcmpltpd %ymm0, %ymm1, %k1
1676 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1677 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1678 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1680 %cmpres = fcmp ogt <4 x double> %a, zeroinitializer
1681 %1 = sitofp <4 x i1> %cmpres to <4 x double>
1685 define <2 x float> @sbto2f32(<2 x float> %a) {
1686 ; ALL-LABEL: sbto2f32:
1688 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1689 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1690 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1692 %cmpres = fcmp ogt <2 x float> %a, zeroinitializer
1693 %1 = sitofp <2 x i1> %cmpres to <2 x float>
1697 define <2 x double> @sbto2f64(<2 x double> %a) {
1698 ; NOVL-LABEL: sbto2f64:
1700 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1701 ; NOVL-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
1702 ; NOVL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,2,3]
1703 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
1706 ; VLDQ-LABEL: sbto2f64:
1708 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1709 ; VLDQ-NEXT: vcmpltpd %xmm0, %xmm1, %k0
1710 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1711 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1714 ; VLNODQ-LABEL: sbto2f64:
1716 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1717 ; VLNODQ-NEXT: vcmpltpd %xmm0, %xmm1, %k1
1718 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1719 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1720 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1722 %cmpres = fcmp ogt <2 x double> %a, zeroinitializer
1723 %1 = sitofp <2 x i1> %cmpres to <2 x double>
1727 define <16 x float> @ucto16f32(<16 x i8> %a) {
1728 ; ALL-LABEL: ucto16f32:
1730 ; 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
1731 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1733 %b = uitofp <16 x i8> %a to <16 x float>
1737 define <8 x double> @ucto8f64(<8 x i8> %a) {
1738 ; ALL-LABEL: ucto8f64:
1740 ; 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
1741 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1743 %b = uitofp <8 x i8> %a to <8 x double>
1747 define <16 x float> @swto16f32(<16 x i16> %a) {
1748 ; ALL-LABEL: swto16f32:
1750 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1751 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1753 %b = sitofp <16 x i16> %a to <16 x float>
1757 define <8 x double> @swto8f64(<8 x i16> %a) {
1758 ; ALL-LABEL: swto8f64:
1760 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1761 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1763 %b = sitofp <8 x i16> %a to <8 x double>
1767 define <16 x double> @swto16f64(<16 x i16> %a) {
1768 ; ALL-LABEL: swto16f64:
1770 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm1
1771 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1772 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1773 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1775 %b = sitofp <16 x i16> %a to <16 x double>
1776 ret <16 x double> %b
1779 define <16 x double> @ucto16f64(<16 x i8> %a) {
1780 ; ALL-LABEL: ucto16f64:
1782 ; 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
1783 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1784 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1785 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1787 %b = uitofp <16 x i8> %a to <16 x double>
1788 ret <16 x double> %b
1791 define <16 x float> @uwto16f32(<16 x i16> %a) {
1792 ; ALL-LABEL: uwto16f32:
1794 ; 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
1795 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1797 %b = uitofp <16 x i16> %a to <16 x float>
1801 define <8 x double> @uwto8f64(<8 x i16> %a) {
1802 ; ALL-LABEL: uwto8f64:
1804 ; 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
1805 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1807 %b = uitofp <8 x i16> %a to <8 x double>
1811 define <16 x double> @uwto16f64(<16 x i16> %a) {
1812 ; ALL-LABEL: uwto16f64:
1814 ; 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
1815 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1816 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1817 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1819 %b = uitofp <16 x i16> %a to <16 x double>
1820 ret <16 x double> %b
1823 define <16 x float> @sito16f32(<16 x i32> %a) {
1824 ; ALL-LABEL: sito16f32:
1826 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1828 %b = sitofp <16 x i32> %a to <16 x float>
1832 define <16 x double> @sito16f64(<16 x i32> %a) {
1833 ; ALL-LABEL: sito16f64:
1835 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm2
1836 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
1837 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm1
1838 ; ALL-NEXT: vmovaps %zmm2, %zmm0
1840 %b = sitofp <16 x i32> %a to <16 x double>
1841 ret <16 x double> %b
1844 define <16 x float> @usto16f32(<16 x i16> %a) {
1845 ; ALL-LABEL: usto16f32:
1847 ; 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
1848 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1850 %b = uitofp <16 x i16> %a to <16 x float>
1854 define <16 x float> @ubto16f32(<16 x i32> %a) {
1855 ; NODQ-LABEL: ubto16f32:
1857 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1858 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1859 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1860 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm0
1861 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1864 ; VLDQ-LABEL: ubto16f32:
1866 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1867 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1868 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm0
1869 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1872 ; DQNOVL-LABEL: ubto16f32:
1874 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1875 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1876 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm0
1877 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1879 %mask = icmp slt <16 x i32> %a, zeroinitializer
1880 %1 = uitofp <16 x i1> %mask to <16 x float>
1884 define <16 x double> @ubto16f64(<16 x i32> %a) {
1885 ; NODQ-LABEL: ubto16f64:
1887 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1888 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1889 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1890 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm1
1891 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1892 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1893 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1896 ; VLDQ-LABEL: ubto16f64:
1898 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1899 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1900 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm1
1901 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1902 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1903 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1906 ; DQNOVL-LABEL: ubto16f64:
1908 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1909 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1910 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm1
1911 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1912 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1913 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1915 %mask = icmp slt <16 x i32> %a, zeroinitializer
1916 %1 = uitofp <16 x i1> %mask to <16 x double>
1917 ret <16 x double> %1
1920 define <8 x float> @ubto8f32(<8 x i32> %a) {
1921 ; NOVL-LABEL: ubto8f32:
1923 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1924 ; NOVL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1925 ; NOVL-NEXT: vpbroadcastd {{.*#+}} ymm1 = [1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216]
1926 ; NOVL-NEXT: vpand %ymm1, %ymm0, %ymm0
1929 ; VL-LABEL: ubto8f32:
1931 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1932 ; VL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1933 ; VL-NEXT: vpandd {{.*}}(%rip){1to8}, %ymm0, %ymm0
1935 %mask = icmp slt <8 x i32> %a, zeroinitializer
1936 %1 = uitofp <8 x i1> %mask to <8 x float>
1940 define <8 x double> @ubto8f64(<8 x i32> %a) {
1941 ; ALL-LABEL: ubto8f64:
1943 ; ALL-NEXT: vpsrld $31, %ymm0, %ymm0
1944 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1946 %mask = icmp slt <8 x i32> %a, zeroinitializer
1947 %1 = uitofp <8 x i1> %mask to <8 x double>
1951 define <4 x float> @ubto4f32(<4 x i32> %a) {
1952 ; NOVL-LABEL: ubto4f32:
1954 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1955 ; NOVL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1956 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
1957 ; NOVL-NEXT: vpand %xmm1, %xmm0, %xmm0
1960 ; VL-LABEL: ubto4f32:
1962 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1963 ; VL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1964 ; VL-NEXT: vpandd {{.*}}(%rip){1to4}, %xmm0, %xmm0
1966 %mask = icmp slt <4 x i32> %a, zeroinitializer
1967 %1 = uitofp <4 x i1> %mask to <4 x float>
1971 define <4 x double> @ubto4f64(<4 x i32> %a) {
1972 ; ALL-LABEL: ubto4f64:
1974 ; ALL-NEXT: vpsrld $31, %xmm0, %xmm0
1975 ; ALL-NEXT: vcvtdq2pd %xmm0, %ymm0
1977 %mask = icmp slt <4 x i32> %a, zeroinitializer
1978 %1 = uitofp <4 x i1> %mask to <4 x double>
1982 define <2 x float> @ubto2f32(<2 x i32> %a) {
1983 ; NOVL-LABEL: ubto2f32:
1985 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1986 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1987 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
1988 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
1991 ; VL-LABEL: ubto2f32:
1993 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1994 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1995 ; VL-NEXT: vpandnd {{.*}}(%rip){1to4}, %xmm0, %xmm0
1997 %mask = icmp ne <2 x i32> %a, zeroinitializer
1998 %1 = uitofp <2 x i1> %mask to <2 x float>
2002 define <2 x double> @ubto2f64(<2 x i32> %a) {
2003 ; NOVL-LABEL: ubto2f64:
2005 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2006 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2007 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1,1,1,1]
2008 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
2009 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
2012 ; VL-LABEL: ubto2f64:
2014 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2015 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2016 ; VL-NEXT: vpandnd {{.*}}(%rip){1to4}, %xmm0, %xmm0
2017 ; VL-NEXT: vcvtdq2pd %xmm0, %xmm0
2019 %mask = icmp ne <2 x i32> %a, zeroinitializer
2020 %1 = uitofp <2 x i1> %mask to <2 x double>
2024 define <2 x i64> @test_2f64toub(<2 x double> %a, <2 x i64> %passthru) {
2025 ; NOVLDQ-LABEL: test_2f64toub:
2027 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2028 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2029 ; NOVLDQ-NEXT: vcvttpd2udq %zmm0, %ymm0
2030 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2031 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2032 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2033 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2034 ; NOVLDQ-NEXT: vzeroupper
2037 ; VLDQ-LABEL: test_2f64toub:
2039 ; VLDQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2040 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2041 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2042 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2045 ; VLNODQ-LABEL: test_2f64toub:
2047 ; VLNODQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2048 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2049 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2050 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2053 ; DQNOVL-LABEL: test_2f64toub:
2055 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2056 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2057 ; DQNOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
2058 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2059 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2060 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2061 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2062 ; DQNOVL-NEXT: vzeroupper
2064 %mask = fptoui <2 x double> %a to <2 x i1>
2065 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2066 ret <2 x i64> %select
2069 define <4 x i64> @test_4f64toub(<4 x double> %a, <4 x i64> %passthru) {
2070 ; NOVLDQ-LABEL: test_4f64toub:
2072 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2073 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2074 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2075 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2076 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2077 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2080 ; VLDQ-LABEL: test_4f64toub:
2082 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2083 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2084 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2085 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2088 ; VLNODQ-LABEL: test_4f64toub:
2090 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2091 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2092 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2093 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2096 ; DQNOVL-LABEL: test_4f64toub:
2098 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2099 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2100 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2101 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2102 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2103 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2105 %mask = fptoui <4 x double> %a to <4 x i1>
2106 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2107 ret <4 x i64> %select
2110 define <8 x i64> @test_8f64toub(<8 x double> %a, <8 x i64> %passthru) {
2111 ; NOVLDQ-LABEL: test_8f64toub:
2113 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2114 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2115 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2116 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2119 ; VLDQ-LABEL: test_8f64toub:
2121 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2122 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2123 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2124 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2127 ; VLNODQ-LABEL: test_8f64toub:
2129 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2130 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2131 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2132 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2135 ; DQNOVL-LABEL: test_8f64toub:
2137 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2138 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2139 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2140 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2142 %mask = fptoui <8 x double> %a to <8 x i1>
2143 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2144 ret <8 x i64> %select
2147 define <2 x i64> @test_2f32toub(<2 x float> %a, <2 x i64> %passthru) {
2148 ; NOVLDQ-LABEL: test_2f32toub:
2150 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2151 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2152 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2153 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2154 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2155 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2156 ; NOVLDQ-NEXT: vzeroupper
2159 ; VLDQ-LABEL: test_2f32toub:
2161 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2162 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2163 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2164 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2167 ; VLNODQ-LABEL: test_2f32toub:
2169 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2170 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2171 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2172 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2175 ; DQNOVL-LABEL: test_2f32toub:
2177 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2178 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2179 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2180 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2181 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2182 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2183 ; DQNOVL-NEXT: vzeroupper
2185 %mask = fptoui <2 x float> %a to <2 x i1>
2186 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2187 ret <2 x i64> %select
2190 define <4 x i64> @test_4f32toub(<4 x float> %a, <4 x i64> %passthru) {
2191 ; NOVLDQ-LABEL: test_4f32toub:
2193 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2194 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2195 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2196 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2197 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2198 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2201 ; VLDQ-LABEL: test_4f32toub:
2203 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2204 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2205 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2206 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2209 ; VLNODQ-LABEL: test_4f32toub:
2211 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2212 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2213 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2214 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2217 ; DQNOVL-LABEL: test_4f32toub:
2219 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2220 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2221 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2222 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2223 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2224 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2226 %mask = fptoui <4 x float> %a to <4 x i1>
2227 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2228 ret <4 x i64> %select
2231 define <8 x i64> @test_8f32toub(<8 x float> %a, <8 x i64> %passthru) {
2232 ; NOVLDQ-LABEL: test_8f32toub:
2234 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2235 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2236 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2237 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2240 ; VLDQ-LABEL: test_8f32toub:
2242 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2243 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2244 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2245 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2248 ; VLNODQ-LABEL: test_8f32toub:
2250 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2251 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2252 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2253 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2256 ; DQNOVL-LABEL: test_8f32toub:
2258 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2259 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2260 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2261 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2263 %mask = fptoui <8 x float> %a to <8 x i1>
2264 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2265 ret <8 x i64> %select
2268 define <16 x i32> @test_16f32toub(<16 x float> %a, <16 x i32> %passthru) {
2269 ; NODQ-LABEL: test_16f32toub:
2271 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2272 ; NODQ-NEXT: vpslld $31, %zmm0, %zmm0
2273 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2274 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2277 ; VLDQ-LABEL: test_16f32toub:
2279 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2280 ; VLDQ-NEXT: vpslld $31, %zmm0, %zmm0
2281 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2282 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2285 ; DQNOVL-LABEL: test_16f32toub:
2287 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2288 ; DQNOVL-NEXT: vpslld $31, %zmm0, %zmm0
2289 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2290 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2292 %mask = fptoui <16 x float> %a to <16 x i1>
2293 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2294 ret <16 x i32> %select
2297 define <2 x i64> @test_2f64tosb(<2 x double> %a, <2 x i64> %passthru) {
2298 ; NOVLDQ-LABEL: test_2f64tosb:
2300 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2301 ; NOVLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2302 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2303 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2304 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2305 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2306 ; NOVLDQ-NEXT: vzeroupper
2309 ; VLDQ-LABEL: test_2f64tosb:
2311 ; VLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2312 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2313 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2314 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2317 ; VLNODQ-LABEL: test_2f64tosb:
2319 ; VLNODQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2320 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2321 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2322 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2325 ; DQNOVL-LABEL: test_2f64tosb:
2327 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2328 ; DQNOVL-NEXT: vcvttpd2dq %xmm0, %xmm0
2329 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2330 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2331 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2332 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2333 ; DQNOVL-NEXT: vzeroupper
2335 %mask = fptosi <2 x double> %a to <2 x i1>
2336 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2337 ret <2 x i64> %select
2340 define <4 x i64> @test_4f64tosb(<4 x double> %a, <4 x i64> %passthru) {
2341 ; NOVLDQ-LABEL: test_4f64tosb:
2343 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2344 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2345 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2346 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2347 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2350 ; VLDQ-LABEL: test_4f64tosb:
2352 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2353 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2354 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2357 ; VLNODQ-LABEL: test_4f64tosb:
2359 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2360 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2361 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2364 ; DQNOVL-LABEL: test_4f64tosb:
2366 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2367 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2368 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2369 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2370 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2372 %mask = fptosi <4 x double> %a to <4 x i1>
2373 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2374 ret <4 x i64> %select
2377 define <8 x i64> @test_8f64tosb(<8 x double> %a, <8 x i64> %passthru) {
2378 ; NOVLDQ-LABEL: test_8f64tosb:
2380 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2381 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2382 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2385 ; VLDQ-LABEL: test_8f64tosb:
2387 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2388 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2389 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2392 ; VLNODQ-LABEL: test_8f64tosb:
2394 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2395 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2396 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2399 ; DQNOVL-LABEL: test_8f64tosb:
2401 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2402 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2403 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2405 %mask = fptosi <8 x double> %a to <8 x i1>
2406 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2407 ret <8 x i64> %select
2410 define <2 x i64> @test_2f32tosb(<2 x float> %a, <2 x i64> %passthru) {
2411 ; NOVLDQ-LABEL: test_2f32tosb:
2413 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2414 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2415 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2416 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2417 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2418 ; NOVLDQ-NEXT: vzeroupper
2421 ; VLDQ-LABEL: test_2f32tosb:
2423 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2424 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2425 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2428 ; VLNODQ-LABEL: test_2f32tosb:
2430 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2431 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2432 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2435 ; DQNOVL-LABEL: test_2f32tosb:
2437 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2438 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2439 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2440 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2441 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2442 ; DQNOVL-NEXT: vzeroupper
2444 %mask = fptosi <2 x float> %a to <2 x i1>
2445 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2446 ret <2 x i64> %select
2449 define <4 x i64> @test_4f32tosb(<4 x float> %a, <4 x i64> %passthru) {
2450 ; NOVLDQ-LABEL: test_4f32tosb:
2452 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2453 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2454 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2455 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2456 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2459 ; VLDQ-LABEL: test_4f32tosb:
2461 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2462 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2463 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2466 ; VLNODQ-LABEL: test_4f32tosb:
2468 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2469 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2470 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2473 ; DQNOVL-LABEL: test_4f32tosb:
2475 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2476 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2477 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2478 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2479 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2481 %mask = fptosi <4 x float> %a to <4 x i1>
2482 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2483 ret <4 x i64> %select
2486 define <8 x i64> @test_8f32tosb(<8 x float> %a, <8 x i64> %passthru) {
2487 ; NOVLDQ-LABEL: test_8f32tosb:
2489 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2490 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2491 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2494 ; VLDQ-LABEL: test_8f32tosb:
2496 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2497 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2498 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2501 ; VLNODQ-LABEL: test_8f32tosb:
2503 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2504 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2505 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2508 ; DQNOVL-LABEL: test_8f32tosb:
2510 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2511 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2512 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2514 %mask = fptosi <8 x float> %a to <8 x i1>
2515 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2516 ret <8 x i64> %select
2519 define <16 x i32> @test_16f32tosb(<16 x float> %a, <16 x i32> %passthru) {
2520 ; NODQ-LABEL: test_16f32tosb:
2522 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2523 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2524 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2527 ; VLDQ-LABEL: test_16f32tosb:
2529 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2530 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2531 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2534 ; DQNOVL-LABEL: test_16f32tosb:
2536 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2537 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2538 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2540 %mask = fptosi <16 x float> %a to <16 x i1>
2541 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2542 ret <16 x i32> %select
2545 define <2 x double> @test_sito2f64_mask_load(<2 x i32> *%a, <2 x i64> %c) {
2546 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2548 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2551 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2553 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2555 ; NOVLDQ-LABEL: test_sito2f64_mask_load:
2557 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2558 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2559 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2560 ; NOVLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0
2561 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2562 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2563 ; NOVLDQ-NEXT: vzeroupper
2566 ; VLDQ-LABEL: test_sito2f64_mask_load:
2568 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2569 ; VLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2572 ; VLNODQ-LABEL: test_sito2f64_mask_load:
2574 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2575 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2576 ; VLNODQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2579 ; DQNOVL-LABEL: test_sito2f64_mask_load:
2581 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2582 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2583 ; DQNOVL-NEXT: vcvtdq2pd (%rdi), %xmm0
2584 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2585 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2586 ; DQNOVL-NEXT: vzeroupper
2588 %mask = icmp slt <2 x i64> %c, zeroinitializer
2589 %ld = load <2 x i32>, <2 x i32> *%a
2590 %cvt = sitofp <2 x i32> %ld to <2 x double>
2591 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2592 ret <2 x double> %sel
2595 define <2 x double> @test_uito2f64_mask_load(<2 x i32> *%a, <2 x i64> %c) {
2596 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2598 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2601 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2603 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2605 ; NOVLDQ-LABEL: test_uito2f64_mask_load:
2607 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2608 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2609 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2610 ; NOVLDQ-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2611 ; NOVLDQ-NEXT: vcvtudq2pd %ymm0, %zmm0
2612 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2613 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2614 ; NOVLDQ-NEXT: vzeroupper
2617 ; VLDQ-LABEL: test_uito2f64_mask_load:
2619 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2620 ; VLDQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2623 ; VLNODQ-LABEL: test_uito2f64_mask_load:
2625 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2626 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2627 ; VLNODQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2630 ; DQNOVL-LABEL: test_uito2f64_mask_load:
2632 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2633 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2634 ; DQNOVL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2635 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
2636 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2637 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2638 ; DQNOVL-NEXT: vzeroupper
2640 %mask = icmp slt <2 x i64> %c, zeroinitializer
2641 %ld = load <2 x i32>, <2 x i32> *%a
2642 %cvt = uitofp <2 x i32> %ld to <2 x double>
2643 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2644 ret <2 x double> %sel