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 <4 x float> @ulto4f32_nneg(<4 x i64> %a) {
316 ; NODQ-LABEL: ulto4f32_nneg:
318 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
319 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm1, %xmm1
320 ; NODQ-NEXT: vmovq %xmm0, %rax
321 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
322 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
323 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
324 ; NODQ-NEXT: vmovq %xmm0, %rax
325 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm2
326 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
327 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
328 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm0
329 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
330 ; NODQ-NEXT: vzeroupper
333 ; VLDQ-LABEL: ulto4f32_nneg:
335 ; VLDQ-NEXT: vcvtqq2ps %ymm0, %xmm0
336 ; VLDQ-NEXT: vzeroupper
339 ; DQNOVL-LABEL: ulto4f32_nneg:
341 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
342 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
343 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
344 ; DQNOVL-NEXT: vzeroupper
346 %b = uitofp nneg <4 x i64> %a to <4 x float>
350 define <8 x double> @ulto8f64(<8 x i64> %a) {
351 ; NODQ-LABEL: ulto8f64:
353 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm1 = [4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200]
354 ; NODQ-NEXT: vpternlogq {{.*#+}} zmm1 = zmm1 | (zmm0 & mem)
355 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
356 ; NODQ-NEXT: vporq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
357 ; NODQ-NEXT: vsubpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
358 ; NODQ-NEXT: vaddpd %zmm0, %zmm1, %zmm0
361 ; VLDQ-LABEL: ulto8f64:
363 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
366 ; DQNOVL-LABEL: ulto8f64:
368 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
370 %b = uitofp <8 x i64> %a to <8 x double>
374 define <16 x double> @ulto16f64(<16 x i64> %a) {
375 ; NODQ-LABEL: ulto16f64:
377 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295]
378 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm3 = [4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200,4841369599423283200]
379 ; NODQ-NEXT: vmovdqa64 %zmm3, %zmm4
380 ; NODQ-NEXT: vpternlogq {{.*#+}} zmm4 = zmm4 | (zmm0 & zmm2)
381 ; NODQ-NEXT: vpsrlq $32, %zmm0, %zmm0
382 ; NODQ-NEXT: vpbroadcastq {{.*#+}} zmm5 = [4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072,4985484787499139072]
383 ; NODQ-NEXT: vporq %zmm5, %zmm0, %zmm0
384 ; 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]
385 ; NODQ-NEXT: vsubpd %zmm6, %zmm0, %zmm0
386 ; NODQ-NEXT: vaddpd %zmm0, %zmm4, %zmm0
387 ; NODQ-NEXT: vpternlogq {{.*#+}} zmm3 = zmm3 | (zmm1 & zmm2)
388 ; NODQ-NEXT: vpsrlq $32, %zmm1, %zmm1
389 ; NODQ-NEXT: vporq %zmm5, %zmm1, %zmm1
390 ; NODQ-NEXT: vsubpd %zmm6, %zmm1, %zmm1
391 ; NODQ-NEXT: vaddpd %zmm1, %zmm3, %zmm1
394 ; VLDQ-LABEL: ulto16f64:
396 ; VLDQ-NEXT: vcvtuqq2pd %zmm0, %zmm0
397 ; VLDQ-NEXT: vcvtuqq2pd %zmm1, %zmm1
400 ; DQNOVL-LABEL: ulto16f64:
402 ; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
403 ; DQNOVL-NEXT: vcvtuqq2pd %zmm1, %zmm1
405 %b = uitofp <16 x i64> %a to <16 x double>
409 define <16 x i32> @f64to16si(<16 x float> %a) nounwind {
410 ; ALL-LABEL: f64to16si:
412 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
414 %b = fptosi <16 x float> %a to <16 x i32>
418 define <16 x i8> @f32to16sc(<16 x float> %f) {
419 ; ALL-LABEL: f32to16sc:
421 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
422 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
423 ; ALL-NEXT: vzeroupper
425 %res = fptosi <16 x float> %f to <16 x i8>
429 define <16 x i16> @f32to16ss(<16 x float> %f) {
430 ; ALL-LABEL: f32to16ss:
432 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
433 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
435 %res = fptosi <16 x float> %f to <16 x i16>
439 define <16 x i32> @f32to16ui(<16 x float> %a) nounwind {
440 ; ALL-LABEL: f32to16ui:
442 ; ALL-NEXT: vcvttps2udq %zmm0, %zmm0
444 %b = fptoui <16 x float> %a to <16 x i32>
448 define <16 x i8> @f32to16uc(<16 x float> %f) {
449 ; ALL-LABEL: f32to16uc:
451 ; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
452 ; ALL-NEXT: vpmovdb %zmm0, %xmm0
453 ; ALL-NEXT: vzeroupper
455 %res = fptoui <16 x float> %f to <16 x i8>
459 define <16 x i16> @f32to16us(<16 x float> %f) {
460 ; ALL-LABEL: f32to16us:
462 ; ALL-NEXT: vcvttps2udq %zmm0, %zmm0
463 ; ALL-NEXT: vpmovdw %zmm0, %ymm0
465 %res = fptoui <16 x float> %f to <16 x i16>
469 define <8 x i32> @f32to8ui(<8 x float> %a) nounwind {
470 ; NOVL-LABEL: f32to8ui:
472 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
473 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
474 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
477 ; VL-LABEL: f32to8ui:
479 ; VL-NEXT: vcvttps2udq %ymm0, %ymm0
481 %b = fptoui <8 x float> %a to <8 x i32>
485 define <4 x i32> @f32to4ui(<4 x float> %a) nounwind {
486 ; NOVL-LABEL: f32to4ui:
488 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
489 ; NOVL-NEXT: vcvttps2udq %zmm0, %zmm0
490 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
491 ; NOVL-NEXT: vzeroupper
494 ; VL-LABEL: f32to4ui:
496 ; VL-NEXT: vcvttps2udq %xmm0, %xmm0
498 %b = fptoui <4 x float> %a to <4 x i32>
502 define <8 x i32> @f64to8ui(<8 x double> %a) nounwind {
503 ; ALL-LABEL: f64to8ui:
505 ; ALL-NEXT: vcvttpd2udq %zmm0, %ymm0
507 %b = fptoui <8 x double> %a to <8 x i32>
511 define <8 x i16> @f64to8us(<8 x double> %f) {
512 ; NOVL-LABEL: f64to8us:
514 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
515 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
516 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
517 ; NOVL-NEXT: vzeroupper
520 ; VL-LABEL: f64to8us:
522 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
523 ; VL-NEXT: vpmovdw %ymm0, %xmm0
524 ; VL-NEXT: vzeroupper
526 %res = fptoui <8 x double> %f to <8 x i16>
530 define <8 x i8> @f64to8uc(<8 x double> %f) {
531 ; NOVL-LABEL: f64to8uc:
533 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
534 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
535 ; NOVL-NEXT: vzeroupper
538 ; VL-LABEL: f64to8uc:
540 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
541 ; VL-NEXT: vpmovdb %ymm0, %xmm0
542 ; VL-NEXT: vzeroupper
544 %res = fptoui <8 x double> %f to <8 x i8>
548 define <4 x i32> @f64to4ui(<4 x double> %a) nounwind {
549 ; NOVL-LABEL: f64to4ui:
551 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
552 ; NOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
553 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
554 ; NOVL-NEXT: vzeroupper
557 ; VL-LABEL: f64to4ui:
559 ; VL-NEXT: vcvttpd2udq %ymm0, %xmm0
560 ; VL-NEXT: vzeroupper
562 %b = fptoui <4 x double> %a to <4 x i32>
566 define <8 x double> @sito8f64(<8 x i32> %a) {
567 ; ALL-LABEL: sito8f64:
569 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
571 %b = sitofp <8 x i32> %a to <8 x double>
574 define <8 x double> @i32to8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
575 ; KNL-LABEL: i32to8f64_mask:
577 ; KNL-NEXT: kmovw %edi, %k1
578 ; KNL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
581 ; VLBW-LABEL: i32to8f64_mask:
583 ; VLBW-NEXT: kmovd %edi, %k1
584 ; VLBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
587 ; VLNOBW-LABEL: i32to8f64_mask:
589 ; VLNOBW-NEXT: kmovw %edi, %k1
590 ; VLNOBW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
593 ; DQNOVL-LABEL: i32to8f64_mask:
595 ; DQNOVL-NEXT: kmovw %edi, %k1
596 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
599 ; AVX512BW-LABEL: i32to8f64_mask:
601 ; AVX512BW-NEXT: kmovd %edi, %k1
602 ; AVX512BW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
603 ; AVX512BW-NEXT: retq
604 %1 = bitcast i8 %c to <8 x i1>
605 %2 = sitofp <8 x i32> %b to <8 x double>
606 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
609 define <8 x double> @sito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
610 ; KNL-LABEL: sito8f64_maskz:
612 ; KNL-NEXT: kmovw %edi, %k1
613 ; KNL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
616 ; VLBW-LABEL: sito8f64_maskz:
618 ; VLBW-NEXT: kmovd %edi, %k1
619 ; VLBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
622 ; VLNOBW-LABEL: sito8f64_maskz:
624 ; VLNOBW-NEXT: kmovw %edi, %k1
625 ; VLNOBW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
628 ; DQNOVL-LABEL: sito8f64_maskz:
630 ; DQNOVL-NEXT: kmovw %edi, %k1
631 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
634 ; AVX512BW-LABEL: sito8f64_maskz:
636 ; AVX512BW-NEXT: kmovd %edi, %k1
637 ; AVX512BW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
638 ; AVX512BW-NEXT: retq
639 %1 = bitcast i8 %b to <8 x i1>
640 %2 = sitofp <8 x i32> %a to <8 x double>
641 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
645 define <8 x i32> @f64to8si(<8 x double> %a) {
646 ; ALL-LABEL: f64to8si:
648 ; ALL-NEXT: vcvttpd2dq %zmm0, %ymm0
650 %b = fptosi <8 x double> %a to <8 x i32>
654 define <8 x i16> @f64to8ss(<8 x double> %f) {
655 ; NOVL-LABEL: f64to8ss:
657 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
658 ; NOVL-NEXT: vpmovdw %zmm0, %ymm0
659 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
660 ; NOVL-NEXT: vzeroupper
663 ; VL-LABEL: f64to8ss:
665 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
666 ; VL-NEXT: vpmovdw %ymm0, %xmm0
667 ; VL-NEXT: vzeroupper
669 %res = fptosi <8 x double> %f to <8 x i16>
673 define <8 x i8> @f64to8sc(<8 x double> %f) {
674 ; NOVL-LABEL: f64to8sc:
676 ; NOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
677 ; NOVL-NEXT: vpmovdb %zmm0, %xmm0
678 ; NOVL-NEXT: vzeroupper
681 ; VL-LABEL: f64to8sc:
683 ; VL-NEXT: vcvttpd2dq %zmm0, %ymm0
684 ; VL-NEXT: vpmovdb %ymm0, %xmm0
685 ; VL-NEXT: vzeroupper
687 %res = fptosi <8 x double> %f to <8 x i8>
691 define <4 x i32> @f64to4si(<4 x double> %a) {
692 ; ALL-LABEL: f64to4si:
694 ; ALL-NEXT: vcvttpd2dq %ymm0, %xmm0
695 ; ALL-NEXT: vzeroupper
697 %b = fptosi <4 x double> %a to <4 x i32>
701 define <16 x float> @f64to16f32(<16 x double> %b) nounwind {
702 ; ALL-LABEL: f64to16f32:
704 ; ALL-NEXT: vcvtpd2ps %zmm0, %ymm0
705 ; ALL-NEXT: vcvtpd2ps %zmm1, %ymm1
706 ; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
708 %a = fptrunc <16 x double> %b to <16 x float>
712 define <4 x float> @f64to4f32(<4 x double> %b) {
713 ; ALL-LABEL: f64to4f32:
715 ; ALL-NEXT: vcvtpd2ps %ymm0, %xmm0
716 ; ALL-NEXT: vzeroupper
718 %a = fptrunc <4 x double> %b to <4 x float>
722 define <4 x float> @f64to4f32_mask(<4 x double> %b, <4 x i1> %mask) {
723 ; NOVLDQ-LABEL: f64to4f32_mask:
725 ; NOVLDQ-NEXT: vpslld $31, %xmm1, %xmm1
726 ; NOVLDQ-NEXT: vptestmd %zmm1, %zmm1, %k1
727 ; NOVLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0
728 ; NOVLDQ-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
729 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
730 ; NOVLDQ-NEXT: vzeroupper
733 ; VLDQ-LABEL: f64to4f32_mask:
735 ; VLDQ-NEXT: vpslld $31, %xmm1, %xmm1
736 ; VLDQ-NEXT: vpmovd2m %xmm1, %k1
737 ; VLDQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
738 ; VLDQ-NEXT: vzeroupper
741 ; VLNODQ-LABEL: f64to4f32_mask:
743 ; VLNODQ-NEXT: vpslld $31, %xmm1, %xmm1
744 ; VLNODQ-NEXT: vptestmd %xmm1, %xmm1, %k1
745 ; VLNODQ-NEXT: vcvtpd2ps %ymm0, %xmm0 {%k1} {z}
746 ; VLNODQ-NEXT: vzeroupper
749 ; DQNOVL-LABEL: f64to4f32_mask:
751 ; DQNOVL-NEXT: vpslld $31, %xmm1, %xmm1
752 ; DQNOVL-NEXT: vpmovd2m %zmm1, %k1
753 ; DQNOVL-NEXT: vcvtpd2ps %ymm0, %xmm0
754 ; DQNOVL-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
755 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
756 ; DQNOVL-NEXT: vzeroupper
758 %a = fptrunc <4 x double> %b to <4 x float>
759 %c = select <4 x i1>%mask, <4 x float>%a, <4 x float> zeroinitializer
763 define <4 x float> @f64tof32_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
764 ; ALL-LABEL: f64tof32_inreg:
766 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm1, %xmm0
768 %ext = extractelement <2 x double> %a0, i32 0
769 %cvt = fptrunc double %ext to float
770 %res = insertelement <4 x float> %a1, float %cvt, i32 0
774 define <8 x double> @f32to8f64(<8 x float> %b) nounwind {
775 ; ALL-LABEL: f32to8f64:
777 ; ALL-NEXT: vcvtps2pd %ymm0, %zmm0
779 %a = fpext <8 x float> %b to <8 x double>
783 define <4 x double> @f32to4f64_mask(<4 x float> %b, <4 x double> %b1, <4 x double> %a1) {
784 ; NOVL-LABEL: f32to4f64_mask:
786 ; NOVL-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
787 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
788 ; NOVL-NEXT: vcvtps2pd %xmm0, %ymm0
789 ; NOVL-NEXT: vcmpltpd %zmm2, %zmm1, %k1
790 ; NOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
791 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
794 ; VL-LABEL: f32to4f64_mask:
796 ; VL-NEXT: vcmpltpd %ymm2, %ymm1, %k1
797 ; VL-NEXT: vcvtps2pd %xmm0, %ymm0 {%k1} {z}
799 %a = fpext <4 x float> %b to <4 x double>
800 %mask = fcmp ogt <4 x double> %a1, %b1
801 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
805 define <4 x double> @f32to4f64_mask_load(ptr %p, <4 x double> %b1, <4 x double> %a1, <4 x double> %passthru) {
806 ; NOVL-LABEL: f32to4f64_mask_load:
808 ; NOVL-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
809 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
810 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
811 ; NOVL-NEXT: vcvtps2pd (%rdi), %ymm3
812 ; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
813 ; NOVL-NEXT: vblendmpd %zmm3, %zmm2, %zmm0 {%k1}
814 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
817 ; VL-LABEL: f32to4f64_mask_load:
819 ; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
820 ; VL-NEXT: vcvtps2pd (%rdi), %ymm2 {%k1}
821 ; VL-NEXT: vmovaps %ymm2, %ymm0
823 %b = load <4 x float>, ptr %p
824 %a = fpext <4 x float> %b to <4 x double>
825 %mask = fcmp ogt <4 x double> %a1, %b1
826 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> %passthru
830 define <4 x double> @f32to4f64_maskz_load(ptr %p, <4 x double> %b1, <4 x double> %a1) {
831 ; NOVL-LABEL: f32to4f64_maskz_load:
833 ; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
834 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
835 ; NOVL-NEXT: vcvtps2pd (%rdi), %ymm2
836 ; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
837 ; NOVL-NEXT: vmovapd %zmm2, %zmm0 {%k1} {z}
838 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
841 ; VL-LABEL: f32to4f64_maskz_load:
843 ; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
844 ; VL-NEXT: vcvtps2pd (%rdi), %ymm0 {%k1} {z}
846 %b = load <4 x float>, ptr %p
847 %a = fpext <4 x float> %b to <4 x double>
848 %mask = fcmp ogt <4 x double> %a1, %b1
849 %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
853 define <2 x double> @f32tof64_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
854 ; ALL-LABEL: f32tof64_inreg:
856 ; ALL-NEXT: vcvtss2sd %xmm1, %xmm0, %xmm0
858 %ext = extractelement <4 x float> %a1, i32 0
859 %cvt = fpext float %ext to double
860 %res = insertelement <2 x double> %a0, double %cvt, i32 0
861 ret <2 x double> %res
864 define double @sltof64_load(ptr nocapture %e) {
865 ; ALL-LABEL: sltof64_load:
866 ; ALL: # %bb.0: # %entry
867 ; ALL-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
870 %tmp1 = load i64, ptr %e, align 8
871 %conv = sitofp i64 %tmp1 to double
875 define double @sitof64_load(ptr %e) {
876 ; ALL-LABEL: sitof64_load:
877 ; ALL: # %bb.0: # %entry
878 ; ALL-NEXT: vcvtsi2sdl (%rdi), %xmm0, %xmm0
881 %tmp1 = load i32, ptr %e, align 4
882 %conv = sitofp i32 %tmp1 to double
886 define float @sitof32_load(ptr %e) {
887 ; ALL-LABEL: sitof32_load:
888 ; ALL: # %bb.0: # %entry
889 ; ALL-NEXT: vcvtsi2ssl (%rdi), %xmm0, %xmm0
892 %tmp1 = load i32, ptr %e, align 4
893 %conv = sitofp i32 %tmp1 to float
897 define float @sltof32_load(ptr %e) {
898 ; ALL-LABEL: sltof32_load:
899 ; ALL: # %bb.0: # %entry
900 ; ALL-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
903 %tmp1 = load i64, ptr %e, align 8
904 %conv = sitofp i64 %tmp1 to float
908 define void @f32tof64_loadstore() {
909 ; ALL-LABEL: f32tof64_loadstore:
910 ; ALL: # %bb.0: # %entry
911 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
912 ; ALL-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
913 ; ALL-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp)
916 %f = alloca float, align 4
917 %d = alloca double, align 8
918 %tmp = load float, ptr %f, align 4
919 %conv = fpext float %tmp to double
920 store double %conv, ptr %d, align 8
924 define void @f64tof32_loadstore() nounwind uwtable {
925 ; ALL-LABEL: f64tof32_loadstore:
926 ; ALL: # %bb.0: # %entry
927 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
928 ; ALL-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
929 ; ALL-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp)
932 %f = alloca float, align 4
933 %d = alloca double, align 8
934 %tmp = load double, ptr %d, align 8
935 %conv = fptrunc double %tmp to float
936 store float %conv, ptr %f, align 4
940 define double @long_to_double(i64 %x) {
941 ; ALL-LABEL: long_to_double:
943 ; ALL-NEXT: vmovq %rdi, %xmm0
945 %res = bitcast i64 %x to double
949 define i64 @double_to_long(double %x) {
950 ; ALL-LABEL: double_to_long:
952 ; ALL-NEXT: vmovq %xmm0, %rax
954 %res = bitcast double %x to i64
958 define float @int_to_float(i32 %x) {
959 ; ALL-LABEL: int_to_float:
961 ; ALL-NEXT: vmovd %edi, %xmm0
963 %res = bitcast i32 %x to float
967 define i32 @float_to_int(float %x) {
968 ; ALL-LABEL: float_to_int:
970 ; ALL-NEXT: vmovd %xmm0, %eax
972 %res = bitcast float %x to i32
976 define <16 x double> @uito16f64(<16 x i32> %a) nounwind {
977 ; ALL-LABEL: uito16f64:
979 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm2
980 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
981 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm1
982 ; ALL-NEXT: vmovaps %zmm2, %zmm0
984 %b = uitofp <16 x i32> %a to <16 x double>
988 define <8 x float> @slto8f32(<8 x i64> %a) {
989 ; NODQ-LABEL: slto8f32:
991 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
992 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
993 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm2, %xmm2
994 ; NODQ-NEXT: vmovq %xmm1, %rax
995 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm1
996 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
997 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
998 ; NODQ-NEXT: vmovq %xmm2, %rax
999 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
1000 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
1001 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1002 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
1003 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
1004 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1005 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
1006 ; NODQ-NEXT: vmovq %xmm0, %rax
1007 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
1008 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
1009 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1010 ; NODQ-NEXT: vmovq %xmm0, %rax
1011 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm3
1012 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
1013 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1014 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm0
1015 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
1016 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1019 ; VLDQ-LABEL: slto8f32:
1021 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
1024 ; DQNOVL-LABEL: slto8f32:
1026 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
1028 %b = sitofp <8 x i64> %a to <8 x float>
1032 define <16 x float> @slto16f32(<16 x i64> %a) {
1033 ; NODQ-LABEL: slto16f32:
1035 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1036 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1037 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm3, %xmm3
1038 ; NODQ-NEXT: vmovq %xmm2, %rax
1039 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm2
1040 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1041 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1042 ; NODQ-NEXT: vmovq %xmm3, %rax
1043 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm4, %xmm4
1044 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1045 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1046 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1047 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1048 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1049 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1050 ; NODQ-NEXT: vmovq %xmm1, %rax
1051 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1052 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1053 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1054 ; NODQ-NEXT: vmovq %xmm1, %rax
1055 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1056 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1057 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1058 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm1
1059 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1060 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1061 ; NODQ-NEXT: vextractf32x4 $2, %zmm0, %xmm2
1062 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1063 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1064 ; NODQ-NEXT: vmovq %xmm2, %rax
1065 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm2
1066 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1067 ; NODQ-NEXT: vextractf32x4 $3, %zmm0, %xmm3
1068 ; NODQ-NEXT: vmovq %xmm3, %rax
1069 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1070 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1071 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1072 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1073 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1074 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1075 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm3
1076 ; NODQ-NEXT: vmovq %xmm0, %rax
1077 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1078 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1079 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1080 ; NODQ-NEXT: vmovq %xmm0, %rax
1081 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm4
1082 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1083 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1084 ; NODQ-NEXT: vcvtsi2ss %rax, %xmm5, %xmm0
1085 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1086 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1087 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1090 ; VLDQ-LABEL: slto16f32:
1092 ; VLDQ-NEXT: vcvtqq2ps %zmm0, %ymm0
1093 ; VLDQ-NEXT: vcvtqq2ps %zmm1, %ymm1
1094 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1097 ; DQNOVL-LABEL: slto16f32:
1099 ; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
1100 ; DQNOVL-NEXT: vcvtqq2ps %zmm1, %ymm1
1101 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1103 %b = sitofp <16 x i64> %a to <16 x float>
1107 define <8 x double> @slto8f64(<8 x i64> %a) {
1108 ; NODQ-LABEL: slto8f64:
1110 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm1
1111 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1112 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm2, %xmm2
1113 ; NODQ-NEXT: vmovq %xmm1, %rax
1114 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm1
1115 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm1 = xmm1[0],xmm2[0]
1116 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm2
1117 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1118 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1119 ; NODQ-NEXT: vmovq %xmm2, %rax
1120 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1121 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1122 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
1123 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm2
1124 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1125 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1126 ; NODQ-NEXT: vmovq %xmm2, %rax
1127 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1128 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1129 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1130 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm3
1131 ; NODQ-NEXT: vmovq %xmm0, %rax
1132 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm0
1133 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm0 = xmm0[0],xmm3[0]
1134 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1135 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1138 ; VLDQ-LABEL: slto8f64:
1140 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1143 ; DQNOVL-LABEL: slto8f64:
1145 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1147 %b = sitofp <8 x i64> %a to <8 x double>
1151 define <16 x double> @slto16f64(<16 x i64> %a) {
1152 ; NODQ-LABEL: slto16f64:
1154 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1155 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1156 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm3, %xmm3
1157 ; NODQ-NEXT: vmovq %xmm2, %rax
1158 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm2
1159 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1160 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm3
1161 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1162 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm4, %xmm4
1163 ; NODQ-NEXT: vmovq %xmm3, %rax
1164 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1165 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1166 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1167 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm3
1168 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1169 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1170 ; NODQ-NEXT: vmovq %xmm3, %rax
1171 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1172 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1173 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1174 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1175 ; NODQ-NEXT: vmovq %xmm0, %rax
1176 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm0
1177 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm0 = xmm0[0],xmm4[0]
1178 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0
1179 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
1180 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm2
1181 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1182 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1183 ; NODQ-NEXT: vmovq %xmm2, %rax
1184 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm2
1185 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm2 = xmm2[0],xmm3[0]
1186 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm3
1187 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1188 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1189 ; NODQ-NEXT: vmovq %xmm3, %rax
1190 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1191 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1192 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1193 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm3
1194 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1195 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1196 ; NODQ-NEXT: vmovq %xmm3, %rax
1197 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm3
1198 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm3 = xmm3[0],xmm4[0]
1199 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1200 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm4
1201 ; NODQ-NEXT: vmovq %xmm1, %rax
1202 ; NODQ-NEXT: vcvtsi2sd %rax, %xmm5, %xmm1
1203 ; NODQ-NEXT: vunpcklpd {{.*#+}} xmm1 = xmm1[0],xmm4[0]
1204 ; NODQ-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1
1205 ; NODQ-NEXT: vinsertf64x4 $1, %ymm2, %zmm1, %zmm1
1208 ; VLDQ-LABEL: slto16f64:
1210 ; VLDQ-NEXT: vcvtqq2pd %zmm0, %zmm0
1211 ; VLDQ-NEXT: vcvtqq2pd %zmm1, %zmm1
1214 ; DQNOVL-LABEL: slto16f64:
1216 ; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
1217 ; DQNOVL-NEXT: vcvtqq2pd %zmm1, %zmm1
1219 %b = sitofp <16 x i64> %a to <16 x double>
1220 ret <16 x double> %b
1223 define <8 x float> @ulto8f32(<8 x i64> %a) {
1224 ; NODQ-LABEL: ulto8f32:
1226 ; NODQ-NEXT: vextracti32x4 $2, %zmm0, %xmm1
1227 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1228 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm2, %xmm2
1229 ; NODQ-NEXT: vmovq %xmm1, %rax
1230 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm1
1231 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
1232 ; NODQ-NEXT: vextracti32x4 $3, %zmm0, %xmm2
1233 ; NODQ-NEXT: vmovq %xmm2, %rax
1234 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1235 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
1236 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1237 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1238 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
1239 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1240 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1241 ; NODQ-NEXT: vmovq %xmm0, %rax
1242 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1243 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
1244 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1245 ; NODQ-NEXT: vmovq %xmm0, %rax
1246 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm3
1247 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
1248 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1249 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm0
1250 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
1251 ; NODQ-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1254 ; VLDQ-LABEL: ulto8f32:
1256 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1259 ; DQNOVL-LABEL: ulto8f32:
1261 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1263 %b = uitofp <8 x i64> %a to <8 x float>
1267 define <16 x float> @ulto16f32(<16 x i64> %a) {
1268 ; NODQ-LABEL: ulto16f32:
1270 ; NODQ-NEXT: vextracti32x4 $2, %zmm1, %xmm2
1271 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1272 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm3, %xmm3
1273 ; NODQ-NEXT: vmovq %xmm2, %rax
1274 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm2
1275 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1276 ; NODQ-NEXT: vextracti32x4 $3, %zmm1, %xmm3
1277 ; NODQ-NEXT: vmovq %xmm3, %rax
1278 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm4, %xmm4
1279 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1280 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1281 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1282 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1283 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1284 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1285 ; NODQ-NEXT: vmovq %xmm1, %rax
1286 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1287 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1288 ; NODQ-NEXT: vextracti128 $1, %ymm1, %xmm1
1289 ; NODQ-NEXT: vmovq %xmm1, %rax
1290 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1291 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1292 ; NODQ-NEXT: vpextrq $1, %xmm1, %rax
1293 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm1
1294 ; NODQ-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
1295 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
1296 ; NODQ-NEXT: vextractf32x4 $2, %zmm0, %xmm2
1297 ; NODQ-NEXT: vpextrq $1, %xmm2, %rax
1298 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1299 ; NODQ-NEXT: vmovq %xmm2, %rax
1300 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm2
1301 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
1302 ; NODQ-NEXT: vextractf32x4 $3, %zmm0, %xmm3
1303 ; NODQ-NEXT: vmovq %xmm3, %rax
1304 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1305 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
1306 ; NODQ-NEXT: vpextrq $1, %xmm3, %rax
1307 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1308 ; NODQ-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
1309 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1310 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm3
1311 ; NODQ-NEXT: vmovq %xmm0, %rax
1312 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1313 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
1314 ; NODQ-NEXT: vextracti128 $1, %ymm0, %xmm0
1315 ; NODQ-NEXT: vmovq %xmm0, %rax
1316 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm4
1317 ; NODQ-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
1318 ; NODQ-NEXT: vpextrq $1, %xmm0, %rax
1319 ; NODQ-NEXT: vcvtusi2ss %rax, %xmm5, %xmm0
1320 ; NODQ-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
1321 ; NODQ-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1322 ; NODQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1325 ; VLDQ-LABEL: ulto16f32:
1327 ; VLDQ-NEXT: vcvtuqq2ps %zmm0, %ymm0
1328 ; VLDQ-NEXT: vcvtuqq2ps %zmm1, %ymm1
1329 ; VLDQ-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1332 ; DQNOVL-LABEL: ulto16f32:
1334 ; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
1335 ; DQNOVL-NEXT: vcvtuqq2ps %zmm1, %ymm1
1336 ; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1338 %b = uitofp <16 x i64> %a to <16 x float>
1342 define <8 x double> @uito8f64_mask(<8 x double> %a, <8 x i32> %b, i8 %c) nounwind {
1343 ; KNL-LABEL: uito8f64_mask:
1345 ; KNL-NEXT: kmovw %edi, %k1
1346 ; KNL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1349 ; VLBW-LABEL: uito8f64_mask:
1351 ; VLBW-NEXT: kmovd %edi, %k1
1352 ; VLBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1355 ; VLNOBW-LABEL: uito8f64_mask:
1357 ; VLNOBW-NEXT: kmovw %edi, %k1
1358 ; VLNOBW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1361 ; DQNOVL-LABEL: uito8f64_mask:
1363 ; DQNOVL-NEXT: kmovw %edi, %k1
1364 ; DQNOVL-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1367 ; AVX512BW-LABEL: uito8f64_mask:
1368 ; AVX512BW: # %bb.0:
1369 ; AVX512BW-NEXT: kmovd %edi, %k1
1370 ; AVX512BW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
1371 ; AVX512BW-NEXT: retq
1372 %1 = bitcast i8 %c to <8 x i1>
1373 %2 = uitofp <8 x i32> %b to <8 x double>
1374 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
1377 define <8 x double> @uito8f64_maskz(<8 x i32> %a, i8 %b) nounwind {
1378 ; KNL-LABEL: uito8f64_maskz:
1380 ; KNL-NEXT: kmovw %edi, %k1
1381 ; KNL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1384 ; VLBW-LABEL: uito8f64_maskz:
1386 ; VLBW-NEXT: kmovd %edi, %k1
1387 ; VLBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1390 ; VLNOBW-LABEL: uito8f64_maskz:
1392 ; VLNOBW-NEXT: kmovw %edi, %k1
1393 ; VLNOBW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1396 ; DQNOVL-LABEL: uito8f64_maskz:
1398 ; DQNOVL-NEXT: kmovw %edi, %k1
1399 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1402 ; AVX512BW-LABEL: uito8f64_maskz:
1403 ; AVX512BW: # %bb.0:
1404 ; AVX512BW-NEXT: kmovd %edi, %k1
1405 ; AVX512BW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
1406 ; AVX512BW-NEXT: retq
1407 %1 = bitcast i8 %b to <8 x i1>
1408 %2 = uitofp <8 x i32> %a to <8 x double>
1409 %3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
1413 define <4 x double> @uito4f64(<4 x i32> %a) nounwind {
1414 ; NOVL-LABEL: uito4f64:
1416 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1417 ; NOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
1418 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1421 ; VL-LABEL: uito4f64:
1423 ; VL-NEXT: vcvtudq2pd %xmm0, %ymm0
1425 %b = uitofp <4 x i32> %a to <4 x double>
1429 define <16 x float> @uito16f32(<16 x i32> %a) nounwind {
1430 ; ALL-LABEL: uito16f32:
1432 ; ALL-NEXT: vcvtudq2ps %zmm0, %zmm0
1434 %b = uitofp <16 x i32> %a to <16 x float>
1438 define <8 x double> @uito8f64(<8 x i32> %a) {
1439 ; ALL-LABEL: uito8f64:
1441 ; ALL-NEXT: vcvtudq2pd %ymm0, %zmm0
1443 %b = uitofp <8 x i32> %a to <8 x double>
1447 define <8 x float> @uito8f32(<8 x i32> %a) nounwind {
1448 ; NOVL-LABEL: uito8f32:
1450 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1451 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1452 ; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1455 ; VL-LABEL: uito8f32:
1457 ; VL-NEXT: vcvtudq2ps %ymm0, %ymm0
1459 %b = uitofp <8 x i32> %a to <8 x float>
1463 define <4 x float> @uito4f32(<4 x i32> %a) nounwind {
1464 ; NOVL-LABEL: uito4f32:
1466 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1467 ; NOVL-NEXT: vcvtudq2ps %zmm0, %zmm0
1468 ; NOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1469 ; NOVL-NEXT: vzeroupper
1472 ; VL-LABEL: uito4f32:
1474 ; VL-NEXT: vcvtudq2ps %xmm0, %xmm0
1476 %b = uitofp <4 x i32> %a to <4 x float>
1480 define i32 @fptosi(float %a) nounwind {
1481 ; ALL-LABEL: fptosi:
1483 ; ALL-NEXT: vcvttss2si %xmm0, %eax
1485 %b = fptosi float %a to i32
1489 define i32 @fptoui(float %a) nounwind {
1490 ; ALL-LABEL: fptoui:
1492 ; ALL-NEXT: vcvttss2usi %xmm0, %eax
1494 %b = fptoui float %a to i32
1498 define float @uitof32(i32 %a) nounwind {
1499 ; ALL-LABEL: uitof32:
1501 ; ALL-NEXT: vcvtusi2ss %edi, %xmm0, %xmm0
1503 %b = uitofp i32 %a to float
1507 define double @uitof64(i32 %a) nounwind {
1508 ; ALL-LABEL: uitof64:
1510 ; ALL-NEXT: vcvtusi2sd %edi, %xmm0, %xmm0
1512 %b = uitofp i32 %a to double
1516 define <16 x float> @sbto16f32(<16 x i32> %a) {
1517 ; NODQ-LABEL: sbto16f32:
1519 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1520 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1521 ; NODQ-NEXT: vpternlogd {{.*#+}} zmm0 {%k1} {z} = -1
1522 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1525 ; VLDQ-LABEL: sbto16f32:
1527 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1528 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1529 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1532 ; DQNOVL-LABEL: sbto16f32:
1534 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1535 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1536 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1538 %mask = icmp slt <16 x i32> %a, zeroinitializer
1539 %1 = sitofp <16 x i1> %mask to <16 x float>
1543 define <16 x float> @scto16f32(<16 x i8> %a) {
1544 ; ALL-LABEL: scto16f32:
1546 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm0
1547 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1549 %1 = sitofp <16 x i8> %a to <16 x float>
1553 define <16 x float> @ssto16f32(<16 x i16> %a) {
1554 ; ALL-LABEL: ssto16f32:
1556 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1557 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1559 %1 = sitofp <16 x i16> %a to <16 x float>
1563 define <8 x double> @ssto16f64(<8 x i16> %a) {
1564 ; ALL-LABEL: ssto16f64:
1566 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1567 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1569 %1 = sitofp <8 x i16> %a to <8 x double>
1573 define <8 x double> @scto8f64(<8 x i8> %a) {
1574 ; ALL-LABEL: scto8f64:
1576 ; ALL-NEXT: vpmovsxbd %xmm0, %ymm0
1577 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1579 %1 = sitofp <8 x i8> %a to <8 x double>
1583 define <16 x double> @scto16f64(<16 x i8> %a) {
1584 ; ALL-LABEL: scto16f64:
1586 ; ALL-NEXT: vpmovsxbd %xmm0, %zmm1
1587 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1588 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1589 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1591 %b = sitofp <16 x i8> %a to <16 x double>
1592 ret <16 x double> %b
1595 define <16 x double> @sbto16f64(<16 x double> %a) {
1596 ; NODQ-LABEL: sbto16f64:
1598 ; NODQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1599 ; NODQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1600 ; NODQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1601 ; NODQ-NEXT: kunpckbw %k0, %k1, %k1
1602 ; NODQ-NEXT: vpternlogd {{.*#+}} zmm1 {%k1} {z} = -1
1603 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1604 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1605 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1608 ; VLDQ-LABEL: sbto16f64:
1610 ; VLDQ-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1611 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1612 ; VLDQ-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1613 ; VLDQ-NEXT: kunpckbw %k0, %k1, %k0
1614 ; VLDQ-NEXT: vpmovm2d %k0, %zmm1
1615 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1616 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1617 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1620 ; DQNOVL-LABEL: sbto16f64:
1622 ; DQNOVL-NEXT: vxorpd %xmm2, %xmm2, %xmm2
1623 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm2, %k0
1624 ; DQNOVL-NEXT: vcmpltpd %zmm1, %zmm2, %k1
1625 ; DQNOVL-NEXT: kunpckbw %k0, %k1, %k0
1626 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm1
1627 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1628 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1629 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1631 %cmpres = fcmp ogt <16 x double> %a, zeroinitializer
1632 %1 = sitofp <16 x i1> %cmpres to <16 x double>
1633 ret <16 x double> %1
1636 define <8 x double> @sbto8f64(<8 x double> %a) {
1637 ; NOVLDQ-LABEL: sbto8f64:
1639 ; NOVLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1640 ; NOVLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1641 ; NOVLDQ-NEXT: vpternlogd {{.*#+}} zmm0 {%k1} {z} = -1
1642 ; NOVLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1645 ; VLDQ-LABEL: sbto8f64:
1647 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1648 ; VLDQ-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1649 ; VLDQ-NEXT: vpmovm2d %k0, %ymm0
1650 ; VLDQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1653 ; VLNODQ-LABEL: sbto8f64:
1655 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1656 ; VLNODQ-NEXT: vcmpltpd %zmm0, %zmm1, %k1
1657 ; VLNODQ-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
1658 ; VLNODQ-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
1659 ; VLNODQ-NEXT: vcvtdq2pd %ymm0, %zmm0
1662 ; DQNOVL-LABEL: sbto8f64:
1664 ; DQNOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1665 ; DQNOVL-NEXT: vcmpltpd %zmm0, %zmm1, %k0
1666 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1667 ; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0
1669 %cmpres = fcmp ogt <8 x double> %a, zeroinitializer
1670 %1 = sitofp <8 x i1> %cmpres to <8 x double>
1674 define <8 x float> @sbto8f32(<8 x float> %a) {
1675 ; ALL-LABEL: sbto8f32:
1677 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1678 ; ALL-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
1679 ; ALL-NEXT: vcvtdq2ps %ymm0, %ymm0
1681 %cmpres = fcmp ogt <8 x float> %a, zeroinitializer
1682 %1 = sitofp <8 x i1> %cmpres to <8 x float>
1686 define <4 x float> @sbto4f32(<4 x float> %a) {
1687 ; ALL-LABEL: sbto4f32:
1689 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1690 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1691 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1693 %cmpres = fcmp ogt <4 x float> %a, zeroinitializer
1694 %1 = sitofp <4 x i1> %cmpres to <4 x float>
1698 define <4 x double> @sbto4f64(<4 x double> %a) {
1699 ; NOVL-LABEL: sbto4f64:
1701 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1702 ; NOVL-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0
1703 ; NOVL-NEXT: vpmovqd %zmm0, %ymm0
1704 ; NOVL-NEXT: vcvtdq2pd %xmm0, %ymm0
1707 ; VLDQ-LABEL: sbto4f64:
1709 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1710 ; VLDQ-NEXT: vcmpltpd %ymm0, %ymm1, %k0
1711 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1712 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1715 ; VLNODQ-LABEL: sbto4f64:
1717 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1718 ; VLNODQ-NEXT: vcmpltpd %ymm0, %ymm1, %k1
1719 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1720 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1721 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %ymm0
1723 %cmpres = fcmp ogt <4 x double> %a, zeroinitializer
1724 %1 = sitofp <4 x i1> %cmpres to <4 x double>
1728 define <2 x float> @sbto2f32(<2 x float> %a) {
1729 ; ALL-LABEL: sbto2f32:
1731 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1732 ; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
1733 ; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
1735 %cmpres = fcmp ogt <2 x float> %a, zeroinitializer
1736 %1 = sitofp <2 x i1> %cmpres to <2 x float>
1740 define <2 x double> @sbto2f64(<2 x double> %a) {
1741 ; NOVL-LABEL: sbto2f64:
1743 ; NOVL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1744 ; NOVL-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
1745 ; NOVL-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2,2,3]
1746 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
1749 ; VLDQ-LABEL: sbto2f64:
1751 ; VLDQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1752 ; VLDQ-NEXT: vcmpltpd %xmm0, %xmm1, %k0
1753 ; VLDQ-NEXT: vpmovm2d %k0, %xmm0
1754 ; VLDQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1757 ; VLNODQ-LABEL: sbto2f64:
1759 ; VLNODQ-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1760 ; VLNODQ-NEXT: vcmpltpd %xmm0, %xmm1, %k1
1761 ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
1762 ; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
1763 ; VLNODQ-NEXT: vcvtdq2pd %xmm0, %xmm0
1765 %cmpres = fcmp ogt <2 x double> %a, zeroinitializer
1766 %1 = sitofp <2 x i1> %cmpres to <2 x double>
1770 define <16 x float> @ucto16f32(<16 x i8> %a) {
1771 ; ALL-LABEL: ucto16f32:
1773 ; 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
1774 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1776 %b = uitofp <16 x i8> %a to <16 x float>
1780 define <8 x double> @ucto8f64(<8 x i8> %a) {
1781 ; ALL-LABEL: ucto8f64:
1783 ; 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
1784 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1786 %b = uitofp <8 x i8> %a to <8 x double>
1790 define <16 x float> @swto16f32(<16 x i16> %a) {
1791 ; ALL-LABEL: swto16f32:
1793 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
1794 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1796 %b = sitofp <16 x i16> %a to <16 x float>
1800 define <8 x double> @swto8f64(<8 x i16> %a) {
1801 ; ALL-LABEL: swto8f64:
1803 ; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
1804 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1806 %b = sitofp <8 x i16> %a to <8 x double>
1810 define <16 x double> @swto16f64(<16 x i16> %a) {
1811 ; ALL-LABEL: swto16f64:
1813 ; ALL-NEXT: vpmovsxwd %ymm0, %zmm1
1814 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1815 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1816 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1818 %b = sitofp <16 x i16> %a to <16 x double>
1819 ret <16 x double> %b
1822 define <16 x double> @ucto16f64(<16 x i8> %a) {
1823 ; ALL-LABEL: ucto16f64:
1825 ; 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
1826 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1827 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1828 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1830 %b = uitofp <16 x i8> %a to <16 x double>
1831 ret <16 x double> %b
1834 define <16 x float> @uwto16f32(<16 x i16> %a) {
1835 ; ALL-LABEL: uwto16f32:
1837 ; 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
1838 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1840 %b = uitofp <16 x i16> %a to <16 x float>
1844 define <8 x double> @uwto8f64(<8 x i16> %a) {
1845 ; ALL-LABEL: uwto8f64:
1847 ; 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
1848 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1850 %b = uitofp <8 x i16> %a to <8 x double>
1854 define <16 x double> @uwto16f64(<16 x i16> %a) {
1855 ; ALL-LABEL: uwto16f64:
1857 ; 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
1858 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm0
1859 ; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1860 ; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
1862 %b = uitofp <16 x i16> %a to <16 x double>
1863 ret <16 x double> %b
1866 define <16 x float> @sito16f32(<16 x i32> %a) {
1867 ; ALL-LABEL: sito16f32:
1869 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1871 %b = sitofp <16 x i32> %a to <16 x float>
1875 define <16 x double> @sito16f64(<16 x i32> %a) {
1876 ; ALL-LABEL: sito16f64:
1878 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm2
1879 ; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
1880 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm1
1881 ; ALL-NEXT: vmovaps %zmm2, %zmm0
1883 %b = sitofp <16 x i32> %a to <16 x double>
1884 ret <16 x double> %b
1887 define <16 x float> @usto16f32(<16 x i16> %a) {
1888 ; ALL-LABEL: usto16f32:
1890 ; 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
1891 ; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
1893 %b = uitofp <16 x i16> %a to <16 x float>
1897 define <16 x float> @ubto16f32(<16 x i32> %a) {
1898 ; NODQ-LABEL: ubto16f32:
1900 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1901 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1902 ; NODQ-NEXT: vpternlogd {{.*#+}} zmm0 {%k1} {z} = -1
1903 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm0
1904 ; NODQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1907 ; VLDQ-LABEL: ubto16f32:
1909 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1910 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1911 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm0
1912 ; VLDQ-NEXT: vcvtdq2ps %zmm0, %zmm0
1915 ; DQNOVL-LABEL: ubto16f32:
1917 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1918 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1919 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm0
1920 ; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
1922 %mask = icmp slt <16 x i32> %a, zeroinitializer
1923 %1 = uitofp <16 x i1> %mask to <16 x float>
1927 define <16 x double> @ubto16f64(<16 x i32> %a) {
1928 ; NODQ-LABEL: ubto16f64:
1930 ; NODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
1931 ; NODQ-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
1932 ; NODQ-NEXT: vpternlogd {{.*#+}} zmm0 {%k1} {z} = -1
1933 ; NODQ-NEXT: vpsrld $31, %zmm0, %zmm1
1934 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1935 ; NODQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1936 ; NODQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1939 ; VLDQ-LABEL: ubto16f64:
1941 ; VLDQ-NEXT: vpmovd2m %zmm0, %k0
1942 ; VLDQ-NEXT: vpmovm2d %k0, %zmm0
1943 ; VLDQ-NEXT: vpsrld $31, %zmm0, %zmm1
1944 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm0
1945 ; VLDQ-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1946 ; VLDQ-NEXT: vcvtdq2pd %ymm1, %zmm1
1949 ; DQNOVL-LABEL: ubto16f64:
1951 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k0
1952 ; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
1953 ; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm1
1954 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm0
1955 ; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
1956 ; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
1958 %mask = icmp slt <16 x i32> %a, zeroinitializer
1959 %1 = uitofp <16 x i1> %mask to <16 x double>
1960 ret <16 x double> %1
1963 define <8 x float> @ubto8f32(<8 x i32> %a) {
1964 ; NOVL-LABEL: ubto8f32:
1966 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1967 ; NOVL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1968 ; NOVL-NEXT: vpbroadcastd {{.*#+}} ymm1 = [1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216]
1969 ; NOVL-NEXT: vpand %ymm1, %ymm0, %ymm0
1972 ; VL-LABEL: ubto8f32:
1974 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1975 ; VL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
1976 ; VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm0
1978 %mask = icmp slt <8 x i32> %a, zeroinitializer
1979 %1 = uitofp <8 x i1> %mask to <8 x float>
1983 define <8 x double> @ubto8f64(<8 x i32> %a) {
1984 ; ALL-LABEL: ubto8f64:
1986 ; ALL-NEXT: vpsrld $31, %ymm0, %ymm0
1987 ; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
1989 %mask = icmp slt <8 x i32> %a, zeroinitializer
1990 %1 = uitofp <8 x i1> %mask to <8 x double>
1994 define <4 x float> @ubto4f32(<4 x i32> %a) {
1995 ; NOVL-LABEL: ubto4f32:
1997 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
1998 ; NOVL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
1999 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
2000 ; NOVL-NEXT: vpand %xmm1, %xmm0, %xmm0
2003 ; VL-LABEL: ubto4f32:
2005 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2006 ; VL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
2007 ; VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
2009 %mask = icmp slt <4 x i32> %a, zeroinitializer
2010 %1 = uitofp <4 x i1> %mask to <4 x float>
2014 define <4 x double> @ubto4f64(<4 x i32> %a) {
2015 ; ALL-LABEL: ubto4f64:
2017 ; ALL-NEXT: vpsrld $31, %xmm0, %xmm0
2018 ; ALL-NEXT: vcvtdq2pd %xmm0, %ymm0
2020 %mask = icmp slt <4 x i32> %a, zeroinitializer
2021 %1 = uitofp <4 x i1> %mask to <4 x double>
2025 define <2 x float> @ubto2f32(<2 x i32> %a) {
2026 ; NOVL-LABEL: ubto2f32:
2028 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2029 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2030 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
2031 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
2034 ; VL-LABEL: ubto2f32:
2036 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2037 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2038 ; VL-NEXT: vpandnd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
2040 %mask = icmp ne <2 x i32> %a, zeroinitializer
2041 %1 = uitofp <2 x i1> %mask to <2 x float>
2045 define <2 x double> @ubto2f64(<2 x i32> %a) {
2046 ; NOVL-LABEL: ubto2f64:
2048 ; NOVL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2049 ; NOVL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2050 ; NOVL-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1,1,1,1]
2051 ; NOVL-NEXT: vpandn %xmm1, %xmm0, %xmm0
2052 ; NOVL-NEXT: vcvtdq2pd %xmm0, %xmm0
2055 ; VL-LABEL: ubto2f64:
2057 ; VL-NEXT: vpxor %xmm1, %xmm1, %xmm1
2058 ; VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
2059 ; VL-NEXT: vpandnd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
2060 ; VL-NEXT: vcvtdq2pd %xmm0, %xmm0
2062 %mask = icmp ne <2 x i32> %a, zeroinitializer
2063 %1 = uitofp <2 x i1> %mask to <2 x double>
2067 define <2 x i64> @test_2f64toub(<2 x double> %a, <2 x i64> %passthru) {
2068 ; NOVLDQ-LABEL: test_2f64toub:
2070 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2071 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2072 ; NOVLDQ-NEXT: vcvttpd2udq %zmm0, %ymm0
2073 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2074 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2075 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2076 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2077 ; NOVLDQ-NEXT: vzeroupper
2080 ; VLDQ-LABEL: test_2f64toub:
2082 ; VLDQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2083 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2084 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2085 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2088 ; VLNODQ-LABEL: test_2f64toub:
2090 ; VLNODQ-NEXT: vcvttpd2udq %xmm0, %xmm0
2091 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2092 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2093 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2096 ; DQNOVL-LABEL: test_2f64toub:
2098 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2099 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2100 ; DQNOVL-NEXT: vcvttpd2udq %zmm0, %ymm0
2101 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2102 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2103 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2104 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2105 ; DQNOVL-NEXT: vzeroupper
2107 %mask = fptoui <2 x double> %a to <2 x i1>
2108 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2109 ret <2 x i64> %select
2112 define <4 x i64> @test_4f64toub(<4 x double> %a, <4 x i64> %passthru) {
2113 ; NOVLDQ-LABEL: test_4f64toub:
2115 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2116 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2117 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2118 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2119 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2120 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2123 ; VLDQ-LABEL: test_4f64toub:
2125 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2126 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2127 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2128 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2131 ; VLNODQ-LABEL: test_4f64toub:
2133 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2134 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2135 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2136 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2139 ; DQNOVL-LABEL: test_4f64toub:
2141 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2142 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2143 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2144 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2145 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2146 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2148 %mask = fptoui <4 x double> %a to <4 x i1>
2149 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2150 ret <4 x i64> %select
2153 define <8 x i64> @test_8f64toub(<8 x double> %a, <8 x i64> %passthru) {
2154 ; NOVLDQ-LABEL: test_8f64toub:
2156 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2157 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2158 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2159 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2162 ; VLDQ-LABEL: test_8f64toub:
2164 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2165 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2166 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2167 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2170 ; VLNODQ-LABEL: test_8f64toub:
2172 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2173 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2174 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2175 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2178 ; DQNOVL-LABEL: test_8f64toub:
2180 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2181 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2182 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2183 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2185 %mask = fptoui <8 x double> %a to <8 x i1>
2186 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2187 ret <8 x i64> %select
2190 define <2 x i64> @test_2f32toub(<2 x float> %a, <2 x i64> %passthru) {
2191 ; NOVLDQ-LABEL: test_2f32toub:
2193 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2194 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2195 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2196 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2197 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2198 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2199 ; NOVLDQ-NEXT: vzeroupper
2202 ; VLDQ-LABEL: test_2f32toub:
2204 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2205 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2206 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2207 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2210 ; VLNODQ-LABEL: test_2f32toub:
2212 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2213 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2214 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2215 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2218 ; DQNOVL-LABEL: test_2f32toub:
2220 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2221 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2222 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2223 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2224 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2225 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2226 ; DQNOVL-NEXT: vzeroupper
2228 %mask = fptoui <2 x float> %a to <2 x i1>
2229 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2230 ret <2 x i64> %select
2233 define <4 x i64> @test_4f32toub(<4 x float> %a, <4 x i64> %passthru) {
2234 ; NOVLDQ-LABEL: test_4f32toub:
2236 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2237 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2238 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2239 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2240 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2241 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2244 ; VLDQ-LABEL: test_4f32toub:
2246 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2247 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2248 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2249 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2252 ; VLNODQ-LABEL: test_4f32toub:
2254 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2255 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2256 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2257 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2260 ; DQNOVL-LABEL: test_4f32toub:
2262 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2263 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2264 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2265 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2266 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2267 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2269 %mask = fptoui <4 x float> %a to <4 x i1>
2270 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2271 ret <4 x i64> %select
2274 define <8 x i64> @test_8f32toub(<8 x float> %a, <8 x i64> %passthru) {
2275 ; NOVLDQ-LABEL: test_8f32toub:
2277 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2278 ; NOVLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2279 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2280 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2283 ; VLDQ-LABEL: test_8f32toub:
2285 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2286 ; VLDQ-NEXT: vpslld $31, %ymm0, %ymm0
2287 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2288 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2291 ; VLNODQ-LABEL: test_8f32toub:
2293 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2294 ; VLNODQ-NEXT: vpslld $31, %ymm0, %ymm0
2295 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2296 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2299 ; DQNOVL-LABEL: test_8f32toub:
2301 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2302 ; DQNOVL-NEXT: vpslld $31, %ymm0, %ymm0
2303 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2304 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2306 %mask = fptoui <8 x float> %a to <8 x i1>
2307 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2308 ret <8 x i64> %select
2311 define <16 x i32> @test_16f32toub(<16 x float> %a, <16 x i32> %passthru) {
2312 ; NODQ-LABEL: test_16f32toub:
2314 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2315 ; NODQ-NEXT: vpslld $31, %zmm0, %zmm0
2316 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2317 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2320 ; VLDQ-LABEL: test_16f32toub:
2322 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2323 ; VLDQ-NEXT: vpslld $31, %zmm0, %zmm0
2324 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2325 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2328 ; DQNOVL-LABEL: test_16f32toub:
2330 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2331 ; DQNOVL-NEXT: vpslld $31, %zmm0, %zmm0
2332 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2333 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2335 %mask = fptoui <16 x float> %a to <16 x i1>
2336 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2337 ret <16 x i32> %select
2340 define <2 x i64> @test_2f64tosb(<2 x double> %a, <2 x i64> %passthru) {
2341 ; NOVLDQ-LABEL: test_2f64tosb:
2343 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2344 ; NOVLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2345 ; NOVLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2346 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2347 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2348 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2349 ; NOVLDQ-NEXT: vzeroupper
2352 ; VLDQ-LABEL: test_2f64tosb:
2354 ; VLDQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2355 ; VLDQ-NEXT: vpslld $31, %xmm0, %xmm0
2356 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2357 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2360 ; VLNODQ-LABEL: test_2f64tosb:
2362 ; VLNODQ-NEXT: vcvttpd2dq %xmm0, %xmm0
2363 ; VLNODQ-NEXT: vpslld $31, %xmm0, %xmm0
2364 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2365 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2368 ; DQNOVL-LABEL: test_2f64tosb:
2370 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2371 ; DQNOVL-NEXT: vcvttpd2dq %xmm0, %xmm0
2372 ; DQNOVL-NEXT: vpslld $31, %xmm0, %xmm0
2373 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2374 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2375 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2376 ; DQNOVL-NEXT: vzeroupper
2378 %mask = fptosi <2 x double> %a to <2 x i1>
2379 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2380 ret <2 x i64> %select
2383 define <4 x i64> @test_4f64tosb(<4 x double> %a, <4 x i64> %passthru) {
2384 ; NOVLDQ-LABEL: test_4f64tosb:
2386 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2387 ; NOVLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2388 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2389 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2390 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2393 ; VLDQ-LABEL: test_4f64tosb:
2395 ; VLDQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2396 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2397 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2400 ; VLNODQ-LABEL: test_4f64tosb:
2402 ; VLNODQ-NEXT: vcvttpd2dq %ymm0, %xmm0
2403 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2404 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2407 ; DQNOVL-LABEL: test_4f64tosb:
2409 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2410 ; DQNOVL-NEXT: vcvttpd2dq %ymm0, %xmm0
2411 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2412 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2413 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2415 %mask = fptosi <4 x double> %a to <4 x i1>
2416 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2417 ret <4 x i64> %select
2420 define <8 x i64> @test_8f64tosb(<8 x double> %a, <8 x i64> %passthru) {
2421 ; NOVLDQ-LABEL: test_8f64tosb:
2423 ; NOVLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2424 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2425 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2428 ; VLDQ-LABEL: test_8f64tosb:
2430 ; VLDQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2431 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2432 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2435 ; VLNODQ-LABEL: test_8f64tosb:
2437 ; VLNODQ-NEXT: vcvttpd2dq %zmm0, %ymm0
2438 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2439 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2442 ; DQNOVL-LABEL: test_8f64tosb:
2444 ; DQNOVL-NEXT: vcvttpd2dq %zmm0, %ymm0
2445 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2446 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2448 %mask = fptosi <8 x double> %a to <8 x i1>
2449 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2450 ret <8 x i64> %select
2453 define <2 x i64> @test_2f32tosb(<2 x float> %a, <2 x i64> %passthru) {
2454 ; NOVLDQ-LABEL: test_2f32tosb:
2456 ; NOVLDQ-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2457 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2458 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2459 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2460 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2461 ; NOVLDQ-NEXT: vzeroupper
2464 ; VLDQ-LABEL: test_2f32tosb:
2466 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2467 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2468 ; VLDQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2471 ; VLNODQ-LABEL: test_2f32tosb:
2473 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2474 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2475 ; VLNODQ-NEXT: vmovdqa64 %xmm1, %xmm0 {%k1} {z}
2478 ; DQNOVL-LABEL: test_2f32tosb:
2480 ; DQNOVL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2481 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2482 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2483 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2484 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2485 ; DQNOVL-NEXT: vzeroupper
2487 %mask = fptosi <2 x float> %a to <2 x i1>
2488 %select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
2489 ret <2 x i64> %select
2492 define <4 x i64> @test_4f32tosb(<4 x float> %a, <4 x i64> %passthru) {
2493 ; NOVLDQ-LABEL: test_4f32tosb:
2495 ; NOVLDQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2496 ; NOVLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2497 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2498 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2499 ; NOVLDQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2502 ; VLDQ-LABEL: test_4f32tosb:
2504 ; VLDQ-NEXT: vcvttps2dq %xmm0, %xmm0
2505 ; VLDQ-NEXT: vpmovd2m %xmm0, %k1
2506 ; VLDQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2509 ; VLNODQ-LABEL: test_4f32tosb:
2511 ; VLNODQ-NEXT: vcvttps2dq %xmm0, %xmm0
2512 ; VLNODQ-NEXT: vptestmd %xmm0, %xmm0, %k1
2513 ; VLNODQ-NEXT: vmovdqa64 %ymm1, %ymm0 {%k1} {z}
2516 ; DQNOVL-LABEL: test_4f32tosb:
2518 ; DQNOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2519 ; DQNOVL-NEXT: vcvttps2dq %xmm0, %xmm0
2520 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2521 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2522 ; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2524 %mask = fptosi <4 x float> %a to <4 x i1>
2525 %select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
2526 ret <4 x i64> %select
2529 define <8 x i64> @test_8f32tosb(<8 x float> %a, <8 x i64> %passthru) {
2530 ; NOVLDQ-LABEL: test_8f32tosb:
2532 ; NOVLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2533 ; NOVLDQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2534 ; NOVLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2537 ; VLDQ-LABEL: test_8f32tosb:
2539 ; VLDQ-NEXT: vcvttps2dq %ymm0, %ymm0
2540 ; VLDQ-NEXT: vpmovd2m %ymm0, %k1
2541 ; VLDQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2544 ; VLNODQ-LABEL: test_8f32tosb:
2546 ; VLNODQ-NEXT: vcvttps2dq %ymm0, %ymm0
2547 ; VLNODQ-NEXT: vptestmd %ymm0, %ymm0, %k1
2548 ; VLNODQ-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2551 ; DQNOVL-LABEL: test_8f32tosb:
2553 ; DQNOVL-NEXT: vcvttps2dq %ymm0, %ymm0
2554 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2555 ; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
2557 %mask = fptosi <8 x float> %a to <8 x i1>
2558 %select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
2559 ret <8 x i64> %select
2562 define <16 x i32> @test_16f32tosb(<16 x float> %a, <16 x i32> %passthru) {
2563 ; NODQ-LABEL: test_16f32tosb:
2565 ; NODQ-NEXT: vcvttps2dq %zmm0, %zmm0
2566 ; NODQ-NEXT: vptestmd %zmm0, %zmm0, %k1
2567 ; NODQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2570 ; VLDQ-LABEL: test_16f32tosb:
2572 ; VLDQ-NEXT: vcvttps2dq %zmm0, %zmm0
2573 ; VLDQ-NEXT: vpmovd2m %zmm0, %k1
2574 ; VLDQ-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2577 ; DQNOVL-LABEL: test_16f32tosb:
2579 ; DQNOVL-NEXT: vcvttps2dq %zmm0, %zmm0
2580 ; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
2581 ; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
2583 %mask = fptosi <16 x float> %a to <16 x i1>
2584 %select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
2585 ret <16 x i32> %select
2588 define <2 x double> @test_sito2f64_mask_load(ptr%a, <2 x i64> %c) {
2589 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2591 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2594 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2596 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2598 ; NOVLDQ-LABEL: test_sito2f64_mask_load:
2600 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2601 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2602 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2603 ; NOVLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0
2604 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2605 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2606 ; NOVLDQ-NEXT: vzeroupper
2609 ; VLDQ-LABEL: test_sito2f64_mask_load:
2611 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2612 ; VLDQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2615 ; VLNODQ-LABEL: test_sito2f64_mask_load:
2617 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2618 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2619 ; VLNODQ-NEXT: vcvtdq2pd (%rdi), %xmm0 {%k1} {z}
2622 ; DQNOVL-LABEL: test_sito2f64_mask_load:
2624 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2625 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2626 ; DQNOVL-NEXT: vcvtdq2pd (%rdi), %xmm0
2627 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2628 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2629 ; DQNOVL-NEXT: vzeroupper
2631 %mask = icmp slt <2 x i64> %c, zeroinitializer
2632 %ld = load <2 x i32>, ptr%a
2633 %cvt = sitofp <2 x i32> %ld to <2 x double>
2634 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2635 ret <2 x double> %sel
2638 define <2 x double> @test_uito2f64_mask_load(ptr%a, <2 x i64> %c) {
2639 ; SSE-LABEL: sitofp_load_2i32_to_2f64:
2641 ; SSE-NEXT: cvtdq2pd (%rdi), %xmm0
2644 ; AVX-LABEL: sitofp_load_2i32_to_2f64:
2646 ; AVX-NEXT: vcvtdq2pd (%rdi), %xmm0
2648 ; NOVLDQ-LABEL: test_uito2f64_mask_load:
2650 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2651 ; NOVLDQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2652 ; NOVLDQ-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
2653 ; NOVLDQ-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2654 ; NOVLDQ-NEXT: vcvtudq2pd %ymm0, %zmm0
2655 ; NOVLDQ-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2656 ; NOVLDQ-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2657 ; NOVLDQ-NEXT: vzeroupper
2660 ; VLDQ-LABEL: test_uito2f64_mask_load:
2662 ; VLDQ-NEXT: vpmovq2m %xmm0, %k1
2663 ; VLDQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2666 ; VLNODQ-LABEL: test_uito2f64_mask_load:
2668 ; VLNODQ-NEXT: vpxor %xmm1, %xmm1, %xmm1
2669 ; VLNODQ-NEXT: vpcmpgtq %xmm0, %xmm1, %k1
2670 ; VLNODQ-NEXT: vcvtudq2pd (%rdi), %xmm0 {%k1} {z}
2673 ; DQNOVL-LABEL: test_uito2f64_mask_load:
2675 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2676 ; DQNOVL-NEXT: vpmovq2m %zmm0, %k1
2677 ; DQNOVL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2678 ; DQNOVL-NEXT: vcvtudq2pd %ymm0, %zmm0
2679 ; DQNOVL-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
2680 ; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2681 ; DQNOVL-NEXT: vzeroupper
2683 %mask = icmp slt <2 x i64> %c, zeroinitializer
2684 %ld = load <2 x i32>, ptr%a
2685 %cvt = uitofp <2 x i32> %ld to <2 x double>
2686 %sel = select <2 x i1> %mask, <2 x double> %cvt, <2 x double> zeroinitializer
2687 ret <2 x double> %sel