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: vcvtsi2sdq %rax, %xmm2, %xmm2
26 ; NODQ-NEXT: vmovq %xmm1, %rax
27 ; NODQ-NEXT: vcvtsi2sdq %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: vcvtsi2sdq %rax, %xmm3, %xmm3
32 ; NODQ-NEXT: vmovq %xmm2, %rax
33 ; NODQ-NEXT: vcvtsi2sdq %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: vcvtsi2sdq %rax, %xmm4, %xmm3
39 ; NODQ-NEXT: vmovq %xmm2, %rax
40 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
41 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
42 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
43 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm3
44 ; NODQ-NEXT: vmovq %xmm0, %rax
45 ; NODQ-NEXT: vcvtsi2sdq %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: vcvtsi2sdq %rax, %xmm2, %xmm2
70 ; NODQ-NEXT: vmovq %xmm1, %rax
71 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm1
72 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
73 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
74 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm2
75 ; NODQ-NEXT: vmovq %xmm0, %rax
76 ; NODQ-NEXT: vcvtsi2sdq %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: vcvtsi2sdq %rax, %xmm1, %xmm1
101 ; NODQ-NEXT: vmovq %xmm0, %rax
102 ; NODQ-NEXT: vcvtsi2sdq %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 ; NODQ-LABEL: sltof2f32:
125 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
126 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm1, %xmm1
127 ; NODQ-NEXT: vmovq %xmm0, %rax
128 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm0
129 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
130 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm1
131 ; NODQ-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,0]
134 ; VLDQ-LABEL: sltof2f32:
136 ; VLDQ-NEXT: vcvtqq2ps %xmm0, %xmm0
139 ; DQNOVL-LABEL: sltof2f32:
141 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
142 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
143 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
144 ; DQNOVL-NEXT: vzeroupper
146 %b = sitofp <2 x i64> %a to <2 x float>
150 define <4 x float> @slto4f32_mem(<4 x i64>* %a) {
151 ; NODQ-LABEL: slto4f32_mem:
153 ; NODQ-NEXT: vmovdqu (%rdi), %xmm0
154 ; NODQ-NEXT: vmovdqu 16(%rdi), %xmm1
155 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
156 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm2
157 ; NODQ-NEXT: vmovq %xmm0, %rax
158 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm0
159 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
160 ; NODQ-NEXT: vmovq %xmm1, %rax
161 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm2
162 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm2[0],xmm0[3]
163 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
164 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm1
165 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm1[0]
168 ; VLDQ-LABEL: slto4f32_mem:
170 ; VLDQ-NEXT: vcvtqq2psy (%rdi), %xmm0
173 ; DQNOVL-LABEL: slto4f32_mem:
175 ; DQNOVL-NEXT: vmovups (%rdi), %ymm0
176 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
177 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
178 ; DQNOVL-NEXT: vzeroupper
180 %a1 = load <4 x i64>, <4 x i64>* %a, align 8
181 %b = sitofp <4 x i64> %a1 to <4 x float>
185 define <4 x i64> @f64to4sl(<4 x double> %a) {
186 ; NODQ-LABEL: f64to4sl:
188 ; NODQ-NEXT: vextractf128 $1, %ymm0, %xmm1
189 ; NODQ-NEXT: vcvttsd2si %xmm1, %rax
190 ; NODQ-NEXT: vmovq %rax, %xmm2
191 ; NODQ-NEXT: vpermilpd {{.*#+}} xmm1 = xmm1[1,0]
192 ; NODQ-NEXT: vcvttsd2si %xmm1, %rax
193 ; NODQ-NEXT: vmovq %rax, %xmm1
194 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
195 ; NODQ-NEXT: vcvttsd2si %xmm0, %rax
196 ; NODQ-NEXT: vmovq %rax, %xmm2
197 ; NODQ-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0]
198 ; NODQ-NEXT: vcvttsd2si %xmm0, %rax
199 ; NODQ-NEXT: vmovq %rax, %xmm0
200 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
201 ; NODQ-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
204 ; VLDQ-LABEL: f64to4sl:
206 ; VLDQ-NEXT: vcvttpd2qq %ymm0, %ymm0
209 ; DQNOVL-LABEL: f64to4sl:
211 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
212 ; DQNOVL-NEXT: vcvttpd2qq %zmm0, %zmm0
213 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
215 %b = fptosi <4 x double> %a to <4 x i64>
219 define <4 x i64> @f32to4sl(<4 x float> %a) {
220 ; NODQ-LABEL: f32to4sl:
222 ; NODQ-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[3,1,2,3]
223 ; NODQ-NEXT: vcvttss2si %xmm1, %rax
224 ; NODQ-NEXT: vmovq %rax, %xmm1
225 ; NODQ-NEXT: vpermilpd {{.*#+}} xmm2 = xmm0[1,0]
226 ; NODQ-NEXT: vcvttss2si %xmm2, %rax
227 ; NODQ-NEXT: vmovq %rax, %xmm2
228 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
229 ; NODQ-NEXT: vcvttss2si %xmm0, %rax
230 ; NODQ-NEXT: vmovq %rax, %xmm2
231 ; NODQ-NEXT: vmovshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
232 ; NODQ-NEXT: vcvttss2si %xmm0, %rax
233 ; NODQ-NEXT: vmovq %rax, %xmm0
234 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
235 ; NODQ-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
238 ; VLDQ-LABEL: f32to4sl:
240 ; VLDQ-NEXT: vcvttps2qq %xmm0, %ymm0
243 ; DQNOVL-LABEL: f32to4sl:
245 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
246 ; DQNOVL-NEXT: vcvttps2qq %ymm0, %zmm0
247 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
249 %b = fptosi <4 x float> %a to <4 x i64>
253 define <4 x float> @slto4f32(<4 x i64> %a) {
254 ; NODQ-LABEL: slto4f32:
256 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
257 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm1, %xmm1
258 ; NODQ-NEXT: vmovq %xmm0, %rax
259 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm2
260 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
261 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
262 ; NODQ-NEXT: vmovq %xmm0, %rax
263 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm2
264 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
265 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
266 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm0
267 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
268 ; NODQ-NEXT: vzeroupper
271 ; VLDQ-LABEL: slto4f32:
273 ; VLDQ-NEXT: vcvtqq2ps %ymm0, %xmm0
274 ; VLDQ-NEXT: vzeroupper
277 ; DQNOVL-LABEL: slto4f32:
279 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
280 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
281 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
282 ; DQNOVL-NEXT: vzeroupper
284 %b = sitofp <4 x i64> %a to <4 x float>
288 define <4 x float> @ulto4f32(<4 x i64> %a) {
289 ; NODQ-LABEL: ulto4f32:
291 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
292 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm1, %xmm1
293 ; NODQ-NEXT: vmovq %xmm0, %rax
294 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm2, %xmm2
295 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
296 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
297 ; NODQ-NEXT: vmovq %xmm0, %rax
298 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm2
299 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
300 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
301 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm0
302 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
303 ; NODQ-NEXT: vzeroupper
306 ; VLDQ-LABEL: ulto4f32:
308 ; VLDQ-NEXT: vcvtuqq2ps %ymm0, %xmm0
309 ; VLDQ-NEXT: vzeroupper
312 ; DQNOVL-LABEL: ulto4f32:
314 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
315 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
316 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
317 ; DQNOVL-NEXT: vzeroupper
319 %b = uitofp <4 x i64> %a to <4 x float>
323 define <8 x double> @ulto8f64(<8 x i64> %a) {
324 ; NODQ-LABEL: ulto8f64:
326 ; NODQ-NEXT: vpandq {{.*}}(%rip){1to8}, %zmm0, %zmm1
327 ; NODQ-NEXT: vporq {{.*}}(%rip){1to8}, %zmm1, %zmm1
328 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
329 ; NODQ-NEXT: vporq {{.*}}(%rip){1to8}, %zmm0, %zmm0
330 ; NODQ-NEXT: vsubpd {{.*}}(%rip){1to8}, %zmm0, %zmm0
331 ; NODQ-NEXT: vaddpd %zmm0, %zmm1, %zmm0
334 ; VLDQ-LABEL: ulto8f64:
336 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
339 ; DQNOVL-LABEL: ulto8f64:
341 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
343 %b = uitofp <8 x i64> %a to <8 x double>
347 define <16 x double> @ulto16f64(<16 x i64> %a) {
348 ; NODQ-LABEL: ulto16f64:
350 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295]
351 ; NODQ-NEXT: vpandq %zmm2, %zmm0, %zmm3
352 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm4 = [4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200]
353 ; NODQ-NEXT: vporq %zmm4, %zmm3, %zmm3
354 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
355 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm5 = [4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072]
356 ; NODQ-NEXT: vporq %zmm5, %zmm0, %zmm0
357 ; 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]
358 ; NODQ-NEXT: vsubpd %zmm6, %zmm0, %zmm0
359 ; NODQ-NEXT: vaddpd %zmm0, %zmm3, %zmm0
360 ; NODQ-NEXT: vpandq %zmm2, %zmm1, %zmm2
361 ; NODQ-NEXT: vporq %zmm4, %zmm2, %zmm2
362 ; NODQ-NEXT: vpsrlq $32, %zmm1, %zmm1
363 ; NODQ-NEXT: vporq %zmm5, %zmm1, %zmm1
364 ; NODQ-NEXT: vsubpd %zmm6, %zmm1, %zmm1
365 ; NODQ-NEXT: vaddpd %zmm1, %zmm2, %zmm1
368 ; VLDQ-LABEL: ulto16f64:
370 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
371 ; VLDQ-NEXT: vcvtuqq2pd %zmm1, %zmm1
374 ; DQNOVL-LABEL: ulto16f64:
376 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
377 ; DQNOVL-NEXT: vcvtuqq2pd %zmm1, %zmm1
379 %b = uitofp <16 x i64> %a to <16 x double>
383 define <16 x i32> @f64to16si(<16 x float> %a) nounwind {
384 ; ALL-LABEL: f64to16si:
386 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
388 %b = fptosi <16 x float> %a to <16 x i32>
392 define <16 x i8> @f32to16sc(<16 x float> %f) {
393 ; ALL-LABEL: f32to16sc:
395 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
396 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
397 ; ALL-NEXT: vzeroupper
399 %res = fptosi <16 x float> %f to <16 x i8>
403 define <16 x i16> @f32to16ss(<16 x float> %f) {
404 ; ALL-LABEL: f32to16ss:
406 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
407 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
409 %res = fptosi <16 x float> %f to <16 x i16>
413 define <16 x i32> @f32to16ui(<16 x float> %a) nounwind {
414 ; ALL-LABEL: f32to16ui:
416 ; ALL-NEXT: vcvttps2udq %zmm0, %zmm0
418 %b = fptoui <16 x float> %a to <16 x i32>
422 define <16 x i8> @f32to16uc(<16 x float> %f) {
423 ; ALL-LABEL: f32to16uc:
425 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
426 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
427 ; ALL-NEXT: vzeroupper
429 %res = fptoui <16 x float> %f to <16 x i8>
433 define <16 x i16> @f32to16us(<16 x float> %f) {
434 ; ALL-LABEL: f32to16us:
436 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
437 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
439 %res = fptoui <16 x float> %f to <16 x i16>
443 define <8 x i32> @f32to8ui(<8 x float> %a) nounwind {
444 ; NOVL-LABEL: f32to8ui:
446 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
447 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
448 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
451 ; VL-LABEL: f32to8ui:
453 ; VL-NEXT: vcvttps2udq %ymm0, %ymm0
455 %b = fptoui <8 x float> %a to <8 x i32>
459 define <4 x i32> @f32to4ui(<4 x float> %a) nounwind {
460 ; NOVL-LABEL: f32to4ui:
462 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
463 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
464 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
465 ; NOVL-NEXT: vzeroupper
468 ; VL-LABEL: f32to4ui:
470 ; VL-NEXT: vcvttps2udq %xmm0, %xmm0
472 %b = fptoui <4 x float> %a to <4 x i32>
476 define <8 x i32> @f64to8ui(<8 x double> %a) nounwind {
477 ; ALL-LABEL: f64to8ui:
479 ; ALL-NEXT: vcvttpd2udq %zmm0, %ymm0
481 %b = fptoui <8 x double> %a to <8 x i32>
485 define <8 x i16> @f64to8us(<8 x double> %f) {
486 ; NOVL-LABEL: f64to8us:
488 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
489 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
490 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
491 ; NOVL-NEXT: vzeroupper
494 ; VL-LABEL: f64to8us:
496 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
497 ; VL-NEXT: vpmovdw %ymm0, %xmm0
498 ; VL-NEXT: vzeroupper
500 %res = fptoui <8 x double> %f to <8 x i16>
504 define <8 x i8> @f64to8uc(<8 x double> %f) {
505 ; NOVL-LABEL: f64to8uc:
507 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
508 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
509 ; NOVL-NEXT: vzeroupper
512 ; VL-LABEL: f64to8uc:
514 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
515 ; VL-NEXT: vpmovdb %ymm0, %xmm0
516 ; VL-NEXT: vzeroupper
518 %res = fptoui <8 x double> %f to <8 x i8>
522 define <4 x i32> @f64to4ui(<4 x double> %a) nounwind {
523 ; NOVL-LABEL: f64to4ui:
525 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
526 ; NOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
527 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
528 ; NOVL-NEXT: vzeroupper
531 ; VL-LABEL: f64to4ui:
533 ; VL-NEXT: vcvttpd2udq %ymm0, %xmm0
534 ; VL-NEXT: vzeroupper
536 %b = fptoui <4 x double> %a to <4 x i32>
540 define <8 x double> @sito8f64(<8 x i32> %a) {
541 ; ALL-LABEL: sito8f64:
543 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
545 %b = sitofp <8 x i32> %a to <8 x double>
548 define <8 x double> @i32to8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
549 ; KNL-LABEL: i32to8f64_mask:
551 ; KNL-NEXT: kmovw %edi, %k1
552 ; KNL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
555 ; VLBW-LABEL: i32to8f64_mask:
557 ; VLBW-NEXT: kmovd %edi, %k1
558 ; VLBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
561 ; VLNOBW-LABEL: i32to8f64_mask:
563 ; VLNOBW-NEXT: kmovw %edi, %k1
564 ; VLNOBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
567 ; DQNOVL-LABEL: i32to8f64_mask:
569 ; DQNOVL-NEXT: kmovw %edi, %k1
570 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
573 ; AVX512BW-LABEL: i32to8f64_mask:
575 ; AVX512BW-NEXT: kmovd %edi, %k1
576 ; AVX512BW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
577 ; AVX512BW-NEXT: retq
578 %1 = bitcast i8 %c to <8 x i1>
579 %2 = sitofp <8 x i32> %b to <8 x double>
580 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
583 define <8 x double> @sito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
584 ; KNL-LABEL: sito8f64_maskz:
586 ; KNL-NEXT: kmovw %edi, %k1
587 ; KNL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
590 ; VLBW-LABEL: sito8f64_maskz:
592 ; VLBW-NEXT: kmovd %edi, %k1
593 ; VLBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
596 ; VLNOBW-LABEL: sito8f64_maskz:
598 ; VLNOBW-NEXT: kmovw %edi, %k1
599 ; VLNOBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
602 ; DQNOVL-LABEL: sito8f64_maskz:
604 ; DQNOVL-NEXT: kmovw %edi, %k1
605 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
608 ; AVX512BW-LABEL: sito8f64_maskz:
610 ; AVX512BW-NEXT: kmovd %edi, %k1
611 ; AVX512BW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
612 ; AVX512BW-NEXT: retq
613 %1 = bitcast i8 %b to <8 x i1>
614 %2 = sitofp <8 x i32> %a to <8 x double>
615 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
619 define <8 x i32> @f64to8si(<8 x double> %a) {
620 ; ALL-LABEL: f64to8si:
622 ; ALL-NEXT: vcvttpd2dq %zmm0, %ymm0
624 %b = fptosi <8 x double> %a to <8 x i32>
628 define <8 x i16> @f64to8ss(<8 x double> %f) {
629 ; NOVL-LABEL: f64to8ss:
631 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
632 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
633 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
634 ; NOVL-NEXT: vzeroupper
637 ; VL-LABEL: f64to8ss:
639 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
640 ; VL-NEXT: vpmovdw %ymm0, %xmm0
641 ; VL-NEXT: vzeroupper
643 %res = fptosi <8 x double> %f to <8 x i16>
647 define <8 x i8> @f64to8sc(<8 x double> %f) {
648 ; NOVL-LABEL: f64to8sc:
650 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
651 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
652 ; NOVL-NEXT: vzeroupper
655 ; VL-LABEL: f64to8sc:
657 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
658 ; VL-NEXT: vpmovdb %ymm0, %xmm0
659 ; VL-NEXT: vzeroupper
661 %res = fptosi <8 x double> %f to <8 x i8>
665 define <4 x i32> @f64to4si(<4 x double> %a) {
666 ; ALL-LABEL: f64to4si:
668 ; ALL-NEXT: vcvttpd2dq %ymm0, %xmm0
669 ; ALL-NEXT: vzeroupper
671 %b = fptosi <4 x double> %a to <4 x i32>
675 define <16 x float> @f64to16f32(<16 x double> %b) nounwind {
676 ; ALL-LABEL: f64to16f32:
678 ; ALL-NEXT: vcvtpd2ps %zmm0, %ymm0
679 ; ALL-NEXT: vcvtpd2ps %zmm1, %ymm1
680 ; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
682 %a = fptrunc <16 x double> %b to <16 x float>
686 define <4 x float> @f64to4f32(<4 x double> %b) {
687 ; ALL-LABEL: f64to4f32:
689 ; ALL-NEXT: vcvtpd2ps %ymm0, %xmm0
690 ; ALL-NEXT: vzeroupper
692 %a = fptrunc <4 x double> %b to <4 x float>
696 define <4 x float> @f64to4f32_mask(<4 x double> %b, <4 x i1> %mask) {
697 ; NOVLDQ-LABEL: f64to4f32_mask:
699 ; NOVLDQ-NEXT: vpslld $31, %xmm1, %xmm1
700 ; NOVLDQ-NEXT: vptestmd %zmm1, %zmm1, %k1
701 ; NOVLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0
702 ; NOVLDQ-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
703 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
704 ; NOVLDQ-NEXT: vzeroupper
707 ; VLDQ-LABEL: f64to4f32_mask:
709 ; VLDQ-NEXT: vpslld $31, %xmm1, %xmm1
710 ; VLDQ-NEXT: vpmovd2m %xmm1, %k1
711 ; VLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
712 ; VLDQ-NEXT: vzeroupper
715 ; VLNODQ-LABEL: f64to4f32_mask:
717 ; VLNODQ-NEXT: vpslld $31, %xmm1, %xmm1
718 ; VLNODQ-NEXT: vptestmd %xmm1, %xmm1, %k1
719 ; VLNODQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
720 ; VLNODQ-NEXT: vzeroupper
723 ; DQNOVL-LABEL: f64to4f32_mask:
725 ; DQNOVL-NEXT: vpslld $31, %xmm1, %xmm1
726 ; DQNOVL-NEXT: vpmovd2m %zmm1, %k1
727 ; DQNOVL-NEXT: vcvtpd2ps %ymm0, %xmm0
728 ; DQNOVL-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
729 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
730 ; DQNOVL-NEXT: vzeroupper
732 %a = fptrunc <4 x double> %b to <4 x float>
733 %c = select <4 x i1>%mask, <4 x float>%a, <4 x float> zeroinitializer
737 define <4 x float> @f64tof32_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
738 ; ALL-LABEL: f64tof32_inreg:
740 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm1, %xmm0
742 %ext = extractelement <2 x double> %a0, i32 0
743 %cvt = fptrunc double %ext to float
744 %res = insertelement <4 x float> %a1, float %cvt, i32 0
748 define <8 x double> @f32to8f64(<8 x float> %b) nounwind {
749 ; ALL-LABEL: f32to8f64:
751 ; ALL-NEXT: vcvtps2pd %ymm0, %zmm0
753 %a = fpext <8 x float> %b to <8 x double>
757 define <4 x double> @f32to4f64_mask(<4 x float> %b, <4 x double> %b1, <4 x double> %a1) {
758 ; NOVL-LABEL: f32to4f64_mask:
760 ; NOVL-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
761 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
762 ; NOVL-NEXT: vcvtps2pd %xmm0, %ymm0
763 ; NOVL-NEXT: vcmpltpd %zmm2, %zmm1, %k1
764 ; NOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
765 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
768 ; VL-LABEL: f32to4f64_mask:
770 ; VL-NEXT: vcmpltpd %ymm2, %ymm1, %k1
771 ; VL-NEXT: vcvtps2pd %xmm0, %ymm0 {%k1} {z}
773 %a = fpext <4 x float> %b to <4 x double>
774 %mask = fcmp ogt <4 x double> %a1, %b1
775 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
779 define <2 x double> @f32tof64_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
780 ; ALL-LABEL: f32tof64_inreg:
782 ; ALL-NEXT: vcvtss2sd %xmm1, %xmm0, %xmm0
784 %ext = extractelement <4 x float> %a1, i32 0
785 %cvt = fpext float %ext to double
786 %res = insertelement <2 x double> %a0, double %cvt, i32 0
787 ret <2 x double> %res
790 define double @sltof64_load(i64* nocapture %e) {
791 ; ALL-LABEL: sltof64_load:
792 ; ALL: # %bb.0: # %entry
793 ; ALL-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
796 %tmp1 = load i64, i64* %e, align 8
797 %conv = sitofp i64 %tmp1 to double
801 define double @sitof64_load(i32* %e) {
802 ; ALL-LABEL: sitof64_load:
803 ; ALL: # %bb.0: # %entry
804 ; ALL-NEXT: vcvtsi2sdl (%rdi), %xmm0, %xmm0
807 %tmp1 = load i32, i32* %e, align 4
808 %conv = sitofp i32 %tmp1 to double
812 define float @sitof32_load(i32* %e) {
813 ; ALL-LABEL: sitof32_load:
814 ; ALL: # %bb.0: # %entry
815 ; ALL-NEXT: vcvtsi2ssl (%rdi), %xmm0, %xmm0
818 %tmp1 = load i32, i32* %e, align 4
819 %conv = sitofp i32 %tmp1 to float
823 define float @sltof32_load(i64* %e) {
824 ; ALL-LABEL: sltof32_load:
825 ; ALL: # %bb.0: # %entry
826 ; ALL-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
829 %tmp1 = load i64, i64* %e, align 8
830 %conv = sitofp i64 %tmp1 to float
834 define void @f32tof64_loadstore() {
835 ; ALL-LABEL: f32tof64_loadstore:
836 ; ALL: # %bb.0: # %entry
837 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
838 ; ALL-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
839 ; ALL-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp)
842 %f = alloca float, align 4
843 %d = alloca double, align 8
844 %tmp = load float, float* %f, align 4
845 %conv = fpext float %tmp to double
846 store double %conv, double* %d, align 8
850 define void @f64tof32_loadstore() nounwind uwtable {
851 ; ALL-LABEL: f64tof32_loadstore:
852 ; ALL: # %bb.0: # %entry
853 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
854 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
855 ; ALL-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp)
858 %f = alloca float, align 4
859 %d = alloca double, align 8
860 %tmp = load double, double* %d, align 8
861 %conv = fptrunc double %tmp to float
862 store float %conv, float* %f, align 4
866 define double @long_to_double(i64 %x) {
867 ; ALL-LABEL: long_to_double:
869 ; ALL-NEXT: vmovq %rdi, %xmm0
871 %res = bitcast i64 %x to double
875 define i64 @double_to_long(double %x) {
876 ; ALL-LABEL: double_to_long:
878 ; ALL-NEXT: vmovq %xmm0, %rax
880 %res = bitcast double %x to i64
884 define float @int_to_float(i32 %x) {
885 ; ALL-LABEL: int_to_float:
887 ; ALL-NEXT: vmovd %edi, %xmm0
889 %res = bitcast i32 %x to float
893 define i32 @float_to_int(float %x) {
894 ; ALL-LABEL: float_to_int:
896 ; ALL-NEXT: vmovd %xmm0, %eax
898 %res = bitcast float %x to i32
902 define <16 x double> @uito16f64(<16 x i32> %a) nounwind {
903 ; ALL-LABEL: uito16f64:
905 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm2
906 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
907 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm1
908 ; ALL-NEXT: vmovaps %zmm2, %zmm0
910 %b = uitofp <16 x i32> %a to <16 x double>
914 define <8 x float> @slto8f32(<8 x i64> %a) {
915 ; NODQ-LABEL: slto8f32:
917 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
918 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
919 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm2
920 ; NODQ-NEXT: vmovq %xmm1, %rax
921 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm1
922 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
923 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
924 ; NODQ-NEXT: vmovq %xmm2, %rax
925 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm3
926 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
927 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
928 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm2
929 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
930 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
931 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm2
932 ; NODQ-NEXT: vmovq %xmm0, %rax
933 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm3
934 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
935 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
936 ; NODQ-NEXT: vmovq %xmm0, %rax
937 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm3
938 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
939 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
940 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm0
941 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
942 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
945 ; VLDQ-LABEL: slto8f32:
947 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
950 ; DQNOVL-LABEL: slto8f32:
952 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
954 %b = sitofp <8 x i64> %a to <8 x float>
958 define <16 x float> @slto16f32(<16 x i64> %a) {
959 ; NODQ-LABEL: slto16f32:
961 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
962 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
963 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm3
964 ; NODQ-NEXT: vmovq %xmm2, %rax
965 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm2
966 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
967 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
968 ; NODQ-NEXT: vmovq %xmm3, %rax
969 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm4
970 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
971 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
972 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
973 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
974 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
975 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
976 ; NODQ-NEXT: vmovq %xmm1, %rax
977 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
978 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
979 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
980 ; NODQ-NEXT: vmovq %xmm1, %rax
981 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
982 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
983 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
984 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm1
985 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
986 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
987 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
988 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
989 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
990 ; NODQ-NEXT: vmovq %xmm2, %rax
991 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm2
992 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
993 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm3
994 ; NODQ-NEXT: vmovq %xmm3, %rax
995 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
996 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
997 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
998 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
999 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1000 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1001 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
1002 ; NODQ-NEXT: vmovq %xmm0, %rax
1003 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
1004 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1005 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1006 ; NODQ-NEXT: vmovq %xmm0, %rax
1007 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
1008 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1009 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1010 ; NODQ-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm0
1011 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1012 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1013 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1016 ; VLDQ-LABEL: slto16f32:
1018 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
1019 ; VLDQ-NEXT: vcvtqq2ps %zmm1, %ymm1
1020 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1023 ; DQNOVL-LABEL: slto16f32:
1025 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
1026 ; DQNOVL-NEXT: vcvtqq2ps %zmm1, %ymm1
1027 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1029 %b = sitofp <16 x i64> %a to <16 x float>
1033 define <8 x double> @slto8f64(<8 x i64> %a) {
1034 ; NODQ-LABEL: slto8f64:
1036 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm1
1037 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1038 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm2, %xmm2
1039 ; NODQ-NEXT: vmovq %xmm1, %rax
1040 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm1
1041 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
1042 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1043 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1044 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm3
1045 ; NODQ-NEXT: vmovq %xmm2, %rax
1046 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
1047 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1048 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
1049 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm2
1050 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1051 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm3
1052 ; NODQ-NEXT: vmovq %xmm2, %rax
1053 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
1054 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1055 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1056 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm3
1057 ; NODQ-NEXT: vmovq %xmm0, %rax
1058 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm0
1059 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm3[0]
1060 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1061 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1064 ; VLDQ-LABEL: slto8f64:
1066 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1069 ; DQNOVL-LABEL: slto8f64:
1071 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1073 %b = sitofp <8 x i64> %a to <8 x double>
1077 define <16 x double> @slto16f64(<16 x i64> %a) {
1078 ; NODQ-LABEL: slto16f64:
1080 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1081 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1082 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm3
1083 ; NODQ-NEXT: vmovq %xmm2, %rax
1084 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
1085 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1086 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm3
1087 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1088 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm4
1089 ; NODQ-NEXT: vmovq %xmm3, %rax
1090 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
1091 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1092 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1093 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm3
1094 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1095 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
1096 ; NODQ-NEXT: vmovq %xmm3, %rax
1097 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
1098 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1099 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1100 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
1101 ; NODQ-NEXT: vmovq %xmm0, %rax
1102 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm0
1103 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm4[0]
1104 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0
1105 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
1106 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm2
1107 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1108 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
1109 ; NODQ-NEXT: vmovq %xmm2, %rax
1110 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm2
1111 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1112 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm3
1113 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1114 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
1115 ; NODQ-NEXT: vmovq %xmm3, %rax
1116 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
1117 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1118 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1119 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm3
1120 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1121 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
1122 ; NODQ-NEXT: vmovq %xmm3, %rax
1123 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
1124 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1125 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1126 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
1127 ; NODQ-NEXT: vmovq %xmm1, %rax
1128 ; NODQ-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm1
1129 ; NODQ-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm4[0]
1130 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1
1131 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm1, %zmm1
1134 ; VLDQ-LABEL: slto16f64:
1136 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1137 ; VLDQ-NEXT: vcvtqq2pd %zmm1, %zmm1
1140 ; DQNOVL-LABEL: slto16f64:
1142 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1143 ; DQNOVL-NEXT: vcvtqq2pd %zmm1, %zmm1
1145 %b = sitofp <16 x i64> %a to <16 x double>
1146 ret <16 x double> %b
1149 define <8 x float> @ulto8f32(<8 x i64> %a) {
1150 ; NODQ-LABEL: ulto8f32:
1152 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
1153 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1154 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm2, %xmm2
1155 ; NODQ-NEXT: vmovq %xmm1, %rax
1156 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm1
1157 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
1158 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1159 ; NODQ-NEXT: vmovq %xmm2, %rax
1160 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm3
1161 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
1162 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1163 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm2
1164 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
1165 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1166 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm2
1167 ; NODQ-NEXT: vmovq %xmm0, %rax
1168 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm3
1169 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
1170 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1171 ; NODQ-NEXT: vmovq %xmm0, %rax
1172 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm3
1173 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
1174 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1175 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm0
1176 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
1177 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1180 ; VLDQ-LABEL: ulto8f32:
1182 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1185 ; DQNOVL-LABEL: ulto8f32:
1187 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1189 %b = uitofp <8 x i64> %a to <8 x float>
1193 define <16 x float> @ulto16f32(<16 x i64> %a) {
1194 ; NODQ-LABEL: ulto16f32:
1196 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1197 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1198 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm3
1199 ; NODQ-NEXT: vmovq %xmm2, %rax
1200 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm2
1201 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1202 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1203 ; NODQ-NEXT: vmovq %xmm3, %rax
1204 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm4
1205 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1206 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1207 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
1208 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1209 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1210 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
1211 ; NODQ-NEXT: vmovq %xmm1, %rax
1212 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
1213 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1214 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1215 ; NODQ-NEXT: vmovq %xmm1, %rax
1216 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
1217 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1218 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1219 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm1
1220 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1221 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1222 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1223 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1224 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
1225 ; NODQ-NEXT: vmovq %xmm2, %rax
1226 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm2
1227 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1228 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm3
1229 ; NODQ-NEXT: vmovq %xmm3, %rax
1230 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
1231 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1232 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1233 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
1234 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1235 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1236 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
1237 ; NODQ-NEXT: vmovq %xmm0, %rax
1238 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
1239 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1240 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1241 ; NODQ-NEXT: vmovq %xmm0, %rax
1242 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
1243 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1244 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1245 ; NODQ-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm0
1246 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1247 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1248 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1251 ; VLDQ-LABEL: ulto16f32:
1253 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1254 ; VLDQ-NEXT: vcvtuqq2ps %zmm1, %ymm1
1255 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1258 ; DQNOVL-LABEL: ulto16f32:
1260 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1261 ; DQNOVL-NEXT: vcvtuqq2ps %zmm1, %ymm1
1262 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1264 %b = uitofp <16 x i64> %a to <16 x float>
1268 define <8 x double> @uito8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
1269 ; KNL-LABEL: uito8f64_mask:
1271 ; KNL-NEXT: kmovw %edi, %k1
1272 ; KNL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1275 ; VLBW-LABEL: uito8f64_mask:
1277 ; VLBW-NEXT: kmovd %edi, %k1
1278 ; VLBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1281 ; VLNOBW-LABEL: uito8f64_mask:
1283 ; VLNOBW-NEXT: kmovw %edi, %k1
1284 ; VLNOBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1287 ; DQNOVL-LABEL: uito8f64_mask:
1289 ; DQNOVL-NEXT: kmovw %edi, %k1
1290 ; DQNOVL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1293 ; AVX512BW-LABEL: uito8f64_mask:
1294 ; AVX512BW: # %bb.0:
1295 ; AVX512BW-NEXT: kmovd %edi, %k1
1296 ; AVX512BW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1297 ; AVX512BW-NEXT: retq
1298 %1 = bitcast i8 %c to <8 x i1>
1299 %2 = uitofp <8 x i32> %b to <8 x double>
1300 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
1303 define <8 x double> @uito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
1304 ; KNL-LABEL: uito8f64_maskz:
1306 ; KNL-NEXT: kmovw %edi, %k1
1307 ; KNL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1310 ; VLBW-LABEL: uito8f64_maskz:
1312 ; VLBW-NEXT: kmovd %edi, %k1
1313 ; VLBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1316 ; VLNOBW-LABEL: uito8f64_maskz:
1318 ; VLNOBW-NEXT: kmovw %edi, %k1
1319 ; VLNOBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1322 ; DQNOVL-LABEL: uito8f64_maskz:
1324 ; DQNOVL-NEXT: kmovw %edi, %k1
1325 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1328 ; AVX512BW-LABEL: uito8f64_maskz:
1329 ; AVX512BW: # %bb.0:
1330 ; AVX512BW-NEXT: kmovd %edi, %k1
1331 ; AVX512BW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1332 ; AVX512BW-NEXT: retq
1333 %1 = bitcast i8 %b to <8 x i1>
1334 %2 = uitofp <8 x i32> %a to <8 x double>
1335 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
1339 define <4 x double> @uito4f64(<4 x i32> %a) nounwind {
1340 ; NOVL-LABEL: uito4f64:
1342 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1343 ; NOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
1344 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1347 ; VL-LABEL: uito4f64:
1349 ; VL-NEXT: vcvtudq2pd %xmm0, %ymm0
1351 %b = uitofp <4 x i32> %a to <4 x double>
1355 define <16 x float> @uito16f32(<16 x i32> %a) nounwind {
1356 ; ALL-LABEL: uito16f32:
1358 ; ALL-NEXT: vcvtudq2ps %zmm0, %zmm0
1360 %b = uitofp <16 x i32> %a to <16 x float>
1364 define <8 x double> @uito8f64(<8 x i32> %a) {
1365 ; ALL-LABEL: uito8f64:
1367 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm0
1369 %b = uitofp <8 x i32> %a to <8 x double>
1373 define <8 x float> @uito8f32(<8 x i32> %a) nounwind {
1374 ; NOVL-LABEL: uito8f32:
1376 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1377 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1378 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1381 ; VL-LABEL: uito8f32:
1383 ; VL-NEXT: vcvtudq2ps %ymm0, %ymm0
1385 %b = uitofp <8 x i32> %a to <8 x float>
1389 define <4 x float> @uito4f32(<4 x i32> %a) nounwind {
1390 ; NOVL-LABEL: uito4f32:
1392 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1393 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1394 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1395 ; NOVL-NEXT: vzeroupper
1398 ; VL-LABEL: uito4f32:
1400 ; VL-NEXT: vcvtudq2ps %xmm0, %xmm0
1402 %b = uitofp <4 x i32> %a to <4 x float>
1406 define i32 @fptosi(float %a) nounwind {
1407 ; ALL-LABEL: fptosi:
1409 ; ALL-NEXT: vcvttss2si %xmm0, %eax
1411 %b = fptosi float %a to i32
1415 define i32 @fptoui(float %a) nounwind {
1416 ; ALL-LABEL: fptoui:
1418 ; ALL-NEXT: vcvttss2usi %xmm0, %eax
1420 %b = fptoui float %a to i32
1424 define float @uitof32(i32 %a) nounwind {
1425 ; ALL-LABEL: uitof32:
1427 ; ALL-NEXT: vcvtusi2ssl %edi, %xmm0, %xmm0
1429 %b = uitofp i32 %a to float
1433 define double @uitof64(i32 %a) nounwind {
1434 ; ALL-LABEL: uitof64:
1436 ; ALL-NEXT: vcvtusi2sdl %edi, %xmm0, %xmm0
1438 %b = uitofp i32 %a to double
1442 define <16 x float> @sbto16f32(<16 x i32> %a) {
1443 ; NODQ-LABEL: sbto16f32:
1445 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1446 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1447 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1448 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1451 ; VLDQ-LABEL: sbto16f32:
1453 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1454 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1455 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1458 ; DQNOVL-LABEL: sbto16f32:
1460 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1461 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1462 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1464 %mask = icmp slt <16 x i32> %a, zeroinitializer
1465 %1 = sitofp <16 x i1> %mask to <16 x float>
1469 define <16 x float> @scto16f32(<16 x i8> %a) {
1470 ; ALL-LABEL: scto16f32:
1472 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm0
1473 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1475 %1 = sitofp <16 x i8> %a to <16 x float>
1479 define <16 x float> @ssto16f32(<16 x i16> %a) {
1480 ; ALL-LABEL: ssto16f32:
1482 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1483 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1485 %1 = sitofp <16 x i16> %a to <16 x float>
1489 define <8 x double> @ssto16f64(<8 x i16> %a) {
1490 ; ALL-LABEL: ssto16f64:
1492 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1493 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1495 %1 = sitofp <8 x i16> %a to <8 x double>
1499 define <8 x double> @scto8f64(<8 x i8> %a) {
1500 ; ALL-LABEL: scto8f64:
1502 ; ALL-NEXT: vpmovsxbd %xmm0, %ymm0
1503 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1505 %1 = sitofp <8 x i8> %a to <8 x double>
1509 define <16 x double> @scto16f64(<16 x i8> %a) {
1510 ; ALL-LABEL: scto16f64:
1512 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm1
1513 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1514 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1515 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1517 %b = sitofp <16 x i8> %a to <16 x double>
1518 ret <16 x double> %b
1521 define <16 x double> @sbto16f64(<16 x double> %a) {
1522 ; NODQ-LABEL: sbto16f64:
1524 ; NODQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1525 ; NODQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1526 ; NODQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1527 ; NODQ-NEXT: kunpckbw %k0, %k1, %k1
1528 ; NODQ-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1 {%k1} {z}
1529 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1530 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1531 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1534 ; VLDQ-LABEL: sbto16f64:
1536 ; VLDQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1537 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1538 ; VLDQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1539 ; VLDQ-NEXT: kunpckbw %k0, %k1, %k0
1540 ; VLDQ-NEXT: vpmovm2d %k0, %zmm1
1541 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1542 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1543 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1546 ; DQNOVL-LABEL: sbto16f64:
1548 ; DQNOVL-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1549 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1550 ; DQNOVL-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1551 ; DQNOVL-NEXT: kunpckbw %k0, %k1, %k0
1552 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm1
1553 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1554 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1555 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1557 %cmpres = fcmp ogt <16 x double> %a, zeroinitializer
1558 %1 = sitofp <16 x i1> %cmpres to <16 x double>
1559 ret <16 x double> %1
1562 define <8 x double> @sbto8f64(<8 x double> %a) {
1563 ; NOVLDQ-LABEL: sbto8f64:
1565 ; NOVLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1566 ; NOVLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1567 ; NOVLDQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1568 ; NOVLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1571 ; VLDQ-LABEL: sbto8f64:
1573 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1574 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1575 ; VLDQ-NEXT: vpmovm2d %k0, %ymm0
1576 ; VLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1579 ; VLNODQ-LABEL: sbto8f64:
1581 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1582 ; VLNODQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1583 ; VLNODQ-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
1584 ; VLNODQ-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
1585 ; VLNODQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1588 ; DQNOVL-LABEL: sbto8f64:
1590 ; DQNOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1591 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1592 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1593 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0
1595 %cmpres = fcmp ogt <8 x double> %a, zeroinitializer
1596 %1 = sitofp <8 x i1> %cmpres to <8 x double>
1600 define <8 x float> @sbto8f32(<8 x float> %a) {
1601 ; ALL-LABEL: sbto8f32:
1603 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1604 ; ALL-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
1605 ; ALL-NEXT: vcvtdq2ps %ymm0, %ymm0
1607 %cmpres = fcmp ogt <8 x float> %a, zeroinitializer
1608 %1 = sitofp <8 x i1> %cmpres to <8 x float>
1612 define <4 x float> @sbto4f32(<4 x float> %a) {
1613 ; ALL-LABEL: sbto4f32:
1615 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1616 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1617 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1619 %cmpres = fcmp ogt <4 x float> %a, zeroinitializer
1620 %1 = sitofp <4 x i1> %cmpres to <4 x float>
1624 define <4 x double> @sbto4f64(<4 x double> %a) {
1625 ; NOVL-LABEL: sbto4f64:
1627 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1628 ; NOVL-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0
1629 ; NOVL-NEXT: vpmovqd %zmm0, %ymm0
1630 ; NOVL-NEXT: vcvtdq2pd %xmm0, %ymm0
1633 ; VLDQ-LABEL: sbto4f64:
1635 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1636 ; VLDQ-NEXT: vcmpltpd %ymm0, %ymm1, %k0
1637 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1638 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1641 ; VLNODQ-LABEL: sbto4f64:
1643 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1644 ; VLNODQ-NEXT: vcmpltpd %ymm0, %ymm1, %k1
1645 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1646 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1647 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1649 %cmpres = fcmp ogt <4 x double> %a, zeroinitializer
1650 %1 = sitofp <4 x i1> %cmpres to <4 x double>
1654 define <2 x float> @sbto2f32(<2 x float> %a) {
1655 ; ALL-LABEL: sbto2f32:
1657 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1658 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1659 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1661 %cmpres = fcmp ogt <2 x float> %a, zeroinitializer
1662 %1 = sitofp <2 x i1> %cmpres to <2 x float>
1666 define <2 x double> @sbto2f64(<2 x double> %a) {
1667 ; NOVL-LABEL: sbto2f64:
1669 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1670 ; NOVL-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
1671 ; NOVL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,2,3]
1672 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
1675 ; VLDQ-LABEL: sbto2f64:
1677 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1678 ; VLDQ-NEXT: vcmpltpd %xmm0, %xmm1, %k0
1679 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1680 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1683 ; VLNODQ-LABEL: sbto2f64:
1685 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1686 ; VLNODQ-NEXT: vcmpltpd %xmm0, %xmm1, %k1
1687 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1688 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1689 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1691 %cmpres = fcmp ogt <2 x double> %a, zeroinitializer
1692 %1 = sitofp <2 x i1> %cmpres to <2 x double>
1696 define <16 x float> @ucto16f32(<16 x i8> %a) {
1697 ; ALL-LABEL: ucto16f32:
1699 ; 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
1700 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1702 %b = uitofp <16 x i8> %a to <16 x float>
1706 define <8 x double> @ucto8f64(<8 x i8> %a) {
1707 ; ALL-LABEL: ucto8f64:
1709 ; 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
1710 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1712 %b = uitofp <8 x i8> %a to <8 x double>
1716 define <16 x float> @swto16f32(<16 x i16> %a) {
1717 ; ALL-LABEL: swto16f32:
1719 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1720 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1722 %b = sitofp <16 x i16> %a to <16 x float>
1726 define <8 x double> @swto8f64(<8 x i16> %a) {
1727 ; ALL-LABEL: swto8f64:
1729 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1730 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1732 %b = sitofp <8 x i16> %a to <8 x double>
1736 define <16 x double> @swto16f64(<16 x i16> %a) {
1737 ; ALL-LABEL: swto16f64:
1739 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm1
1740 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1741 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1742 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1744 %b = sitofp <16 x i16> %a to <16 x double>
1745 ret <16 x double> %b
1748 define <16 x double> @ucto16f64(<16 x i8> %a) {
1749 ; ALL-LABEL: ucto16f64:
1751 ; 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
1752 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1753 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1754 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1756 %b = uitofp <16 x i8> %a to <16 x double>
1757 ret <16 x double> %b
1760 define <16 x float> @uwto16f32(<16 x i16> %a) {
1761 ; ALL-LABEL: uwto16f32:
1763 ; 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
1764 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1766 %b = uitofp <16 x i16> %a to <16 x float>
1770 define <8 x double> @uwto8f64(<8 x i16> %a) {
1771 ; ALL-LABEL: uwto8f64:
1773 ; 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
1774 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1776 %b = uitofp <8 x i16> %a to <8 x double>
1780 define <16 x double> @uwto16f64(<16 x i16> %a) {
1781 ; ALL-LABEL: uwto16f64:
1783 ; 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
1784 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1785 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1786 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1788 %b = uitofp <16 x i16> %a to <16 x double>
1789 ret <16 x double> %b
1792 define <16 x float> @sito16f32(<16 x i32> %a) {
1793 ; ALL-LABEL: sito16f32:
1795 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1797 %b = sitofp <16 x i32> %a to <16 x float>
1801 define <16 x double> @sito16f64(<16 x i32> %a) {
1802 ; ALL-LABEL: sito16f64:
1804 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm2
1805 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
1806 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm1
1807 ; ALL-NEXT: vmovaps %zmm2, %zmm0
1809 %b = sitofp <16 x i32> %a to <16 x double>
1810 ret <16 x double> %b
1813 define <16 x float> @usto16f32(<16 x i16> %a) {
1814 ; ALL-LABEL: usto16f32:
1816 ; 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
1817 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1819 %b = uitofp <16 x i16> %a to <16 x float>
1823 define <16 x float> @ubto16f32(<16 x i32> %a) {
1824 ; NODQ-LABEL: ubto16f32:
1826 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1827 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1828 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1829 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm0
1830 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1833 ; VLDQ-LABEL: ubto16f32:
1835 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1836 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1837 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm0
1838 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1841 ; DQNOVL-LABEL: ubto16f32:
1843 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1844 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1845 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm0
1846 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1848 %mask = icmp slt <16 x i32> %a, zeroinitializer
1849 %1 = uitofp <16 x i1> %mask to <16 x float>
1853 define <16 x double> @ubto16f64(<16 x i32> %a) {
1854 ; NODQ-LABEL: ubto16f64:
1856 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1857 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1858 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1859 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm1
1860 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1861 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1862 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1865 ; VLDQ-LABEL: ubto16f64:
1867 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1868 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1869 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm1
1870 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1871 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1872 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1875 ; DQNOVL-LABEL: ubto16f64:
1877 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1878 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1879 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm1
1880 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1881 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1882 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1884 %mask = icmp slt <16 x i32> %a, zeroinitializer
1885 %1 = uitofp <16 x i1> %mask to <16 x double>
1886 ret <16 x double> %1
1889 define <8 x float> @ubto8f32(<8 x i32> %a) {
1890 ; NOVL-LABEL: ubto8f32:
1892 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1893 ; NOVL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1894 ; NOVL-NEXT: vpbroadcastd {{.*#+}} ymm1 = [1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216]
1895 ; NOVL-NEXT: vpand %ymm1, %ymm0, %ymm0
1898 ; VL-LABEL: ubto8f32:
1900 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1901 ; VL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1902 ; VL-NEXT: vpandd {{.*}}(%rip){1to8}, %ymm0, %ymm0
1904 %mask = icmp slt <8 x i32> %a, zeroinitializer
1905 %1 = uitofp <8 x i1> %mask to <8 x float>
1909 define <8 x double> @ubto8f64(<8 x i32> %a) {
1910 ; ALL-LABEL: ubto8f64:
1912 ; ALL-NEXT: vpsrld $31, %ymm0, %ymm0
1913 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1915 %mask = icmp slt <8 x i32> %a, zeroinitializer
1916 %1 = uitofp <8 x i1> %mask to <8 x double>
1920 define <4 x float> @ubto4f32(<4 x i32> %a) {
1921 ; NOVL-LABEL: ubto4f32:
1923 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1924 ; NOVL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1925 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
1926 ; NOVL-NEXT: vpand %xmm1, %xmm0, %xmm0
1929 ; VL-LABEL: ubto4f32:
1931 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1932 ; VL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1933 ; VL-NEXT: vpandd {{.*}}(%rip){1to4}, %xmm0, %xmm0
1935 %mask = icmp slt <4 x i32> %a, zeroinitializer
1936 %1 = uitofp <4 x i1> %mask to <4 x float>
1940 define <4 x double> @ubto4f64(<4 x i32> %a) {
1941 ; ALL-LABEL: ubto4f64:
1943 ; ALL-NEXT: vpsrld $31, %xmm0, %xmm0
1944 ; ALL-NEXT: vcvtdq2pd %xmm0, %ymm0
1946 %mask = icmp slt <4 x i32> %a, zeroinitializer
1947 %1 = uitofp <4 x i1> %mask to <4 x double>
1951 define <2 x float> @ubto2f32(<2 x i32> %a) {
1952 ; NOVL-LABEL: ubto2f32:
1954 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1955 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1956 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
1957 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
1960 ; VL-LABEL: ubto2f32:
1962 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1963 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1964 ; VL-NEXT: vpandnd {{.*}}(%rip){1to4}, %xmm0, %xmm0
1966 %mask = icmp ne <2 x i32> %a, zeroinitializer
1967 %1 = uitofp <2 x i1> %mask to <2 x float>
1971 define <2 x double> @ubto2f64(<2 x i32> %a) {
1972 ; NOVL-LABEL: ubto2f64:
1974 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1975 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1976 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1,1,1,1]
1977 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
1978 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
1981 ; VL-LABEL: ubto2f64:
1983 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1984 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1985 ; VL-NEXT: vpandnd {{.*}}(%rip){1to4}, %xmm0, %xmm0
1986 ; VL-NEXT: vcvtdq2pd %xmm0, %xmm0
1988 %mask = icmp ne <2 x i32> %a, zeroinitializer
1989 %1 = uitofp <2 x i1> %mask to <2 x double>
1993 define <2 x i64> @test_2f64toub(<2 x double> %a, <2 x i64> %passthru) {
1994 ; NOVLDQ-LABEL: test_2f64toub:
1996 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1997 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1998 ; NOVLDQ-NEXT: vcvttpd2udq %zmm0, %ymm0
1999 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2000 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2001 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2002 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2003 ; NOVLDQ-NEXT: vzeroupper
2006 ; VLDQ-LABEL: test_2f64toub:
2008 ; VLDQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2009 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2010 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2011 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2014 ; VLNODQ-LABEL: test_2f64toub:
2016 ; VLNODQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2017 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2018 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2019 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2022 ; DQNOVL-LABEL: test_2f64toub:
2024 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2025 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2026 ; DQNOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
2027 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2028 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2029 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2030 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2031 ; DQNOVL-NEXT: vzeroupper
2033 %mask = fptoui <2 x double> %a to <2 x i1>
2034 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2035 ret <2 x i64> %select
2038 define <4 x i64> @test_4f64toub(<4 x double> %a, <4 x i64> %passthru) {
2039 ; NOVLDQ-LABEL: test_4f64toub:
2041 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2042 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2043 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2044 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2045 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2046 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2049 ; VLDQ-LABEL: test_4f64toub:
2051 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2052 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2053 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2054 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2057 ; VLNODQ-LABEL: test_4f64toub:
2059 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2060 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2061 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2062 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2065 ; DQNOVL-LABEL: test_4f64toub:
2067 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2068 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2069 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2070 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2071 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2072 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2074 %mask = fptoui <4 x double> %a to <4 x i1>
2075 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2076 ret <4 x i64> %select
2079 define <8 x i64> @test_8f64toub(<8 x double> %a, <8 x i64> %passthru) {
2080 ; NOVLDQ-LABEL: test_8f64toub:
2082 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2083 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2084 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2085 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2088 ; VLDQ-LABEL: test_8f64toub:
2090 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2091 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2092 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2093 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2096 ; VLNODQ-LABEL: test_8f64toub:
2098 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2099 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2100 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2101 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2104 ; DQNOVL-LABEL: test_8f64toub:
2106 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2107 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2108 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2109 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2111 %mask = fptoui <8 x double> %a to <8 x i1>
2112 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2113 ret <8 x i64> %select
2116 define <2 x i64> @test_2f32toub(<2 x float> %a, <2 x i64> %passthru) {
2117 ; NOVLDQ-LABEL: test_2f32toub:
2119 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2120 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2121 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2122 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2123 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2124 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2125 ; NOVLDQ-NEXT: vzeroupper
2128 ; VLDQ-LABEL: test_2f32toub:
2130 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2131 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2132 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2133 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2136 ; VLNODQ-LABEL: test_2f32toub:
2138 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2139 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2140 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2141 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2144 ; DQNOVL-LABEL: test_2f32toub:
2146 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2147 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2148 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2149 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2150 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2151 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2152 ; DQNOVL-NEXT: vzeroupper
2154 %mask = fptoui <2 x float> %a to <2 x i1>
2155 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2156 ret <2 x i64> %select
2159 define <4 x i64> @test_4f32toub(<4 x float> %a, <4 x i64> %passthru) {
2160 ; NOVLDQ-LABEL: test_4f32toub:
2162 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2163 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2164 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2165 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2166 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2167 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2170 ; VLDQ-LABEL: test_4f32toub:
2172 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2173 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2174 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2175 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2178 ; VLNODQ-LABEL: test_4f32toub:
2180 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2181 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2182 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2183 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2186 ; DQNOVL-LABEL: test_4f32toub:
2188 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2189 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2190 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2191 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2192 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2193 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2195 %mask = fptoui <4 x float> %a to <4 x i1>
2196 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2197 ret <4 x i64> %select
2200 define <8 x i64> @test_8f32toub(<8 x float> %a, <8 x i64> %passthru) {
2201 ; NOVLDQ-LABEL: test_8f32toub:
2203 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2204 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2205 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2206 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2209 ; VLDQ-LABEL: test_8f32toub:
2211 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2212 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2213 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2214 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2217 ; VLNODQ-LABEL: test_8f32toub:
2219 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2220 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2221 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2222 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2225 ; DQNOVL-LABEL: test_8f32toub:
2227 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2228 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2229 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2230 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2232 %mask = fptoui <8 x float> %a to <8 x i1>
2233 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2234 ret <8 x i64> %select
2237 define <16 x i32> @test_16f32toub(<16 x float> %a, <16 x i32> %passthru) {
2238 ; NODQ-LABEL: test_16f32toub:
2240 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2241 ; NODQ-NEXT: vpslld $31, %zmm0, %zmm0
2242 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2243 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2246 ; VLDQ-LABEL: test_16f32toub:
2248 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2249 ; VLDQ-NEXT: vpslld $31, %zmm0, %zmm0
2250 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2251 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2254 ; DQNOVL-LABEL: test_16f32toub:
2256 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2257 ; DQNOVL-NEXT: vpslld $31, %zmm0, %zmm0
2258 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2259 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2261 %mask = fptoui <16 x float> %a to <16 x i1>
2262 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2263 ret <16 x i32> %select
2266 define <2 x i64> @test_2f64tosb(<2 x double> %a, <2 x i64> %passthru) {
2267 ; NOVLDQ-LABEL: test_2f64tosb:
2269 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2270 ; NOVLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2271 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2272 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2273 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2274 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2275 ; NOVLDQ-NEXT: vzeroupper
2278 ; VLDQ-LABEL: test_2f64tosb:
2280 ; VLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2281 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2282 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2283 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2286 ; VLNODQ-LABEL: test_2f64tosb:
2288 ; VLNODQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2289 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2290 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2291 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2294 ; DQNOVL-LABEL: test_2f64tosb:
2296 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2297 ; DQNOVL-NEXT: vcvttpd2dq %xmm0, %xmm0
2298 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2299 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2300 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2301 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2302 ; DQNOVL-NEXT: vzeroupper
2304 %mask = fptosi <2 x double> %a to <2 x i1>
2305 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2306 ret <2 x i64> %select
2309 define <4 x i64> @test_4f64tosb(<4 x double> %a, <4 x i64> %passthru) {
2310 ; NOVLDQ-LABEL: test_4f64tosb:
2312 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2313 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2314 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2315 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2316 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2319 ; VLDQ-LABEL: test_4f64tosb:
2321 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2322 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2323 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2326 ; VLNODQ-LABEL: test_4f64tosb:
2328 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2329 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2330 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2333 ; DQNOVL-LABEL: test_4f64tosb:
2335 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2336 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2337 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2338 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2339 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2341 %mask = fptosi <4 x double> %a to <4 x i1>
2342 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2343 ret <4 x i64> %select
2346 define <8 x i64> @test_8f64tosb(<8 x double> %a, <8 x i64> %passthru) {
2347 ; NOVLDQ-LABEL: test_8f64tosb:
2349 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2350 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2351 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2354 ; VLDQ-LABEL: test_8f64tosb:
2356 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2357 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2358 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2361 ; VLNODQ-LABEL: test_8f64tosb:
2363 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2364 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2365 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2368 ; DQNOVL-LABEL: test_8f64tosb:
2370 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2371 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2372 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2374 %mask = fptosi <8 x double> %a to <8 x i1>
2375 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2376 ret <8 x i64> %select
2379 define <2 x i64> @test_2f32tosb(<2 x float> %a, <2 x i64> %passthru) {
2380 ; NOVLDQ-LABEL: test_2f32tosb:
2382 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2383 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2384 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2385 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2386 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2387 ; NOVLDQ-NEXT: vzeroupper
2390 ; VLDQ-LABEL: test_2f32tosb:
2392 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2393 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2394 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2397 ; VLNODQ-LABEL: test_2f32tosb:
2399 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2400 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2401 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2404 ; DQNOVL-LABEL: test_2f32tosb:
2406 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2407 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2408 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2409 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2410 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2411 ; DQNOVL-NEXT: vzeroupper
2413 %mask = fptosi <2 x float> %a to <2 x i1>
2414 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2415 ret <2 x i64> %select
2418 define <4 x i64> @test_4f32tosb(<4 x float> %a, <4 x i64> %passthru) {
2419 ; NOVLDQ-LABEL: test_4f32tosb:
2421 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2422 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2423 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2424 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2425 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2428 ; VLDQ-LABEL: test_4f32tosb:
2430 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2431 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2432 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2435 ; VLNODQ-LABEL: test_4f32tosb:
2437 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2438 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2439 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2442 ; DQNOVL-LABEL: test_4f32tosb:
2444 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2445 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2446 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2447 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2448 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2450 %mask = fptosi <4 x float> %a to <4 x i1>
2451 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2452 ret <4 x i64> %select
2455 define <8 x i64> @test_8f32tosb(<8 x float> %a, <8 x i64> %passthru) {
2456 ; NOVLDQ-LABEL: test_8f32tosb:
2458 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2459 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2460 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2463 ; VLDQ-LABEL: test_8f32tosb:
2465 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2466 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2467 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2470 ; VLNODQ-LABEL: test_8f32tosb:
2472 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2473 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2474 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2477 ; DQNOVL-LABEL: test_8f32tosb:
2479 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2480 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2481 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2483 %mask = fptosi <8 x float> %a to <8 x i1>
2484 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2485 ret <8 x i64> %select
2488 define <16 x i32> @test_16f32tosb(<16 x float> %a, <16 x i32> %passthru) {
2489 ; NODQ-LABEL: test_16f32tosb:
2491 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2492 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2493 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2496 ; VLDQ-LABEL: test_16f32tosb:
2498 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2499 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2500 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2503 ; DQNOVL-LABEL: test_16f32tosb:
2505 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2506 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2507 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2509 %mask = fptosi <16 x float> %a to <16 x i1>
2510 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2511 ret <16 x i32> %select