1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=ALL,NOVL,NODQ,NOVLDQ,KNL
3 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq | FileCheck %s --check-prefixes=ALL,VL,VLDQ,VLBW
4 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512vl | FileCheck %s --check-prefixes=ALL,NODQ,VL,VLNODQ,VLNOBW
5 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512dq | FileCheck %s --check-prefixes=ALL,NOVL,DQNOVL
6 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512bw | FileCheck %s --check-prefixes=ALL,NOVL,NODQ,NOVLDQ,AVX512BW
7 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512vl,avx512dq | FileCheck %s --check-prefixes=ALL,VL,VLDQ,VLNOBW
8 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=avx512vl,avx512bw | FileCheck %s --check-prefixes=ALL,NODQ,VL,VLNODQ,VLBW
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: vunpcklpd {{.*#+}} 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: vunpcklpd {{.*#+}} 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: vunpcklpd {{.*#+}} 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: vunpcklpd {{.*#+}} 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: vunpcklpd {{.*#+}} 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: vunpcklpd {{.*#+}} 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: vunpcklpd {{.*#+}} 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: vcvtsi2ss %rax, %xmm1, %xmm1
127 ; NODQ-NEXT: vmovq %xmm0, %rax
128 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm0
129 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],zero,zero
132 ; VLDQ-LABEL: sltof2f32:
134 ; VLDQ-NEXT: vcvtqq2ps %xmm0, %xmm0
137 ; DQNOVL-LABEL: sltof2f32:
139 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
140 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
141 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
142 ; DQNOVL-NEXT: vzeroupper
144 %b = sitofp <2 x i64> %a to <2 x float>
148 define <4 x float> @slto4f32_mem(ptr %a) {
149 ; NODQ-LABEL: slto4f32_mem:
151 ; NODQ-NEXT: vcvtsi2ssq 8(%rdi), %xmm0, %xmm0
152 ; NODQ-NEXT: vcvtsi2ssq (%rdi), %xmm1, %xmm1
153 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[2,3]
154 ; NODQ-NEXT: vcvtsi2ssq 16(%rdi), %xmm2, %xmm1
155 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0],xmm0[3]
156 ; NODQ-NEXT: vcvtsi2ssq 24(%rdi), %xmm2, %xmm1
157 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm1[0]
160 ; VLDQ-LABEL: slto4f32_mem:
162 ; VLDQ-NEXT: vcvtqq2psy (%rdi), %xmm0
165 ; DQNOVL-LABEL: slto4f32_mem:
167 ; DQNOVL-NEXT: vmovups (%rdi), %ymm0
168 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
169 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
170 ; DQNOVL-NEXT: vzeroupper
172 %a1 = load <4 x i64>, ptr %a, align 8
173 %b = sitofp <4 x i64> %a1 to <4 x float>
177 define <4 x i64> @f64to4sl(<4 x double> %a) {
178 ; NODQ-LABEL: f64to4sl:
180 ; NODQ-NEXT: vextractf128 $1, %ymm0, %xmm1
181 ; NODQ-NEXT: vcvttsd2si %xmm1, %rax
182 ; NODQ-NEXT: vmovq %rax, %xmm2
183 ; NODQ-NEXT: vshufpd {{.*#+}} xmm1 = xmm1[1,0]
184 ; NODQ-NEXT: vcvttsd2si %xmm1, %rax
185 ; NODQ-NEXT: vmovq %rax, %xmm1
186 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
187 ; NODQ-NEXT: vcvttsd2si %xmm0, %rax
188 ; NODQ-NEXT: vmovq %rax, %xmm2
189 ; NODQ-NEXT: vshufpd {{.*#+}} xmm0 = xmm0[1,0]
190 ; NODQ-NEXT: vcvttsd2si %xmm0, %rax
191 ; NODQ-NEXT: vmovq %rax, %xmm0
192 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
193 ; NODQ-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
196 ; VLDQ-LABEL: f64to4sl:
198 ; VLDQ-NEXT: vcvttpd2qq %ymm0, %ymm0
201 ; DQNOVL-LABEL: f64to4sl:
203 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
204 ; DQNOVL-NEXT: vcvttpd2qq %zmm0, %zmm0
205 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
207 %b = fptosi <4 x double> %a to <4 x i64>
211 define <4 x i64> @f32to4sl(<4 x float> %a) {
212 ; NODQ-LABEL: f32to4sl:
214 ; NODQ-NEXT: vshufps {{.*#+}} xmm1 = xmm0[3,3,3,3]
215 ; NODQ-NEXT: vcvttss2si %xmm1, %rax
216 ; NODQ-NEXT: vmovq %rax, %xmm1
217 ; NODQ-NEXT: vshufpd {{.*#+}} xmm2 = xmm0[1,0]
218 ; NODQ-NEXT: vcvttss2si %xmm2, %rax
219 ; NODQ-NEXT: vmovq %rax, %xmm2
220 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
221 ; NODQ-NEXT: vcvttss2si %xmm0, %rax
222 ; NODQ-NEXT: vmovq %rax, %xmm2
223 ; NODQ-NEXT: vmovshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
224 ; NODQ-NEXT: vcvttss2si %xmm0, %rax
225 ; NODQ-NEXT: vmovq %rax, %xmm0
226 ; NODQ-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
227 ; NODQ-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
230 ; VLDQ-LABEL: f32to4sl:
232 ; VLDQ-NEXT: vcvttps2qq %xmm0, %ymm0
235 ; DQNOVL-LABEL: f32to4sl:
237 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
238 ; DQNOVL-NEXT: vcvttps2qq %ymm0, %zmm0
239 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
241 %b = fptosi <4 x float> %a to <4 x i64>
245 define <4 x float> @slto4f32(<4 x i64> %a) {
246 ; NODQ-LABEL: slto4f32:
248 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
249 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm1, %xmm1
250 ; NODQ-NEXT: vmovq %xmm0, %rax
251 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
252 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
253 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
254 ; NODQ-NEXT: vmovq %xmm0, %rax
255 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm2
256 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
257 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
258 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm0
259 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
260 ; NODQ-NEXT: vzeroupper
263 ; VLDQ-LABEL: slto4f32:
265 ; VLDQ-NEXT: vcvtqq2ps %ymm0, %xmm0
266 ; VLDQ-NEXT: vzeroupper
269 ; DQNOVL-LABEL: slto4f32:
271 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
272 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
273 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
274 ; DQNOVL-NEXT: vzeroupper
276 %b = sitofp <4 x i64> %a to <4 x float>
280 define <4 x float> @ulto4f32(<4 x i64> %a) {
281 ; NODQ-LABEL: ulto4f32:
283 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
284 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm1, %xmm1
285 ; NODQ-NEXT: vmovq %xmm0, %rax
286 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm2, %xmm2
287 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
288 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
289 ; NODQ-NEXT: vmovq %xmm0, %rax
290 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm2
291 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
292 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
293 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm0
294 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
295 ; NODQ-NEXT: vzeroupper
298 ; VLDQ-LABEL: ulto4f32:
300 ; VLDQ-NEXT: vcvtuqq2ps %ymm0, %xmm0
301 ; VLDQ-NEXT: vzeroupper
304 ; DQNOVL-LABEL: ulto4f32:
306 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
307 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
308 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
309 ; DQNOVL-NEXT: vzeroupper
311 %b = uitofp <4 x i64> %a to <4 x float>
315 define <8 x double> @ulto8f64(<8 x i64> %a) {
316 ; NODQ-LABEL: ulto8f64:
318 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm1 = [4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200]
319 ; NODQ-NEXT: vpternlogq $248, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm1
320 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
321 ; NODQ-NEXT: vporq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
322 ; NODQ-NEXT: vsubpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
323 ; NODQ-NEXT: vaddpd %zmm0, %zmm1, %zmm0
326 ; VLDQ-LABEL: ulto8f64:
328 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
331 ; DQNOVL-LABEL: ulto8f64:
333 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
335 %b = uitofp <8 x i64> %a to <8 x double>
339 define <16 x double> @ulto16f64(<16 x i64> %a) {
340 ; NODQ-LABEL: ulto16f64:
342 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295]
343 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm3 = [4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200]
344 ; NODQ-NEXT: vmovdqa64 %zmm3, %zmm4
345 ; NODQ-NEXT: vpternlogq $248, %zmm2, %zmm0, %zmm4
346 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
347 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm5 = [4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072]
348 ; NODQ-NEXT: vporq %zmm5, %zmm0, %zmm0
349 ; 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]
350 ; NODQ-NEXT: vsubpd %zmm6, %zmm0, %zmm0
351 ; NODQ-NEXT: vaddpd %zmm0, %zmm4, %zmm0
352 ; NODQ-NEXT: vpternlogq $248, %zmm2, %zmm1, %zmm3
353 ; NODQ-NEXT: vpsrlq $32, %zmm1, %zmm1
354 ; NODQ-NEXT: vporq %zmm5, %zmm1, %zmm1
355 ; NODQ-NEXT: vsubpd %zmm6, %zmm1, %zmm1
356 ; NODQ-NEXT: vaddpd %zmm1, %zmm3, %zmm1
359 ; VLDQ-LABEL: ulto16f64:
361 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
362 ; VLDQ-NEXT: vcvtuqq2pd %zmm1, %zmm1
365 ; DQNOVL-LABEL: ulto16f64:
367 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
368 ; DQNOVL-NEXT: vcvtuqq2pd %zmm1, %zmm1
370 %b = uitofp <16 x i64> %a to <16 x double>
374 define <16 x i32> @f64to16si(<16 x float> %a) nounwind {
375 ; ALL-LABEL: f64to16si:
377 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
379 %b = fptosi <16 x float> %a to <16 x i32>
383 define <16 x i8> @f32to16sc(<16 x float> %f) {
384 ; ALL-LABEL: f32to16sc:
386 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
387 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
388 ; ALL-NEXT: vzeroupper
390 %res = fptosi <16 x float> %f to <16 x i8>
394 define <16 x i16> @f32to16ss(<16 x float> %f) {
395 ; ALL-LABEL: f32to16ss:
397 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
398 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
400 %res = fptosi <16 x float> %f to <16 x i16>
404 define <16 x i32> @f32to16ui(<16 x float> %a) nounwind {
405 ; ALL-LABEL: f32to16ui:
407 ; ALL-NEXT: vcvttps2udq %zmm0, %zmm0
409 %b = fptoui <16 x float> %a to <16 x i32>
413 define <16 x i8> @f32to16uc(<16 x float> %f) {
414 ; ALL-LABEL: f32to16uc:
416 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
417 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
418 ; ALL-NEXT: vzeroupper
420 %res = fptoui <16 x float> %f to <16 x i8>
424 define <16 x i16> @f32to16us(<16 x float> %f) {
425 ; ALL-LABEL: f32to16us:
427 ; ALL-NEXT: vcvttps2udq %zmm0, %zmm0
428 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
430 %res = fptoui <16 x float> %f to <16 x i16>
434 define <8 x i32> @f32to8ui(<8 x float> %a) nounwind {
435 ; NOVL-LABEL: f32to8ui:
437 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
438 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
439 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
442 ; VL-LABEL: f32to8ui:
444 ; VL-NEXT: vcvttps2udq %ymm0, %ymm0
446 %b = fptoui <8 x float> %a to <8 x i32>
450 define <4 x i32> @f32to4ui(<4 x float> %a) nounwind {
451 ; NOVL-LABEL: f32to4ui:
453 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
454 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
455 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
456 ; NOVL-NEXT: vzeroupper
459 ; VL-LABEL: f32to4ui:
461 ; VL-NEXT: vcvttps2udq %xmm0, %xmm0
463 %b = fptoui <4 x float> %a to <4 x i32>
467 define <8 x i32> @f64to8ui(<8 x double> %a) nounwind {
468 ; ALL-LABEL: f64to8ui:
470 ; ALL-NEXT: vcvttpd2udq %zmm0, %ymm0
472 %b = fptoui <8 x double> %a to <8 x i32>
476 define <8 x i16> @f64to8us(<8 x double> %f) {
477 ; NOVL-LABEL: f64to8us:
479 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
480 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
481 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
482 ; NOVL-NEXT: vzeroupper
485 ; VL-LABEL: f64to8us:
487 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
488 ; VL-NEXT: vpmovdw %ymm0, %xmm0
489 ; VL-NEXT: vzeroupper
491 %res = fptoui <8 x double> %f to <8 x i16>
495 define <8 x i8> @f64to8uc(<8 x double> %f) {
496 ; NOVL-LABEL: f64to8uc:
498 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
499 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
500 ; NOVL-NEXT: vzeroupper
503 ; VL-LABEL: f64to8uc:
505 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
506 ; VL-NEXT: vpmovdb %ymm0, %xmm0
507 ; VL-NEXT: vzeroupper
509 %res = fptoui <8 x double> %f to <8 x i8>
513 define <4 x i32> @f64to4ui(<4 x double> %a) nounwind {
514 ; NOVL-LABEL: f64to4ui:
516 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
517 ; NOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
518 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
519 ; NOVL-NEXT: vzeroupper
522 ; VL-LABEL: f64to4ui:
524 ; VL-NEXT: vcvttpd2udq %ymm0, %xmm0
525 ; VL-NEXT: vzeroupper
527 %b = fptoui <4 x double> %a to <4 x i32>
531 define <8 x double> @sito8f64(<8 x i32> %a) {
532 ; ALL-LABEL: sito8f64:
534 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
536 %b = sitofp <8 x i32> %a to <8 x double>
539 define <8 x double> @i32to8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
540 ; KNL-LABEL: i32to8f64_mask:
542 ; KNL-NEXT: kmovw %edi, %k1
543 ; KNL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
546 ; VLBW-LABEL: i32to8f64_mask:
548 ; VLBW-NEXT: kmovd %edi, %k1
549 ; VLBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
552 ; VLNOBW-LABEL: i32to8f64_mask:
554 ; VLNOBW-NEXT: kmovw %edi, %k1
555 ; VLNOBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
558 ; DQNOVL-LABEL: i32to8f64_mask:
560 ; DQNOVL-NEXT: kmovw %edi, %k1
561 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
564 ; AVX512BW-LABEL: i32to8f64_mask:
566 ; AVX512BW-NEXT: kmovd %edi, %k1
567 ; AVX512BW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
568 ; AVX512BW-NEXT: retq
569 %1 = bitcast i8 %c to <8 x i1>
570 %2 = sitofp <8 x i32> %b to <8 x double>
571 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
574 define <8 x double> @sito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
575 ; KNL-LABEL: sito8f64_maskz:
577 ; KNL-NEXT: kmovw %edi, %k1
578 ; KNL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
581 ; VLBW-LABEL: sito8f64_maskz:
583 ; VLBW-NEXT: kmovd %edi, %k1
584 ; VLBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
587 ; VLNOBW-LABEL: sito8f64_maskz:
589 ; VLNOBW-NEXT: kmovw %edi, %k1
590 ; VLNOBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
593 ; DQNOVL-LABEL: sito8f64_maskz:
595 ; DQNOVL-NEXT: kmovw %edi, %k1
596 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
599 ; AVX512BW-LABEL: sito8f64_maskz:
601 ; AVX512BW-NEXT: kmovd %edi, %k1
602 ; AVX512BW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
603 ; AVX512BW-NEXT: retq
604 %1 = bitcast i8 %b to <8 x i1>
605 %2 = sitofp <8 x i32> %a to <8 x double>
606 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
610 define <8 x i32> @f64to8si(<8 x double> %a) {
611 ; ALL-LABEL: f64to8si:
613 ; ALL-NEXT: vcvttpd2dq %zmm0, %ymm0
615 %b = fptosi <8 x double> %a to <8 x i32>
619 define <8 x i16> @f64to8ss(<8 x double> %f) {
620 ; NOVL-LABEL: f64to8ss:
622 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
623 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
624 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
625 ; NOVL-NEXT: vzeroupper
628 ; VL-LABEL: f64to8ss:
630 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
631 ; VL-NEXT: vpmovdw %ymm0, %xmm0
632 ; VL-NEXT: vzeroupper
634 %res = fptosi <8 x double> %f to <8 x i16>
638 define <8 x i8> @f64to8sc(<8 x double> %f) {
639 ; NOVL-LABEL: f64to8sc:
641 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
642 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
643 ; NOVL-NEXT: vzeroupper
646 ; VL-LABEL: f64to8sc:
648 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
649 ; VL-NEXT: vpmovdb %ymm0, %xmm0
650 ; VL-NEXT: vzeroupper
652 %res = fptosi <8 x double> %f to <8 x i8>
656 define <4 x i32> @f64to4si(<4 x double> %a) {
657 ; ALL-LABEL: f64to4si:
659 ; ALL-NEXT: vcvttpd2dq %ymm0, %xmm0
660 ; ALL-NEXT: vzeroupper
662 %b = fptosi <4 x double> %a to <4 x i32>
666 define <16 x float> @f64to16f32(<16 x double> %b) nounwind {
667 ; ALL-LABEL: f64to16f32:
669 ; ALL-NEXT: vcvtpd2ps %zmm0, %ymm0
670 ; ALL-NEXT: vcvtpd2ps %zmm1, %ymm1
671 ; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
673 %a = fptrunc <16 x double> %b to <16 x float>
677 define <4 x float> @f64to4f32(<4 x double> %b) {
678 ; ALL-LABEL: f64to4f32:
680 ; ALL-NEXT: vcvtpd2ps %ymm0, %xmm0
681 ; ALL-NEXT: vzeroupper
683 %a = fptrunc <4 x double> %b to <4 x float>
687 define <4 x float> @f64to4f32_mask(<4 x double> %b, <4 x i1> %mask) {
688 ; NOVLDQ-LABEL: f64to4f32_mask:
690 ; NOVLDQ-NEXT: vpslld $31, %xmm1, %xmm1
691 ; NOVLDQ-NEXT: vptestmd %zmm1, %zmm1, %k1
692 ; NOVLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0
693 ; NOVLDQ-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
694 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
695 ; NOVLDQ-NEXT: vzeroupper
698 ; VLDQ-LABEL: f64to4f32_mask:
700 ; VLDQ-NEXT: vpslld $31, %xmm1, %xmm1
701 ; VLDQ-NEXT: vpmovd2m %xmm1, %k1
702 ; VLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
703 ; VLDQ-NEXT: vzeroupper
706 ; VLNODQ-LABEL: f64to4f32_mask:
708 ; VLNODQ-NEXT: vpslld $31, %xmm1, %xmm1
709 ; VLNODQ-NEXT: vptestmd %xmm1, %xmm1, %k1
710 ; VLNODQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
711 ; VLNODQ-NEXT: vzeroupper
714 ; DQNOVL-LABEL: f64to4f32_mask:
716 ; DQNOVL-NEXT: vpslld $31, %xmm1, %xmm1
717 ; DQNOVL-NEXT: vpmovd2m %zmm1, %k1
718 ; DQNOVL-NEXT: vcvtpd2ps %ymm0, %xmm0
719 ; DQNOVL-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
720 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
721 ; DQNOVL-NEXT: vzeroupper
723 %a = fptrunc <4 x double> %b to <4 x float>
724 %c = select <4 x i1>%mask, <4 x float>%a, <4 x float> zeroinitializer
728 define <4 x float> @f64tof32_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
729 ; ALL-LABEL: f64tof32_inreg:
731 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm1, %xmm0
733 %ext = extractelement <2 x double> %a0, i32 0
734 %cvt = fptrunc double %ext to float
735 %res = insertelement <4 x float> %a1, float %cvt, i32 0
739 define <8 x double> @f32to8f64(<8 x float> %b) nounwind {
740 ; ALL-LABEL: f32to8f64:
742 ; ALL-NEXT: vcvtps2pd %ymm0, %zmm0
744 %a = fpext <8 x float> %b to <8 x double>
748 define <4 x double> @f32to4f64_mask(<4 x float> %b, <4 x double> %b1, <4 x double> %a1) {
749 ; NOVL-LABEL: f32to4f64_mask:
751 ; NOVL-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
752 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
753 ; NOVL-NEXT: vcvtps2pd %xmm0, %ymm0
754 ; NOVL-NEXT: vcmpltpd %zmm2, %zmm1, %k1
755 ; NOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
756 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
759 ; VL-LABEL: f32to4f64_mask:
761 ; VL-NEXT: vcmpltpd %ymm2, %ymm1, %k1
762 ; VL-NEXT: vcvtps2pd %xmm0, %ymm0 {%k1} {z}
764 %a = fpext <4 x float> %b to <4 x double>
765 %mask = fcmp ogt <4 x double> %a1, %b1
766 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
770 define <4 x double> @f32to4f64_mask_load(ptr %p, <4 x double> %b1, <4 x double> %a1, <4 x double> %passthru) {
771 ; NOVL-LABEL: f32to4f64_mask_load:
773 ; NOVL-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
774 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
775 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
776 ; NOVL-NEXT: vcvtps2pd (%rdi), %ymm3
777 ; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
778 ; NOVL-NEXT: vblendmpd %zmm3, %zmm2, %zmm0 {%k1}
779 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
782 ; VL-LABEL: f32to4f64_mask_load:
784 ; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
785 ; VL-NEXT: vcvtps2pd (%rdi), %ymm2 {%k1}
786 ; VL-NEXT: vmovaps %ymm2, %ymm0
788 %b = load <4 x float>, ptr %p
789 %a = fpext <4 x float> %b to <4 x double>
790 %mask = fcmp ogt <4 x double> %a1, %b1
791 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> %passthru
795 define <4 x double> @f32to4f64_maskz_load(ptr %p, <4 x double> %b1, <4 x double> %a1) {
796 ; NOVL-LABEL: f32to4f64_maskz_load:
798 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
799 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
800 ; NOVL-NEXT: vcvtps2pd (%rdi), %ymm2
801 ; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
802 ; NOVL-NEXT: vmovapd %zmm2, %zmm0 {%k1} {z}
803 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
806 ; VL-LABEL: f32to4f64_maskz_load:
808 ; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
809 ; VL-NEXT: vcvtps2pd (%rdi), %ymm0 {%k1} {z}
811 %b = load <4 x float>, ptr %p
812 %a = fpext <4 x float> %b to <4 x double>
813 %mask = fcmp ogt <4 x double> %a1, %b1
814 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
818 define <2 x double> @f32tof64_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
819 ; ALL-LABEL: f32tof64_inreg:
821 ; ALL-NEXT: vcvtss2sd %xmm1, %xmm0, %xmm0
823 %ext = extractelement <4 x float> %a1, i32 0
824 %cvt = fpext float %ext to double
825 %res = insertelement <2 x double> %a0, double %cvt, i32 0
826 ret <2 x double> %res
829 define double @sltof64_load(ptr nocapture %e) {
830 ; ALL-LABEL: sltof64_load:
831 ; ALL: # %bb.0: # %entry
832 ; ALL-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
835 %tmp1 = load i64, ptr %e, align 8
836 %conv = sitofp i64 %tmp1 to double
840 define double @sitof64_load(ptr %e) {
841 ; ALL-LABEL: sitof64_load:
842 ; ALL: # %bb.0: # %entry
843 ; ALL-NEXT: vcvtsi2sdl (%rdi), %xmm0, %xmm0
846 %tmp1 = load i32, ptr %e, align 4
847 %conv = sitofp i32 %tmp1 to double
851 define float @sitof32_load(ptr %e) {
852 ; ALL-LABEL: sitof32_load:
853 ; ALL: # %bb.0: # %entry
854 ; ALL-NEXT: vcvtsi2ssl (%rdi), %xmm0, %xmm0
857 %tmp1 = load i32, ptr %e, align 4
858 %conv = sitofp i32 %tmp1 to float
862 define float @sltof32_load(ptr %e) {
863 ; ALL-LABEL: sltof32_load:
864 ; ALL: # %bb.0: # %entry
865 ; ALL-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
868 %tmp1 = load i64, ptr %e, align 8
869 %conv = sitofp i64 %tmp1 to float
873 define void @f32tof64_loadstore() {
874 ; ALL-LABEL: f32tof64_loadstore:
875 ; ALL: # %bb.0: # %entry
876 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
877 ; ALL-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
878 ; ALL-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp)
881 %f = alloca float, align 4
882 %d = alloca double, align 8
883 %tmp = load float, ptr %f, align 4
884 %conv = fpext float %tmp to double
885 store double %conv, ptr %d, align 8
889 define void @f64tof32_loadstore() nounwind uwtable {
890 ; ALL-LABEL: f64tof32_loadstore:
891 ; ALL: # %bb.0: # %entry
892 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
893 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
894 ; ALL-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp)
897 %f = alloca float, align 4
898 %d = alloca double, align 8
899 %tmp = load double, ptr %d, align 8
900 %conv = fptrunc double %tmp to float
901 store float %conv, ptr %f, align 4
905 define double @long_to_double(i64 %x) {
906 ; ALL-LABEL: long_to_double:
908 ; ALL-NEXT: vmovq %rdi, %xmm0
910 %res = bitcast i64 %x to double
914 define i64 @double_to_long(double %x) {
915 ; ALL-LABEL: double_to_long:
917 ; ALL-NEXT: vmovq %xmm0, %rax
919 %res = bitcast double %x to i64
923 define float @int_to_float(i32 %x) {
924 ; ALL-LABEL: int_to_float:
926 ; ALL-NEXT: vmovd %edi, %xmm0
928 %res = bitcast i32 %x to float
932 define i32 @float_to_int(float %x) {
933 ; ALL-LABEL: float_to_int:
935 ; ALL-NEXT: vmovd %xmm0, %eax
937 %res = bitcast float %x to i32
941 define <16 x double> @uito16f64(<16 x i32> %a) nounwind {
942 ; ALL-LABEL: uito16f64:
944 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm2
945 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
946 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm1
947 ; ALL-NEXT: vmovaps %zmm2, %zmm0
949 %b = uitofp <16 x i32> %a to <16 x double>
953 define <8 x float> @slto8f32(<8 x i64> %a) {
954 ; NODQ-LABEL: slto8f32:
956 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
957 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
958 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
959 ; NODQ-NEXT: vmovq %xmm1, %rax
960 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm1
961 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
962 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
963 ; NODQ-NEXT: vmovq %xmm2, %rax
964 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
965 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
966 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
967 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
968 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
969 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
970 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
971 ; NODQ-NEXT: vmovq %xmm0, %rax
972 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
973 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
974 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
975 ; NODQ-NEXT: vmovq %xmm0, %rax
976 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
977 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
978 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
979 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm0
980 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
981 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
984 ; VLDQ-LABEL: slto8f32:
986 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
989 ; DQNOVL-LABEL: slto8f32:
991 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
993 %b = sitofp <8 x i64> %a to <8 x float>
997 define <16 x float> @slto16f32(<16 x i64> %a) {
998 ; NODQ-LABEL: slto16f32:
1000 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1001 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1002 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
1003 ; NODQ-NEXT: vmovq %xmm2, %rax
1004 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
1005 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1006 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1007 ; NODQ-NEXT: vmovq %xmm3, %rax
1008 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm4
1009 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1010 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1011 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1012 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1013 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1014 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1015 ; NODQ-NEXT: vmovq %xmm1, %rax
1016 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1017 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1018 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1019 ; NODQ-NEXT: vmovq %xmm1, %rax
1020 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1021 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1022 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1023 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm1
1024 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1025 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1026 ; NODQ-NEXT: vextractf32x4 $2, %zmm0, %xmm2
1027 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1028 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1029 ; NODQ-NEXT: vmovq %xmm2, %rax
1030 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm2
1031 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1032 ; NODQ-NEXT: vextractf32x4 $3, %zmm0, %xmm3
1033 ; NODQ-NEXT: vmovq %xmm3, %rax
1034 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1035 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1036 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1037 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1038 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1039 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1040 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1041 ; NODQ-NEXT: vmovq %xmm0, %rax
1042 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1043 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1044 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1045 ; NODQ-NEXT: vmovq %xmm0, %rax
1046 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1047 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1048 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1049 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm0
1050 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1051 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1052 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1055 ; VLDQ-LABEL: slto16f32:
1057 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
1058 ; VLDQ-NEXT: vcvtqq2ps %zmm1, %ymm1
1059 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1062 ; DQNOVL-LABEL: slto16f32:
1064 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
1065 ; DQNOVL-NEXT: vcvtqq2ps %zmm1, %ymm1
1066 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1068 %b = sitofp <16 x i64> %a to <16 x float>
1072 define <8 x double> @slto8f64(<8 x i64> %a) {
1073 ; NODQ-LABEL: slto8f64:
1075 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm1
1076 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1077 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm2, %xmm2
1078 ; NODQ-NEXT: vmovq %xmm1, %rax
1079 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm1
1080 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm1 = xmm1[0],xmm2[0]
1081 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1082 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1083 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1084 ; NODQ-NEXT: vmovq %xmm2, %rax
1085 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1086 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1087 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
1088 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm2
1089 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1090 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1091 ; NODQ-NEXT: vmovq %xmm2, %rax
1092 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1093 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1094 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1095 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1096 ; NODQ-NEXT: vmovq %xmm0, %rax
1097 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm0
1098 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm0 = xmm0[0],xmm3[0]
1099 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1100 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1103 ; VLDQ-LABEL: slto8f64:
1105 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1108 ; DQNOVL-LABEL: slto8f64:
1110 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1112 %b = sitofp <8 x i64> %a to <8 x double>
1116 define <16 x double> @slto16f64(<16 x i64> %a) {
1117 ; NODQ-LABEL: slto16f64:
1119 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1120 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1121 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1122 ; NODQ-NEXT: vmovq %xmm2, %rax
1123 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1124 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1125 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm3
1126 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1127 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm4
1128 ; NODQ-NEXT: vmovq %xmm3, %rax
1129 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1130 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1131 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1132 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm3
1133 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1134 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1135 ; NODQ-NEXT: vmovq %xmm3, %rax
1136 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1137 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1138 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1139 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1140 ; NODQ-NEXT: vmovq %xmm0, %rax
1141 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm0
1142 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm0 = xmm0[0],xmm4[0]
1143 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0
1144 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
1145 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm2
1146 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1147 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1148 ; NODQ-NEXT: vmovq %xmm2, %rax
1149 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm2
1150 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1151 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm3
1152 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1153 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1154 ; NODQ-NEXT: vmovq %xmm3, %rax
1155 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1156 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1157 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1158 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm3
1159 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1160 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1161 ; NODQ-NEXT: vmovq %xmm3, %rax
1162 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1163 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1164 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1165 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1166 ; NODQ-NEXT: vmovq %xmm1, %rax
1167 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm1
1168 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm1 = xmm1[0],xmm4[0]
1169 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1
1170 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm1, %zmm1
1173 ; VLDQ-LABEL: slto16f64:
1175 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1176 ; VLDQ-NEXT: vcvtqq2pd %zmm1, %zmm1
1179 ; DQNOVL-LABEL: slto16f64:
1181 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1182 ; DQNOVL-NEXT: vcvtqq2pd %zmm1, %zmm1
1184 %b = sitofp <16 x i64> %a to <16 x double>
1185 ret <16 x double> %b
1188 define <8 x float> @ulto8f32(<8 x i64> %a) {
1189 ; NODQ-LABEL: ulto8f32:
1191 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
1192 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1193 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm2, %xmm2
1194 ; NODQ-NEXT: vmovq %xmm1, %rax
1195 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm1
1196 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
1197 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1198 ; NODQ-NEXT: vmovq %xmm2, %rax
1199 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1200 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
1201 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1202 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1203 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
1204 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1205 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1206 ; NODQ-NEXT: vmovq %xmm0, %rax
1207 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1208 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
1209 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1210 ; NODQ-NEXT: vmovq %xmm0, %rax
1211 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1212 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
1213 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1214 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm0
1215 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
1216 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1219 ; VLDQ-LABEL: ulto8f32:
1221 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1224 ; DQNOVL-LABEL: ulto8f32:
1226 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1228 %b = uitofp <8 x i64> %a to <8 x float>
1232 define <16 x float> @ulto16f32(<16 x i64> %a) {
1233 ; NODQ-LABEL: ulto16f32:
1235 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1236 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1237 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1238 ; NODQ-NEXT: vmovq %xmm2, %rax
1239 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1240 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1241 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1242 ; NODQ-NEXT: vmovq %xmm3, %rax
1243 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm4
1244 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1245 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1246 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1247 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1248 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1249 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1250 ; NODQ-NEXT: vmovq %xmm1, %rax
1251 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1252 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1253 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1254 ; NODQ-NEXT: vmovq %xmm1, %rax
1255 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1256 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1257 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1258 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm1
1259 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1260 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1261 ; NODQ-NEXT: vextractf32x4 $2, %zmm0, %xmm2
1262 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1263 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1264 ; NODQ-NEXT: vmovq %xmm2, %rax
1265 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm2
1266 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1267 ; NODQ-NEXT: vextractf32x4 $3, %zmm0, %xmm3
1268 ; NODQ-NEXT: vmovq %xmm3, %rax
1269 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1270 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1271 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1272 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1273 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1274 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1275 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1276 ; NODQ-NEXT: vmovq %xmm0, %rax
1277 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1278 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1279 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1280 ; NODQ-NEXT: vmovq %xmm0, %rax
1281 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1282 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1283 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1284 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm0
1285 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1286 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1287 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1290 ; VLDQ-LABEL: ulto16f32:
1292 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1293 ; VLDQ-NEXT: vcvtuqq2ps %zmm1, %ymm1
1294 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1297 ; DQNOVL-LABEL: ulto16f32:
1299 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1300 ; DQNOVL-NEXT: vcvtuqq2ps %zmm1, %ymm1
1301 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1303 %b = uitofp <16 x i64> %a to <16 x float>
1307 define <8 x double> @uito8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
1308 ; KNL-LABEL: uito8f64_mask:
1310 ; KNL-NEXT: kmovw %edi, %k1
1311 ; KNL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1314 ; VLBW-LABEL: uito8f64_mask:
1316 ; VLBW-NEXT: kmovd %edi, %k1
1317 ; VLBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1320 ; VLNOBW-LABEL: uito8f64_mask:
1322 ; VLNOBW-NEXT: kmovw %edi, %k1
1323 ; VLNOBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1326 ; DQNOVL-LABEL: uito8f64_mask:
1328 ; DQNOVL-NEXT: kmovw %edi, %k1
1329 ; DQNOVL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1332 ; AVX512BW-LABEL: uito8f64_mask:
1333 ; AVX512BW: # %bb.0:
1334 ; AVX512BW-NEXT: kmovd %edi, %k1
1335 ; AVX512BW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1336 ; AVX512BW-NEXT: retq
1337 %1 = bitcast i8 %c to <8 x i1>
1338 %2 = uitofp <8 x i32> %b to <8 x double>
1339 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
1342 define <8 x double> @uito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
1343 ; KNL-LABEL: uito8f64_maskz:
1345 ; KNL-NEXT: kmovw %edi, %k1
1346 ; KNL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1349 ; VLBW-LABEL: uito8f64_maskz:
1351 ; VLBW-NEXT: kmovd %edi, %k1
1352 ; VLBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1355 ; VLNOBW-LABEL: uito8f64_maskz:
1357 ; VLNOBW-NEXT: kmovw %edi, %k1
1358 ; VLNOBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1361 ; DQNOVL-LABEL: uito8f64_maskz:
1363 ; DQNOVL-NEXT: kmovw %edi, %k1
1364 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1367 ; AVX512BW-LABEL: uito8f64_maskz:
1368 ; AVX512BW: # %bb.0:
1369 ; AVX512BW-NEXT: kmovd %edi, %k1
1370 ; AVX512BW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1371 ; AVX512BW-NEXT: retq
1372 %1 = bitcast i8 %b to <8 x i1>
1373 %2 = uitofp <8 x i32> %a to <8 x double>
1374 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
1378 define <4 x double> @uito4f64(<4 x i32> %a) nounwind {
1379 ; NOVL-LABEL: uito4f64:
1381 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1382 ; NOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
1383 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1386 ; VL-LABEL: uito4f64:
1388 ; VL-NEXT: vcvtudq2pd %xmm0, %ymm0
1390 %b = uitofp <4 x i32> %a to <4 x double>
1394 define <16 x float> @uito16f32(<16 x i32> %a) nounwind {
1395 ; ALL-LABEL: uito16f32:
1397 ; ALL-NEXT: vcvtudq2ps %zmm0, %zmm0
1399 %b = uitofp <16 x i32> %a to <16 x float>
1403 define <8 x double> @uito8f64(<8 x i32> %a) {
1404 ; ALL-LABEL: uito8f64:
1406 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm0
1408 %b = uitofp <8 x i32> %a to <8 x double>
1412 define <8 x float> @uito8f32(<8 x i32> %a) nounwind {
1413 ; NOVL-LABEL: uito8f32:
1415 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1416 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1417 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1420 ; VL-LABEL: uito8f32:
1422 ; VL-NEXT: vcvtudq2ps %ymm0, %ymm0
1424 %b = uitofp <8 x i32> %a to <8 x float>
1428 define <4 x float> @uito4f32(<4 x i32> %a) nounwind {
1429 ; NOVL-LABEL: uito4f32:
1431 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1432 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1433 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1434 ; NOVL-NEXT: vzeroupper
1437 ; VL-LABEL: uito4f32:
1439 ; VL-NEXT: vcvtudq2ps %xmm0, %xmm0
1441 %b = uitofp <4 x i32> %a to <4 x float>
1445 define i32 @fptosi(float %a) nounwind {
1446 ; ALL-LABEL: fptosi:
1448 ; ALL-NEXT: vcvttss2si %xmm0, %eax
1450 %b = fptosi float %a to i32
1454 define i32 @fptoui(float %a) nounwind {
1455 ; ALL-LABEL: fptoui:
1457 ; ALL-NEXT: vcvttss2usi %xmm0, %eax
1459 %b = fptoui float %a to i32
1463 define float @uitof32(i32 %a) nounwind {
1464 ; ALL-LABEL: uitof32:
1466 ; ALL-NEXT: vcvtusi2ss %edi, %xmm0, %xmm0
1468 %b = uitofp i32 %a to float
1472 define double @uitof64(i32 %a) nounwind {
1473 ; ALL-LABEL: uitof64:
1475 ; ALL-NEXT: vcvtusi2sd %edi, %xmm0, %xmm0
1477 %b = uitofp i32 %a to double
1481 define <16 x float> @sbto16f32(<16 x i32> %a) {
1482 ; NODQ-LABEL: sbto16f32:
1484 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1485 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1486 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1487 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1490 ; VLDQ-LABEL: sbto16f32:
1492 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1493 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1494 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1497 ; DQNOVL-LABEL: sbto16f32:
1499 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1500 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1501 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1503 %mask = icmp slt <16 x i32> %a, zeroinitializer
1504 %1 = sitofp <16 x i1> %mask to <16 x float>
1508 define <16 x float> @scto16f32(<16 x i8> %a) {
1509 ; ALL-LABEL: scto16f32:
1511 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm0
1512 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1514 %1 = sitofp <16 x i8> %a to <16 x float>
1518 define <16 x float> @ssto16f32(<16 x i16> %a) {
1519 ; ALL-LABEL: ssto16f32:
1521 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1522 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1524 %1 = sitofp <16 x i16> %a to <16 x float>
1528 define <8 x double> @ssto16f64(<8 x i16> %a) {
1529 ; ALL-LABEL: ssto16f64:
1531 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1532 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1534 %1 = sitofp <8 x i16> %a to <8 x double>
1538 define <8 x double> @scto8f64(<8 x i8> %a) {
1539 ; ALL-LABEL: scto8f64:
1541 ; ALL-NEXT: vpmovsxbd %xmm0, %ymm0
1542 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1544 %1 = sitofp <8 x i8> %a to <8 x double>
1548 define <16 x double> @scto16f64(<16 x i8> %a) {
1549 ; ALL-LABEL: scto16f64:
1551 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm1
1552 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1553 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1554 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1556 %b = sitofp <16 x i8> %a to <16 x double>
1557 ret <16 x double> %b
1560 define <16 x double> @sbto16f64(<16 x double> %a) {
1561 ; NODQ-LABEL: sbto16f64:
1563 ; NODQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1564 ; NODQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1565 ; NODQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1566 ; NODQ-NEXT: kunpckbw %k0, %k1, %k1
1567 ; NODQ-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1 {%k1} {z}
1568 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1569 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1570 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1573 ; VLDQ-LABEL: sbto16f64:
1575 ; VLDQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1576 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1577 ; VLDQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1578 ; VLDQ-NEXT: kunpckbw %k0, %k1, %k0
1579 ; VLDQ-NEXT: vpmovm2d %k0, %zmm1
1580 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1581 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1582 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1585 ; DQNOVL-LABEL: sbto16f64:
1587 ; DQNOVL-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1588 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1589 ; DQNOVL-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1590 ; DQNOVL-NEXT: kunpckbw %k0, %k1, %k0
1591 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm1
1592 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1593 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1594 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1596 %cmpres = fcmp ogt <16 x double> %a, zeroinitializer
1597 %1 = sitofp <16 x i1> %cmpres to <16 x double>
1598 ret <16 x double> %1
1601 define <8 x double> @sbto8f64(<8 x double> %a) {
1602 ; NOVLDQ-LABEL: sbto8f64:
1604 ; NOVLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1605 ; NOVLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1606 ; NOVLDQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1607 ; NOVLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1610 ; VLDQ-LABEL: sbto8f64:
1612 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1613 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1614 ; VLDQ-NEXT: vpmovm2d %k0, %ymm0
1615 ; VLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1618 ; VLNODQ-LABEL: sbto8f64:
1620 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1621 ; VLNODQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1622 ; VLNODQ-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
1623 ; VLNODQ-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
1624 ; VLNODQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1627 ; DQNOVL-LABEL: sbto8f64:
1629 ; DQNOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1630 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1631 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1632 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0
1634 %cmpres = fcmp ogt <8 x double> %a, zeroinitializer
1635 %1 = sitofp <8 x i1> %cmpres to <8 x double>
1639 define <8 x float> @sbto8f32(<8 x float> %a) {
1640 ; ALL-LABEL: sbto8f32:
1642 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1643 ; ALL-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
1644 ; ALL-NEXT: vcvtdq2ps %ymm0, %ymm0
1646 %cmpres = fcmp ogt <8 x float> %a, zeroinitializer
1647 %1 = sitofp <8 x i1> %cmpres to <8 x float>
1651 define <4 x float> @sbto4f32(<4 x float> %a) {
1652 ; ALL-LABEL: sbto4f32:
1654 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1655 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1656 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1658 %cmpres = fcmp ogt <4 x float> %a, zeroinitializer
1659 %1 = sitofp <4 x i1> %cmpres to <4 x float>
1663 define <4 x double> @sbto4f64(<4 x double> %a) {
1664 ; NOVL-LABEL: sbto4f64:
1666 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1667 ; NOVL-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0
1668 ; NOVL-NEXT: vpmovqd %zmm0, %ymm0
1669 ; NOVL-NEXT: vcvtdq2pd %xmm0, %ymm0
1672 ; VLDQ-LABEL: sbto4f64:
1674 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1675 ; VLDQ-NEXT: vcmpltpd %ymm0, %ymm1, %k0
1676 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1677 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1680 ; VLNODQ-LABEL: sbto4f64:
1682 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1683 ; VLNODQ-NEXT: vcmpltpd %ymm0, %ymm1, %k1
1684 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1685 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1686 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1688 %cmpres = fcmp ogt <4 x double> %a, zeroinitializer
1689 %1 = sitofp <4 x i1> %cmpres to <4 x double>
1693 define <2 x float> @sbto2f32(<2 x float> %a) {
1694 ; ALL-LABEL: sbto2f32:
1696 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1697 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1698 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1700 %cmpres = fcmp ogt <2 x float> %a, zeroinitializer
1701 %1 = sitofp <2 x i1> %cmpres to <2 x float>
1705 define <2 x double> @sbto2f64(<2 x double> %a) {
1706 ; NOVL-LABEL: sbto2f64:
1708 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1709 ; NOVL-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
1710 ; NOVL-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2,2,3]
1711 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
1714 ; VLDQ-LABEL: sbto2f64:
1716 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1717 ; VLDQ-NEXT: vcmpltpd %xmm0, %xmm1, %k0
1718 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1719 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1722 ; VLNODQ-LABEL: sbto2f64:
1724 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1725 ; VLNODQ-NEXT: vcmpltpd %xmm0, %xmm1, %k1
1726 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1727 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1728 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1730 %cmpres = fcmp ogt <2 x double> %a, zeroinitializer
1731 %1 = sitofp <2 x i1> %cmpres to <2 x double>
1735 define <16 x float> @ucto16f32(<16 x i8> %a) {
1736 ; ALL-LABEL: ucto16f32:
1738 ; 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
1739 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1741 %b = uitofp <16 x i8> %a to <16 x float>
1745 define <8 x double> @ucto8f64(<8 x i8> %a) {
1746 ; ALL-LABEL: ucto8f64:
1748 ; 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
1749 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1751 %b = uitofp <8 x i8> %a to <8 x double>
1755 define <16 x float> @swto16f32(<16 x i16> %a) {
1756 ; ALL-LABEL: swto16f32:
1758 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1759 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1761 %b = sitofp <16 x i16> %a to <16 x float>
1765 define <8 x double> @swto8f64(<8 x i16> %a) {
1766 ; ALL-LABEL: swto8f64:
1768 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1769 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1771 %b = sitofp <8 x i16> %a to <8 x double>
1775 define <16 x double> @swto16f64(<16 x i16> %a) {
1776 ; ALL-LABEL: swto16f64:
1778 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm1
1779 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1780 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1781 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1783 %b = sitofp <16 x i16> %a to <16 x double>
1784 ret <16 x double> %b
1787 define <16 x double> @ucto16f64(<16 x i8> %a) {
1788 ; ALL-LABEL: ucto16f64:
1790 ; 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
1791 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1792 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1793 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1795 %b = uitofp <16 x i8> %a to <16 x double>
1796 ret <16 x double> %b
1799 define <16 x float> @uwto16f32(<16 x i16> %a) {
1800 ; ALL-LABEL: uwto16f32:
1802 ; 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
1803 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1805 %b = uitofp <16 x i16> %a to <16 x float>
1809 define <8 x double> @uwto8f64(<8 x i16> %a) {
1810 ; ALL-LABEL: uwto8f64:
1812 ; 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
1813 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1815 %b = uitofp <8 x i16> %a to <8 x double>
1819 define <16 x double> @uwto16f64(<16 x i16> %a) {
1820 ; ALL-LABEL: uwto16f64:
1822 ; 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
1823 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1824 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1825 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1827 %b = uitofp <16 x i16> %a to <16 x double>
1828 ret <16 x double> %b
1831 define <16 x float> @sito16f32(<16 x i32> %a) {
1832 ; ALL-LABEL: sito16f32:
1834 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1836 %b = sitofp <16 x i32> %a to <16 x float>
1840 define <16 x double> @sito16f64(<16 x i32> %a) {
1841 ; ALL-LABEL: sito16f64:
1843 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm2
1844 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
1845 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm1
1846 ; ALL-NEXT: vmovaps %zmm2, %zmm0
1848 %b = sitofp <16 x i32> %a to <16 x double>
1849 ret <16 x double> %b
1852 define <16 x float> @usto16f32(<16 x i16> %a) {
1853 ; ALL-LABEL: usto16f32:
1855 ; 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
1856 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1858 %b = uitofp <16 x i16> %a to <16 x float>
1862 define <16 x float> @ubto16f32(<16 x i32> %a) {
1863 ; NODQ-LABEL: ubto16f32:
1865 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1866 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1867 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1868 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm0
1869 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1872 ; VLDQ-LABEL: ubto16f32:
1874 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1875 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1876 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm0
1877 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1880 ; DQNOVL-LABEL: ubto16f32:
1882 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1883 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1884 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm0
1885 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1887 %mask = icmp slt <16 x i32> %a, zeroinitializer
1888 %1 = uitofp <16 x i1> %mask to <16 x float>
1892 define <16 x double> @ubto16f64(<16 x i32> %a) {
1893 ; NODQ-LABEL: ubto16f64:
1895 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1896 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1897 ; NODQ-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1898 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm1
1899 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1900 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1901 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1904 ; VLDQ-LABEL: ubto16f64:
1906 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1907 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1908 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm1
1909 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1910 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1911 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1914 ; DQNOVL-LABEL: ubto16f64:
1916 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1917 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1918 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm1
1919 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1920 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1921 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1923 %mask = icmp slt <16 x i32> %a, zeroinitializer
1924 %1 = uitofp <16 x i1> %mask to <16 x double>
1925 ret <16 x double> %1
1928 define <8 x float> @ubto8f32(<8 x i32> %a) {
1929 ; NOVL-LABEL: ubto8f32:
1931 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1932 ; NOVL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1933 ; NOVL-NEXT: vpbroadcastd {{.*#+}} ymm1 = [1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216]
1934 ; NOVL-NEXT: vpand %ymm1, %ymm0, %ymm0
1937 ; VL-LABEL: ubto8f32:
1939 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1940 ; VL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1941 ; VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm0
1943 %mask = icmp slt <8 x i32> %a, zeroinitializer
1944 %1 = uitofp <8 x i1> %mask to <8 x float>
1948 define <8 x double> @ubto8f64(<8 x i32> %a) {
1949 ; ALL-LABEL: ubto8f64:
1951 ; ALL-NEXT: vpsrld $31, %ymm0, %ymm0
1952 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1954 %mask = icmp slt <8 x i32> %a, zeroinitializer
1955 %1 = uitofp <8 x i1> %mask to <8 x double>
1959 define <4 x float> @ubto4f32(<4 x i32> %a) {
1960 ; NOVL-LABEL: ubto4f32:
1962 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1963 ; NOVL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1964 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
1965 ; NOVL-NEXT: vpand %xmm1, %xmm0, %xmm0
1968 ; VL-LABEL: ubto4f32:
1970 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1971 ; VL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1972 ; VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
1974 %mask = icmp slt <4 x i32> %a, zeroinitializer
1975 %1 = uitofp <4 x i1> %mask to <4 x float>
1979 define <4 x double> @ubto4f64(<4 x i32> %a) {
1980 ; ALL-LABEL: ubto4f64:
1982 ; ALL-NEXT: vpsrld $31, %xmm0, %xmm0
1983 ; ALL-NEXT: vcvtdq2pd %xmm0, %ymm0
1985 %mask = icmp slt <4 x i32> %a, zeroinitializer
1986 %1 = uitofp <4 x i1> %mask to <4 x double>
1990 define <2 x float> @ubto2f32(<2 x i32> %a) {
1991 ; NOVL-LABEL: ubto2f32:
1993 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1994 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1995 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
1996 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
1999 ; VL-LABEL: ubto2f32:
2001 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2002 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2003 ; VL-NEXT: vpandnd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
2005 %mask = icmp ne <2 x i32> %a, zeroinitializer
2006 %1 = uitofp <2 x i1> %mask to <2 x float>
2010 define <2 x double> @ubto2f64(<2 x i32> %a) {
2011 ; NOVL-LABEL: ubto2f64:
2013 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2014 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2015 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1,1,1,1]
2016 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
2017 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
2020 ; VL-LABEL: ubto2f64:
2022 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2023 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2024 ; VL-NEXT: vpandnd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
2025 ; VL-NEXT: vcvtdq2pd %xmm0, %xmm0
2027 %mask = icmp ne <2 x i32> %a, zeroinitializer
2028 %1 = uitofp <2 x i1> %mask to <2 x double>
2032 define <2 x i64> @test_2f64toub(<2 x double> %a, <2 x i64> %passthru) {
2033 ; NOVLDQ-LABEL: test_2f64toub:
2035 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2036 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2037 ; NOVLDQ-NEXT: vcvttpd2udq %zmm0, %ymm0
2038 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2039 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2040 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2041 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2042 ; NOVLDQ-NEXT: vzeroupper
2045 ; VLDQ-LABEL: test_2f64toub:
2047 ; VLDQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2048 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2049 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2050 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2053 ; VLNODQ-LABEL: test_2f64toub:
2055 ; VLNODQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2056 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2057 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2058 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2061 ; DQNOVL-LABEL: test_2f64toub:
2063 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2064 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2065 ; DQNOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
2066 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2067 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2068 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2069 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2070 ; DQNOVL-NEXT: vzeroupper
2072 %mask = fptoui <2 x double> %a to <2 x i1>
2073 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2074 ret <2 x i64> %select
2077 define <4 x i64> @test_4f64toub(<4 x double> %a, <4 x i64> %passthru) {
2078 ; NOVLDQ-LABEL: test_4f64toub:
2080 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2081 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2082 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2083 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2084 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2085 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2088 ; VLDQ-LABEL: test_4f64toub:
2090 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2091 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2092 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2093 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2096 ; VLNODQ-LABEL: test_4f64toub:
2098 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2099 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2100 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2101 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2104 ; DQNOVL-LABEL: test_4f64toub:
2106 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2107 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2108 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2109 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2110 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2111 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2113 %mask = fptoui <4 x double> %a to <4 x i1>
2114 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2115 ret <4 x i64> %select
2118 define <8 x i64> @test_8f64toub(<8 x double> %a, <8 x i64> %passthru) {
2119 ; NOVLDQ-LABEL: test_8f64toub:
2121 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2122 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2123 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2124 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2127 ; VLDQ-LABEL: test_8f64toub:
2129 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2130 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2131 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2132 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2135 ; VLNODQ-LABEL: test_8f64toub:
2137 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2138 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2139 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2140 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2143 ; DQNOVL-LABEL: test_8f64toub:
2145 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2146 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2147 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2148 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2150 %mask = fptoui <8 x double> %a to <8 x i1>
2151 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2152 ret <8 x i64> %select
2155 define <2 x i64> @test_2f32toub(<2 x float> %a, <2 x i64> %passthru) {
2156 ; NOVLDQ-LABEL: test_2f32toub:
2158 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2159 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2160 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2161 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2162 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2163 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2164 ; NOVLDQ-NEXT: vzeroupper
2167 ; VLDQ-LABEL: test_2f32toub:
2169 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2170 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2171 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2172 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2175 ; VLNODQ-LABEL: test_2f32toub:
2177 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2178 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2179 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2180 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2183 ; DQNOVL-LABEL: test_2f32toub:
2185 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2186 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2187 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2188 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2189 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2190 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2191 ; DQNOVL-NEXT: vzeroupper
2193 %mask = fptoui <2 x float> %a to <2 x i1>
2194 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2195 ret <2 x i64> %select
2198 define <4 x i64> @test_4f32toub(<4 x float> %a, <4 x i64> %passthru) {
2199 ; NOVLDQ-LABEL: test_4f32toub:
2201 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2202 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2203 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2204 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2205 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2206 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2209 ; VLDQ-LABEL: test_4f32toub:
2211 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2212 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2213 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2214 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2217 ; VLNODQ-LABEL: test_4f32toub:
2219 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2220 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2221 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2222 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2225 ; DQNOVL-LABEL: test_4f32toub:
2227 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2228 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2229 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2230 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2231 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2232 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2234 %mask = fptoui <4 x float> %a to <4 x i1>
2235 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2236 ret <4 x i64> %select
2239 define <8 x i64> @test_8f32toub(<8 x float> %a, <8 x i64> %passthru) {
2240 ; NOVLDQ-LABEL: test_8f32toub:
2242 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2243 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2244 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2245 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2248 ; VLDQ-LABEL: test_8f32toub:
2250 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2251 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2252 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2253 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2256 ; VLNODQ-LABEL: test_8f32toub:
2258 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2259 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2260 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2261 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2264 ; DQNOVL-LABEL: test_8f32toub:
2266 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2267 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2268 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2269 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2271 %mask = fptoui <8 x float> %a to <8 x i1>
2272 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2273 ret <8 x i64> %select
2276 define <16 x i32> @test_16f32toub(<16 x float> %a, <16 x i32> %passthru) {
2277 ; NODQ-LABEL: test_16f32toub:
2279 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2280 ; NODQ-NEXT: vpslld $31, %zmm0, %zmm0
2281 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2282 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2285 ; VLDQ-LABEL: test_16f32toub:
2287 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2288 ; VLDQ-NEXT: vpslld $31, %zmm0, %zmm0
2289 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2290 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2293 ; DQNOVL-LABEL: test_16f32toub:
2295 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2296 ; DQNOVL-NEXT: vpslld $31, %zmm0, %zmm0
2297 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2298 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2300 %mask = fptoui <16 x float> %a to <16 x i1>
2301 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2302 ret <16 x i32> %select
2305 define <2 x i64> @test_2f64tosb(<2 x double> %a, <2 x i64> %passthru) {
2306 ; NOVLDQ-LABEL: test_2f64tosb:
2308 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2309 ; NOVLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2310 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2311 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2312 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2313 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2314 ; NOVLDQ-NEXT: vzeroupper
2317 ; VLDQ-LABEL: test_2f64tosb:
2319 ; VLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2320 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2321 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2322 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2325 ; VLNODQ-LABEL: test_2f64tosb:
2327 ; VLNODQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2328 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2329 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2330 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2333 ; DQNOVL-LABEL: test_2f64tosb:
2335 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2336 ; DQNOVL-NEXT: vcvttpd2dq %xmm0, %xmm0
2337 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2338 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2339 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2340 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2341 ; DQNOVL-NEXT: vzeroupper
2343 %mask = fptosi <2 x double> %a to <2 x i1>
2344 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2345 ret <2 x i64> %select
2348 define <4 x i64> @test_4f64tosb(<4 x double> %a, <4 x i64> %passthru) {
2349 ; NOVLDQ-LABEL: test_4f64tosb:
2351 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2352 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2353 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2354 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2355 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2358 ; VLDQ-LABEL: test_4f64tosb:
2360 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2361 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2362 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2365 ; VLNODQ-LABEL: test_4f64tosb:
2367 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2368 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2369 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2372 ; DQNOVL-LABEL: test_4f64tosb:
2374 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2375 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2376 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2377 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2378 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2380 %mask = fptosi <4 x double> %a to <4 x i1>
2381 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2382 ret <4 x i64> %select
2385 define <8 x i64> @test_8f64tosb(<8 x double> %a, <8 x i64> %passthru) {
2386 ; NOVLDQ-LABEL: test_8f64tosb:
2388 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2389 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2390 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2393 ; VLDQ-LABEL: test_8f64tosb:
2395 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2396 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2397 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2400 ; VLNODQ-LABEL: test_8f64tosb:
2402 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2403 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2404 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2407 ; DQNOVL-LABEL: test_8f64tosb:
2409 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2410 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2411 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2413 %mask = fptosi <8 x double> %a to <8 x i1>
2414 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2415 ret <8 x i64> %select
2418 define <2 x i64> @test_2f32tosb(<2 x float> %a, <2 x i64> %passthru) {
2419 ; NOVLDQ-LABEL: test_2f32tosb:
2421 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 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 $xmm0 killed $xmm0 killed $zmm0
2426 ; NOVLDQ-NEXT: vzeroupper
2429 ; VLDQ-LABEL: test_2f32tosb:
2431 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2432 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2433 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2436 ; VLNODQ-LABEL: test_2f32tosb:
2438 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2439 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2440 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2443 ; DQNOVL-LABEL: test_2f32tosb:
2445 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2446 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2447 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2448 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2449 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2450 ; DQNOVL-NEXT: vzeroupper
2452 %mask = fptosi <2 x float> %a to <2 x i1>
2453 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2454 ret <2 x i64> %select
2457 define <4 x i64> @test_4f32tosb(<4 x float> %a, <4 x i64> %passthru) {
2458 ; NOVLDQ-LABEL: test_4f32tosb:
2460 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2461 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2462 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2463 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2464 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2467 ; VLDQ-LABEL: test_4f32tosb:
2469 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2470 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2471 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2474 ; VLNODQ-LABEL: test_4f32tosb:
2476 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2477 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2478 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2481 ; DQNOVL-LABEL: test_4f32tosb:
2483 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2484 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2485 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2486 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2487 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2489 %mask = fptosi <4 x float> %a to <4 x i1>
2490 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2491 ret <4 x i64> %select
2494 define <8 x i64> @test_8f32tosb(<8 x float> %a, <8 x i64> %passthru) {
2495 ; NOVLDQ-LABEL: test_8f32tosb:
2497 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2498 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2499 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2502 ; VLDQ-LABEL: test_8f32tosb:
2504 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2505 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2506 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2509 ; VLNODQ-LABEL: test_8f32tosb:
2511 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2512 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2513 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2516 ; DQNOVL-LABEL: test_8f32tosb:
2518 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2519 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2520 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2522 %mask = fptosi <8 x float> %a to <8 x i1>
2523 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2524 ret <8 x i64> %select
2527 define <16 x i32> @test_16f32tosb(<16 x float> %a, <16 x i32> %passthru) {
2528 ; NODQ-LABEL: test_16f32tosb:
2530 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2531 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2532 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2535 ; VLDQ-LABEL: test_16f32tosb:
2537 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2538 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2539 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2542 ; DQNOVL-LABEL: test_16f32tosb:
2544 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2545 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2546 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2548 %mask = fptosi <16 x float> %a to <16 x i1>
2549 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2550 ret <16 x i32> %select
2553 define <2 x double> @test_sito2f64_mask_load(ptr%a, <2 x i64> %c) {
2554 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2556 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2559 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2561 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2563 ; NOVLDQ-LABEL: test_sito2f64_mask_load:
2565 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2566 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2567 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2568 ; NOVLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0
2569 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2570 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2571 ; NOVLDQ-NEXT: vzeroupper
2574 ; VLDQ-LABEL: test_sito2f64_mask_load:
2576 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2577 ; VLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2580 ; VLNODQ-LABEL: test_sito2f64_mask_load:
2582 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2583 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2584 ; VLNODQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2587 ; DQNOVL-LABEL: test_sito2f64_mask_load:
2589 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2590 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2591 ; DQNOVL-NEXT: vcvtdq2pd (%rdi), %xmm0
2592 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2593 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2594 ; DQNOVL-NEXT: vzeroupper
2596 %mask = icmp slt <2 x i64> %c, zeroinitializer
2597 %ld = load <2 x i32>, ptr%a
2598 %cvt = sitofp <2 x i32> %ld to <2 x double>
2599 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2600 ret <2 x double> %sel
2603 define <2 x double> @test_uito2f64_mask_load(ptr%a, <2 x i64> %c) {
2604 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2606 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2609 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2611 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2613 ; NOVLDQ-LABEL: test_uito2f64_mask_load:
2615 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2616 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2617 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2618 ; NOVLDQ-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2619 ; NOVLDQ-NEXT: vcvtudq2pd %ymm0, %zmm0
2620 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2621 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2622 ; NOVLDQ-NEXT: vzeroupper
2625 ; VLDQ-LABEL: test_uito2f64_mask_load:
2627 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2628 ; VLDQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2631 ; VLNODQ-LABEL: test_uito2f64_mask_load:
2633 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2634 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2635 ; VLNODQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2638 ; DQNOVL-LABEL: test_uito2f64_mask_load:
2640 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2641 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2642 ; DQNOVL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2643 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
2644 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2645 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2646 ; DQNOVL-NEXT: vzeroupper
2648 %mask = icmp slt <2 x i64> %c, zeroinitializer
2649 %ld = load <2 x i32>, ptr%a
2650 %cvt = uitofp <2 x i32> %ld to <2 x double>
2651 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2652 ret <2 x double> %sel