1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=SSE,SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=SSE,SSE41
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX2
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=AVX512F
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefix=AVX512VL
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=AVX512BW
9 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefix=AVX512VLBW
10 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vbmi,+avx512vbmi2 | FileCheck %s --check-prefix=AVX512VBMI2
11 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vbmi,+avx512vbmi2,+avx512vl | FileCheck %s --check-prefix=AVX512VLVBMI2
12 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop,+avx | FileCheck %s --check-prefixes=XOP,XOPAVX1
13 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop,+avx2 | FileCheck %s --check-prefixes=XOP,XOPAVX2
15 ; Just one 32-bit run to make sure we do reasonable things for i64 cases.
16 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86-SSE2
18 declare <2 x i64> @llvm.fshl.v2i64(<2 x i64>, <2 x i64>, <2 x i64>)
19 declare <4 x i32> @llvm.fshl.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)
20 declare <8 x i16> @llvm.fshl.v8i16(<8 x i16>, <8 x i16>, <8 x i16>)
21 declare <16 x i8> @llvm.fshl.v16i8(<16 x i8>, <16 x i8>, <16 x i8>)
27 define <2 x i64> @var_funnnel_v2i64(<2 x i64> %x, <2 x i64> %amt) nounwind {
28 ; SSE2-LABEL: var_funnnel_v2i64:
30 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [63,63]
31 ; SSE2-NEXT: pxor %xmm3, %xmm3
32 ; SSE2-NEXT: psubq %xmm1, %xmm3
33 ; SSE2-NEXT: pand %xmm2, %xmm1
34 ; SSE2-NEXT: movdqa %xmm0, %xmm4
35 ; SSE2-NEXT: psllq %xmm1, %xmm4
36 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
37 ; SSE2-NEXT: movdqa %xmm0, %xmm5
38 ; SSE2-NEXT: psllq %xmm1, %xmm5
39 ; SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm4[0],xmm5[1]
40 ; SSE2-NEXT: pand %xmm2, %xmm3
41 ; SSE2-NEXT: movdqa %xmm0, %xmm1
42 ; SSE2-NEXT: psrlq %xmm3, %xmm1
43 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,2,3]
44 ; SSE2-NEXT: psrlq %xmm2, %xmm0
45 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
46 ; SSE2-NEXT: orpd %xmm5, %xmm0
49 ; SSE41-LABEL: var_funnnel_v2i64:
51 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [63,63]
52 ; SSE41-NEXT: pxor %xmm3, %xmm3
53 ; SSE41-NEXT: psubq %xmm1, %xmm3
54 ; SSE41-NEXT: pand %xmm2, %xmm1
55 ; SSE41-NEXT: movdqa %xmm0, %xmm4
56 ; SSE41-NEXT: psllq %xmm1, %xmm4
57 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
58 ; SSE41-NEXT: movdqa %xmm0, %xmm5
59 ; SSE41-NEXT: psllq %xmm1, %xmm5
60 ; SSE41-NEXT: pblendw {{.*#+}} xmm5 = xmm4[0,1,2,3],xmm5[4,5,6,7]
61 ; SSE41-NEXT: pand %xmm2, %xmm3
62 ; SSE41-NEXT: movdqa %xmm0, %xmm1
63 ; SSE41-NEXT: psrlq %xmm3, %xmm1
64 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,2,3]
65 ; SSE41-NEXT: psrlq %xmm2, %xmm0
66 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm1[0,1,2,3],xmm0[4,5,6,7]
67 ; SSE41-NEXT: por %xmm5, %xmm0
70 ; AVX1-LABEL: var_funnnel_v2i64:
72 ; AVX1-NEXT: vmovddup {{.*#+}} xmm2 = [63,63]
73 ; AVX1-NEXT: # xmm2 = mem[0,0]
74 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm3
75 ; AVX1-NEXT: vpsllq %xmm3, %xmm0, %xmm4
76 ; AVX1-NEXT: vpshufd {{.*#+}} xmm3 = xmm3[2,3,2,3]
77 ; AVX1-NEXT: vpsllq %xmm3, %xmm0, %xmm3
78 ; AVX1-NEXT: vpblendw {{.*#+}} xmm3 = xmm4[0,1,2,3],xmm3[4,5,6,7]
79 ; AVX1-NEXT: vpxor %xmm4, %xmm4, %xmm4
80 ; AVX1-NEXT: vpsubq %xmm1, %xmm4, %xmm1
81 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm1
82 ; AVX1-NEXT: vpsrlq %xmm1, %xmm0, %xmm2
83 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
84 ; AVX1-NEXT: vpsrlq %xmm1, %xmm0, %xmm0
85 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm2[0,1,2,3],xmm0[4,5,6,7]
86 ; AVX1-NEXT: vpor %xmm0, %xmm3, %xmm0
89 ; AVX2-LABEL: var_funnnel_v2i64:
91 ; AVX2-NEXT: vpbroadcastq {{.*#+}} xmm2 = [63,63]
92 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm3
93 ; AVX2-NEXT: vpsllvq %xmm3, %xmm0, %xmm3
94 ; AVX2-NEXT: vpxor %xmm4, %xmm4, %xmm4
95 ; AVX2-NEXT: vpsubq %xmm1, %xmm4, %xmm1
96 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm1
97 ; AVX2-NEXT: vpsrlvq %xmm1, %xmm0, %xmm0
98 ; AVX2-NEXT: vpor %xmm0, %xmm3, %xmm0
101 ; AVX512F-LABEL: var_funnnel_v2i64:
103 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
104 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
105 ; AVX512F-NEXT: vprolvq %zmm1, %zmm0, %zmm0
106 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
107 ; AVX512F-NEXT: vzeroupper
110 ; AVX512VL-LABEL: var_funnnel_v2i64:
112 ; AVX512VL-NEXT: vprolvq %xmm1, %xmm0, %xmm0
113 ; AVX512VL-NEXT: retq
115 ; AVX512BW-LABEL: var_funnnel_v2i64:
117 ; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
118 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
119 ; AVX512BW-NEXT: vprolvq %zmm1, %zmm0, %zmm0
120 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
121 ; AVX512BW-NEXT: vzeroupper
122 ; AVX512BW-NEXT: retq
124 ; AVX512VLBW-LABEL: var_funnnel_v2i64:
125 ; AVX512VLBW: # %bb.0:
126 ; AVX512VLBW-NEXT: vprolvq %xmm1, %xmm0, %xmm0
127 ; AVX512VLBW-NEXT: retq
129 ; AVX512VBMI2-LABEL: var_funnnel_v2i64:
130 ; AVX512VBMI2: # %bb.0:
131 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
132 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
133 ; AVX512VBMI2-NEXT: vprolvq %zmm1, %zmm0, %zmm0
134 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
135 ; AVX512VBMI2-NEXT: vzeroupper
136 ; AVX512VBMI2-NEXT: retq
138 ; AVX512VLVBMI2-LABEL: var_funnnel_v2i64:
139 ; AVX512VLVBMI2: # %bb.0:
140 ; AVX512VLVBMI2-NEXT: vprolvq %xmm1, %xmm0, %xmm0
141 ; AVX512VLVBMI2-NEXT: retq
143 ; XOP-LABEL: var_funnnel_v2i64:
145 ; XOP-NEXT: vprotq %xmm1, %xmm0, %xmm0
148 ; X86-SSE2-LABEL: var_funnnel_v2i64:
150 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [63,0,63,0]
151 ; X86-SSE2-NEXT: pxor %xmm3, %xmm3
152 ; X86-SSE2-NEXT: psubq %xmm1, %xmm3
153 ; X86-SSE2-NEXT: pand %xmm2, %xmm1
154 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm4
155 ; X86-SSE2-NEXT: psllq %xmm1, %xmm4
156 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
157 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm5
158 ; X86-SSE2-NEXT: psllq %xmm1, %xmm5
159 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm4[0],xmm5[1]
160 ; X86-SSE2-NEXT: pand %xmm2, %xmm3
161 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
162 ; X86-SSE2-NEXT: psrlq %xmm3, %xmm1
163 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,2,3]
164 ; X86-SSE2-NEXT: psrlq %xmm2, %xmm0
165 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
166 ; X86-SSE2-NEXT: orpd %xmm5, %xmm0
167 ; X86-SSE2-NEXT: retl
168 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> %amt)
172 define <4 x i32> @var_funnnel_v4i32(<4 x i32> %x, <4 x i32> %amt) nounwind {
173 ; SSE2-LABEL: var_funnnel_v4i32:
175 ; SSE2-NEXT: pslld $23, %xmm1
176 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
177 ; SSE2-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
178 ; SSE2-NEXT: cvttps2dq %xmm1, %xmm1
179 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
180 ; SSE2-NEXT: pmuludq %xmm1, %xmm0
181 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,3,2,3]
182 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
183 ; SSE2-NEXT: pmuludq %xmm2, %xmm1
184 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,2,3]
185 ; SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
186 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
187 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
188 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
189 ; SSE2-NEXT: por %xmm3, %xmm0
192 ; SSE41-LABEL: var_funnnel_v4i32:
194 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
195 ; SSE41-NEXT: pslld $23, %xmm1
196 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
197 ; SSE41-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
198 ; SSE41-NEXT: cvttps2dq %xmm1, %xmm1
199 ; SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
200 ; SSE41-NEXT: pmuludq %xmm2, %xmm3
201 ; SSE41-NEXT: pmuludq %xmm1, %xmm0
202 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
203 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1],xmm3[2,3],xmm1[4,5],xmm3[6,7]
204 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,0,2,2]
205 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
206 ; SSE41-NEXT: por %xmm1, %xmm0
209 ; AVX1-LABEL: var_funnnel_v4i32:
211 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
212 ; AVX1-NEXT: vpslld $23, %xmm1, %xmm1
213 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
214 ; AVX1-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
215 ; AVX1-NEXT: vcvttps2dq %xmm1, %xmm1
216 ; AVX1-NEXT: vpshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
217 ; AVX1-NEXT: vpmuludq %xmm3, %xmm2, %xmm2
218 ; AVX1-NEXT: vpmuludq %xmm1, %xmm0, %xmm0
219 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
220 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1],xmm2[2,3],xmm1[4,5],xmm2[6,7]
221 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,0,2,2]
222 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
223 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
226 ; AVX2-LABEL: var_funnnel_v4i32:
228 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [31,31,31,31]
229 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm1
230 ; AVX2-NEXT: vpsllvd %xmm1, %xmm0, %xmm2
231 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm3 = [32,32,32,32]
232 ; AVX2-NEXT: vpsubd %xmm1, %xmm3, %xmm1
233 ; AVX2-NEXT: vpsrlvd %xmm1, %xmm0, %xmm0
234 ; AVX2-NEXT: vpor %xmm0, %xmm2, %xmm0
237 ; AVX512F-LABEL: var_funnnel_v4i32:
239 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
240 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
241 ; AVX512F-NEXT: vprolvd %zmm1, %zmm0, %zmm0
242 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
243 ; AVX512F-NEXT: vzeroupper
246 ; AVX512VL-LABEL: var_funnnel_v4i32:
248 ; AVX512VL-NEXT: vprolvd %xmm1, %xmm0, %xmm0
249 ; AVX512VL-NEXT: retq
251 ; AVX512BW-LABEL: var_funnnel_v4i32:
253 ; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
254 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
255 ; AVX512BW-NEXT: vprolvd %zmm1, %zmm0, %zmm0
256 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
257 ; AVX512BW-NEXT: vzeroupper
258 ; AVX512BW-NEXT: retq
260 ; AVX512VLBW-LABEL: var_funnnel_v4i32:
261 ; AVX512VLBW: # %bb.0:
262 ; AVX512VLBW-NEXT: vprolvd %xmm1, %xmm0, %xmm0
263 ; AVX512VLBW-NEXT: retq
265 ; AVX512VBMI2-LABEL: var_funnnel_v4i32:
266 ; AVX512VBMI2: # %bb.0:
267 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
268 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
269 ; AVX512VBMI2-NEXT: vprolvd %zmm1, %zmm0, %zmm0
270 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
271 ; AVX512VBMI2-NEXT: vzeroupper
272 ; AVX512VBMI2-NEXT: retq
274 ; AVX512VLVBMI2-LABEL: var_funnnel_v4i32:
275 ; AVX512VLVBMI2: # %bb.0:
276 ; AVX512VLVBMI2-NEXT: vprolvd %xmm1, %xmm0, %xmm0
277 ; AVX512VLVBMI2-NEXT: retq
279 ; XOP-LABEL: var_funnnel_v4i32:
281 ; XOP-NEXT: vprotd %xmm1, %xmm0, %xmm0
284 ; X86-SSE2-LABEL: var_funnnel_v4i32:
286 ; X86-SSE2-NEXT: pslld $23, %xmm1
287 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
288 ; X86-SSE2-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
289 ; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
290 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
291 ; X86-SSE2-NEXT: pmuludq %xmm1, %xmm0
292 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,3,2,3]
293 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
294 ; X86-SSE2-NEXT: pmuludq %xmm2, %xmm1
295 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,2,3]
296 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
297 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
298 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
299 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
300 ; X86-SSE2-NEXT: por %xmm3, %xmm0
301 ; X86-SSE2-NEXT: retl
302 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> %amt)
306 define <8 x i16> @var_funnnel_v8i16(<8 x i16> %x, <8 x i16> %amt) nounwind {
307 ; SSE2-LABEL: var_funnnel_v8i16:
309 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
310 ; SSE2-NEXT: movdqa %xmm1, %xmm2
311 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4,4,5,5,6,6,7,7]
312 ; SSE2-NEXT: pslld $23, %xmm2
313 ; SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
314 ; SSE2-NEXT: paddd %xmm3, %xmm2
315 ; SSE2-NEXT: cvttps2dq %xmm2, %xmm2
316 ; SSE2-NEXT: pslld $16, %xmm2
317 ; SSE2-NEXT: psrad $16, %xmm2
318 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3]
319 ; SSE2-NEXT: pslld $23, %xmm1
320 ; SSE2-NEXT: paddd %xmm3, %xmm1
321 ; SSE2-NEXT: cvttps2dq %xmm1, %xmm1
322 ; SSE2-NEXT: pslld $16, %xmm1
323 ; SSE2-NEXT: psrad $16, %xmm1
324 ; SSE2-NEXT: packssdw %xmm2, %xmm1
325 ; SSE2-NEXT: movdqa %xmm0, %xmm2
326 ; SSE2-NEXT: pmulhuw %xmm1, %xmm2
327 ; SSE2-NEXT: pmullw %xmm1, %xmm0
328 ; SSE2-NEXT: por %xmm2, %xmm0
331 ; SSE41-LABEL: var_funnnel_v8i16:
333 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
334 ; SSE41-NEXT: pmovzxwd {{.*#+}} xmm2 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
335 ; SSE41-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
336 ; SSE41-NEXT: pslld $23, %xmm1
337 ; SSE41-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
338 ; SSE41-NEXT: paddd %xmm3, %xmm1
339 ; SSE41-NEXT: cvttps2dq %xmm1, %xmm1
340 ; SSE41-NEXT: pslld $23, %xmm2
341 ; SSE41-NEXT: paddd %xmm3, %xmm2
342 ; SSE41-NEXT: cvttps2dq %xmm2, %xmm2
343 ; SSE41-NEXT: packusdw %xmm1, %xmm2
344 ; SSE41-NEXT: movdqa %xmm0, %xmm1
345 ; SSE41-NEXT: pmulhuw %xmm2, %xmm1
346 ; SSE41-NEXT: pmullw %xmm2, %xmm0
347 ; SSE41-NEXT: por %xmm1, %xmm0
350 ; AVX1-LABEL: var_funnnel_v8i16:
352 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
353 ; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4,4,5,5,6,6,7,7]
354 ; AVX1-NEXT: vpslld $23, %xmm2, %xmm2
355 ; AVX1-NEXT: vbroadcastss {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
356 ; AVX1-NEXT: vpaddd %xmm3, %xmm2, %xmm2
357 ; AVX1-NEXT: vcvttps2dq %xmm2, %xmm2
358 ; AVX1-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
359 ; AVX1-NEXT: vpslld $23, %xmm1, %xmm1
360 ; AVX1-NEXT: vpaddd %xmm3, %xmm1, %xmm1
361 ; AVX1-NEXT: vcvttps2dq %xmm1, %xmm1
362 ; AVX1-NEXT: vpackusdw %xmm2, %xmm1, %xmm1
363 ; AVX1-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
364 ; AVX1-NEXT: vpmullw %xmm1, %xmm0, %xmm0
365 ; AVX1-NEXT: vpor %xmm2, %xmm0, %xmm0
368 ; AVX2-LABEL: var_funnnel_v8i16:
370 ; AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
371 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
372 ; AVX2-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
373 ; AVX2-NEXT: vpunpckhwd {{.*#+}} xmm3 = xmm0[4,4,5,5,6,6,7,7]
374 ; AVX2-NEXT: vpsllvd %xmm2, %xmm3, %xmm2
375 ; AVX2-NEXT: vpsrld $16, %xmm2, %xmm2
376 ; AVX2-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
377 ; AVX2-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
378 ; AVX2-NEXT: vpsllvd %xmm1, %xmm0, %xmm0
379 ; AVX2-NEXT: vpsrld $16, %xmm0, %xmm0
380 ; AVX2-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
383 ; AVX512F-LABEL: var_funnnel_v8i16:
385 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
386 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
387 ; AVX512F-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
388 ; AVX512F-NEXT: vpunpckhwd {{.*#+}} xmm3 = xmm0[4,4,5,5,6,6,7,7]
389 ; AVX512F-NEXT: vpsllvd %xmm2, %xmm3, %xmm2
390 ; AVX512F-NEXT: vpsrld $16, %xmm2, %xmm2
391 ; AVX512F-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
392 ; AVX512F-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
393 ; AVX512F-NEXT: vpsllvd %xmm1, %xmm0, %xmm0
394 ; AVX512F-NEXT: vpsrld $16, %xmm0, %xmm0
395 ; AVX512F-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
398 ; AVX512VL-LABEL: var_funnnel_v8i16:
400 ; AVX512VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
401 ; AVX512VL-NEXT: vpxor %xmm2, %xmm2, %xmm2
402 ; AVX512VL-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
403 ; AVX512VL-NEXT: vpunpckhwd {{.*#+}} xmm3 = xmm0[4,4,5,5,6,6,7,7]
404 ; AVX512VL-NEXT: vpsllvd %xmm2, %xmm3, %xmm2
405 ; AVX512VL-NEXT: vpsrld $16, %xmm2, %xmm2
406 ; AVX512VL-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
407 ; AVX512VL-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
408 ; AVX512VL-NEXT: vpsllvd %xmm1, %xmm0, %xmm0
409 ; AVX512VL-NEXT: vpsrld $16, %xmm0, %xmm0
410 ; AVX512VL-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
411 ; AVX512VL-NEXT: retq
413 ; AVX512BW-LABEL: var_funnnel_v8i16:
415 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
416 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
417 ; AVX512BW-NEXT: vpsllvw %zmm1, %zmm0, %zmm2
418 ; AVX512BW-NEXT: vpbroadcastw {{.*#+}} xmm3 = [16,16,16,16,16,16,16,16]
419 ; AVX512BW-NEXT: vpsubw %xmm1, %xmm3, %xmm1
420 ; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm0
421 ; AVX512BW-NEXT: vpor %xmm0, %xmm2, %xmm0
422 ; AVX512BW-NEXT: vzeroupper
423 ; AVX512BW-NEXT: retq
425 ; AVX512VLBW-LABEL: var_funnnel_v8i16:
426 ; AVX512VLBW: # %bb.0:
427 ; AVX512VLBW-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
428 ; AVX512VLBW-NEXT: vpsllvw %xmm1, %xmm0, %xmm2
429 ; AVX512VLBW-NEXT: vpbroadcastw {{.*#+}} xmm3 = [16,16,16,16,16,16,16,16]
430 ; AVX512VLBW-NEXT: vpsubw %xmm1, %xmm3, %xmm1
431 ; AVX512VLBW-NEXT: vpsrlvw %xmm1, %xmm0, %xmm0
432 ; AVX512VLBW-NEXT: vpor %xmm0, %xmm2, %xmm0
433 ; AVX512VLBW-NEXT: retq
435 ; AVX512VBMI2-LABEL: var_funnnel_v8i16:
436 ; AVX512VBMI2: # %bb.0:
437 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
438 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
439 ; AVX512VBMI2-NEXT: vpshldvw %zmm1, %zmm0, %zmm0
440 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
441 ; AVX512VBMI2-NEXT: vzeroupper
442 ; AVX512VBMI2-NEXT: retq
444 ; AVX512VLVBMI2-LABEL: var_funnnel_v8i16:
445 ; AVX512VLVBMI2: # %bb.0:
446 ; AVX512VLVBMI2-NEXT: vpshldvw %xmm1, %xmm0, %xmm0
447 ; AVX512VLVBMI2-NEXT: retq
449 ; XOP-LABEL: var_funnnel_v8i16:
451 ; XOP-NEXT: vprotw %xmm1, %xmm0, %xmm0
454 ; X86-SSE2-LABEL: var_funnnel_v8i16:
456 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
457 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm2
458 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4,4,5,5,6,6,7,7]
459 ; X86-SSE2-NEXT: pslld $23, %xmm2
460 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
461 ; X86-SSE2-NEXT: paddd %xmm3, %xmm2
462 ; X86-SSE2-NEXT: cvttps2dq %xmm2, %xmm2
463 ; X86-SSE2-NEXT: pslld $16, %xmm2
464 ; X86-SSE2-NEXT: psrad $16, %xmm2
465 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3]
466 ; X86-SSE2-NEXT: pslld $23, %xmm1
467 ; X86-SSE2-NEXT: paddd %xmm3, %xmm1
468 ; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
469 ; X86-SSE2-NEXT: pslld $16, %xmm1
470 ; X86-SSE2-NEXT: psrad $16, %xmm1
471 ; X86-SSE2-NEXT: packssdw %xmm2, %xmm1
472 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
473 ; X86-SSE2-NEXT: pmulhuw %xmm1, %xmm2
474 ; X86-SSE2-NEXT: pmullw %xmm1, %xmm0
475 ; X86-SSE2-NEXT: por %xmm2, %xmm0
476 ; X86-SSE2-NEXT: retl
477 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> %amt)
481 define <16 x i8> @var_funnnel_v16i8(<16 x i8> %x, <16 x i8> %amt) nounwind {
482 ; SSE2-LABEL: var_funnnel_v16i8:
484 ; SSE2-NEXT: movdqa %xmm0, %xmm2
485 ; SSE2-NEXT: psllw $5, %xmm1
486 ; SSE2-NEXT: pxor %xmm0, %xmm0
487 ; SSE2-NEXT: pxor %xmm3, %xmm3
488 ; SSE2-NEXT: pcmpgtb %xmm1, %xmm3
489 ; SSE2-NEXT: movdqa %xmm2, %xmm4
490 ; SSE2-NEXT: psrlw $4, %xmm4
491 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm4
492 ; SSE2-NEXT: movdqa %xmm2, %xmm5
493 ; SSE2-NEXT: psllw $4, %xmm5
494 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm5
495 ; SSE2-NEXT: por %xmm4, %xmm5
496 ; SSE2-NEXT: pand %xmm3, %xmm5
497 ; SSE2-NEXT: pandn %xmm2, %xmm3
498 ; SSE2-NEXT: por %xmm5, %xmm3
499 ; SSE2-NEXT: movdqa %xmm3, %xmm2
500 ; SSE2-NEXT: psrlw $6, %xmm2
501 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
502 ; SSE2-NEXT: movdqa %xmm3, %xmm4
503 ; SSE2-NEXT: psllw $2, %xmm4
504 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm4
505 ; SSE2-NEXT: por %xmm2, %xmm4
506 ; SSE2-NEXT: paddb %xmm1, %xmm1
507 ; SSE2-NEXT: pxor %xmm2, %xmm2
508 ; SSE2-NEXT: pcmpgtb %xmm1, %xmm2
509 ; SSE2-NEXT: pand %xmm2, %xmm4
510 ; SSE2-NEXT: pandn %xmm3, %xmm2
511 ; SSE2-NEXT: por %xmm4, %xmm2
512 ; SSE2-NEXT: movdqa %xmm2, %xmm3
513 ; SSE2-NEXT: psrlw $7, %xmm3
514 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3
515 ; SSE2-NEXT: movdqa %xmm2, %xmm4
516 ; SSE2-NEXT: paddb %xmm2, %xmm4
517 ; SSE2-NEXT: por %xmm3, %xmm4
518 ; SSE2-NEXT: paddb %xmm1, %xmm1
519 ; SSE2-NEXT: pcmpgtb %xmm1, %xmm0
520 ; SSE2-NEXT: pand %xmm0, %xmm4
521 ; SSE2-NEXT: pandn %xmm2, %xmm0
522 ; SSE2-NEXT: por %xmm4, %xmm0
525 ; SSE41-LABEL: var_funnnel_v16i8:
527 ; SSE41-NEXT: movdqa %xmm1, %xmm2
528 ; SSE41-NEXT: movdqa %xmm0, %xmm1
529 ; SSE41-NEXT: psrlw $4, %xmm0
530 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
531 ; SSE41-NEXT: movdqa %xmm1, %xmm3
532 ; SSE41-NEXT: psllw $4, %xmm3
533 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3
534 ; SSE41-NEXT: por %xmm0, %xmm3
535 ; SSE41-NEXT: psllw $5, %xmm2
536 ; SSE41-NEXT: movdqa %xmm2, %xmm0
537 ; SSE41-NEXT: pblendvb %xmm0, %xmm3, %xmm1
538 ; SSE41-NEXT: movdqa %xmm1, %xmm0
539 ; SSE41-NEXT: psrlw $6, %xmm0
540 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
541 ; SSE41-NEXT: movdqa %xmm1, %xmm3
542 ; SSE41-NEXT: psllw $2, %xmm3
543 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3
544 ; SSE41-NEXT: por %xmm0, %xmm3
545 ; SSE41-NEXT: paddb %xmm2, %xmm2
546 ; SSE41-NEXT: movdqa %xmm2, %xmm0
547 ; SSE41-NEXT: pblendvb %xmm0, %xmm3, %xmm1
548 ; SSE41-NEXT: movdqa %xmm1, %xmm0
549 ; SSE41-NEXT: psrlw $7, %xmm0
550 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
551 ; SSE41-NEXT: movdqa %xmm1, %xmm3
552 ; SSE41-NEXT: paddb %xmm1, %xmm3
553 ; SSE41-NEXT: por %xmm0, %xmm3
554 ; SSE41-NEXT: paddb %xmm2, %xmm2
555 ; SSE41-NEXT: movdqa %xmm2, %xmm0
556 ; SSE41-NEXT: pblendvb %xmm0, %xmm3, %xmm1
557 ; SSE41-NEXT: movdqa %xmm1, %xmm0
560 ; AVX-LABEL: var_funnnel_v16i8:
562 ; AVX-NEXT: vpsrlw $4, %xmm0, %xmm2
563 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
564 ; AVX-NEXT: vpsllw $4, %xmm0, %xmm3
565 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3, %xmm3
566 ; AVX-NEXT: vpor %xmm2, %xmm3, %xmm2
567 ; AVX-NEXT: vpsllw $5, %xmm1, %xmm1
568 ; AVX-NEXT: vpblendvb %xmm1, %xmm2, %xmm0, %xmm0
569 ; AVX-NEXT: vpsrlw $6, %xmm0, %xmm2
570 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
571 ; AVX-NEXT: vpsllw $2, %xmm0, %xmm3
572 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3, %xmm3
573 ; AVX-NEXT: vpor %xmm2, %xmm3, %xmm2
574 ; AVX-NEXT: vpaddb %xmm1, %xmm1, %xmm1
575 ; AVX-NEXT: vpblendvb %xmm1, %xmm2, %xmm0, %xmm0
576 ; AVX-NEXT: vpsrlw $7, %xmm0, %xmm2
577 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
578 ; AVX-NEXT: vpaddb %xmm0, %xmm0, %xmm3
579 ; AVX-NEXT: vpor %xmm2, %xmm3, %xmm2
580 ; AVX-NEXT: vpaddb %xmm1, %xmm1, %xmm1
581 ; AVX-NEXT: vpblendvb %xmm1, %xmm2, %xmm0, %xmm0
584 ; AVX512F-LABEL: var_funnnel_v16i8:
586 ; AVX512F-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
587 ; AVX512F-NEXT: vpslld $8, %zmm0, %zmm2
588 ; AVX512F-NEXT: vpord %zmm2, %zmm0, %zmm0
589 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
590 ; AVX512F-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero,xmm1[8],zero,zero,zero,xmm1[9],zero,zero,zero,xmm1[10],zero,zero,zero,xmm1[11],zero,zero,zero,xmm1[12],zero,zero,zero,xmm1[13],zero,zero,zero,xmm1[14],zero,zero,zero,xmm1[15],zero,zero,zero
591 ; AVX512F-NEXT: vpsllvd %zmm1, %zmm0, %zmm0
592 ; AVX512F-NEXT: vpsrld $8, %zmm0, %zmm0
593 ; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
594 ; AVX512F-NEXT: vzeroupper
597 ; AVX512VL-LABEL: var_funnnel_v16i8:
599 ; AVX512VL-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
600 ; AVX512VL-NEXT: vpslld $8, %zmm0, %zmm2
601 ; AVX512VL-NEXT: vpord %zmm2, %zmm0, %zmm0
602 ; AVX512VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
603 ; AVX512VL-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero,xmm1[8],zero,zero,zero,xmm1[9],zero,zero,zero,xmm1[10],zero,zero,zero,xmm1[11],zero,zero,zero,xmm1[12],zero,zero,zero,xmm1[13],zero,zero,zero,xmm1[14],zero,zero,zero,xmm1[15],zero,zero,zero
604 ; AVX512VL-NEXT: vpsllvd %zmm1, %zmm0, %zmm0
605 ; AVX512VL-NEXT: vpsrld $8, %zmm0, %zmm0
606 ; AVX512VL-NEXT: vpmovdb %zmm0, %xmm0
607 ; AVX512VL-NEXT: vzeroupper
608 ; AVX512VL-NEXT: retq
610 ; AVX512BW-LABEL: var_funnnel_v16i8:
612 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
613 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
614 ; AVX512BW-NEXT: vpxor %xmm3, %xmm3, %xmm3
615 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm1[8],xmm3[8],xmm1[9],xmm3[9],xmm1[10],xmm3[10],xmm1[11],xmm3[11],xmm1[12],xmm3[12],xmm1[13],xmm3[13],xmm1[14],xmm3[14],xmm1[15],xmm3[15]
616 ; AVX512BW-NEXT: vpsllvw %zmm3, %zmm2, %zmm2
617 ; AVX512BW-NEXT: vpsrlw $8, %xmm2, %xmm2
618 ; AVX512BW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
619 ; AVX512BW-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
620 ; AVX512BW-NEXT: vpsllvw %zmm1, %zmm0, %zmm0
621 ; AVX512BW-NEXT: vpsrlw $8, %xmm0, %xmm0
622 ; AVX512BW-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
623 ; AVX512BW-NEXT: vzeroupper
624 ; AVX512BW-NEXT: retq
626 ; AVX512VLBW-LABEL: var_funnnel_v16i8:
627 ; AVX512VLBW: # %bb.0:
628 ; AVX512VLBW-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
629 ; AVX512VLBW-NEXT: vpxor %xmm2, %xmm2, %xmm2
630 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm1[8],xmm2[8],xmm1[9],xmm2[9],xmm1[10],xmm2[10],xmm1[11],xmm2[11],xmm1[12],xmm2[12],xmm1[13],xmm2[13],xmm1[14],xmm2[14],xmm1[15],xmm2[15]
631 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
632 ; AVX512VLBW-NEXT: vpsllvw %xmm2, %xmm3, %xmm2
633 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm2, %xmm2
634 ; AVX512VLBW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
635 ; AVX512VLBW-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
636 ; AVX512VLBW-NEXT: vpsllvw %xmm1, %xmm0, %xmm0
637 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm0, %xmm0
638 ; AVX512VLBW-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
639 ; AVX512VLBW-NEXT: retq
641 ; AVX512VBMI2-LABEL: var_funnnel_v16i8:
642 ; AVX512VBMI2: # %bb.0:
643 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
644 ; AVX512VBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
645 ; AVX512VBMI2-NEXT: vpxor %xmm3, %xmm3, %xmm3
646 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm1[8],xmm3[8],xmm1[9],xmm3[9],xmm1[10],xmm3[10],xmm1[11],xmm3[11],xmm1[12],xmm3[12],xmm1[13],xmm3[13],xmm1[14],xmm3[14],xmm1[15],xmm3[15]
647 ; AVX512VBMI2-NEXT: vpsllvw %zmm3, %zmm2, %zmm2
648 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm2, %xmm2
649 ; AVX512VBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
650 ; AVX512VBMI2-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
651 ; AVX512VBMI2-NEXT: vpsllvw %zmm1, %zmm0, %zmm0
652 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
653 ; AVX512VBMI2-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
654 ; AVX512VBMI2-NEXT: vzeroupper
655 ; AVX512VBMI2-NEXT: retq
657 ; AVX512VLVBMI2-LABEL: var_funnnel_v16i8:
658 ; AVX512VLVBMI2: # %bb.0:
659 ; AVX512VLVBMI2-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
660 ; AVX512VLVBMI2-NEXT: vpxor %xmm2, %xmm2, %xmm2
661 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm1[8],xmm2[8],xmm1[9],xmm2[9],xmm1[10],xmm2[10],xmm1[11],xmm2[11],xmm1[12],xmm2[12],xmm1[13],xmm2[13],xmm1[14],xmm2[14],xmm1[15],xmm2[15]
662 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
663 ; AVX512VLVBMI2-NEXT: vpsllvw %xmm2, %xmm3, %xmm2
664 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm2, %xmm2
665 ; AVX512VLVBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
666 ; AVX512VLVBMI2-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
667 ; AVX512VLVBMI2-NEXT: vpsllvw %xmm1, %xmm0, %xmm0
668 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
669 ; AVX512VLVBMI2-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
670 ; AVX512VLVBMI2-NEXT: retq
672 ; XOP-LABEL: var_funnnel_v16i8:
674 ; XOP-NEXT: vprotb %xmm1, %xmm0, %xmm0
677 ; X86-SSE2-LABEL: var_funnnel_v16i8:
679 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
680 ; X86-SSE2-NEXT: psllw $5, %xmm1
681 ; X86-SSE2-NEXT: pxor %xmm0, %xmm0
682 ; X86-SSE2-NEXT: pxor %xmm3, %xmm3
683 ; X86-SSE2-NEXT: pcmpgtb %xmm1, %xmm3
684 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm4
685 ; X86-SSE2-NEXT: psrlw $4, %xmm4
686 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm4
687 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm5
688 ; X86-SSE2-NEXT: psllw $4, %xmm5
689 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm5
690 ; X86-SSE2-NEXT: por %xmm4, %xmm5
691 ; X86-SSE2-NEXT: pand %xmm3, %xmm5
692 ; X86-SSE2-NEXT: pandn %xmm2, %xmm3
693 ; X86-SSE2-NEXT: por %xmm5, %xmm3
694 ; X86-SSE2-NEXT: movdqa %xmm3, %xmm2
695 ; X86-SSE2-NEXT: psrlw $6, %xmm2
696 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
697 ; X86-SSE2-NEXT: movdqa %xmm3, %xmm4
698 ; X86-SSE2-NEXT: psllw $2, %xmm4
699 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm4
700 ; X86-SSE2-NEXT: por %xmm2, %xmm4
701 ; X86-SSE2-NEXT: paddb %xmm1, %xmm1
702 ; X86-SSE2-NEXT: pxor %xmm2, %xmm2
703 ; X86-SSE2-NEXT: pcmpgtb %xmm1, %xmm2
704 ; X86-SSE2-NEXT: pand %xmm2, %xmm4
705 ; X86-SSE2-NEXT: pandn %xmm3, %xmm2
706 ; X86-SSE2-NEXT: por %xmm4, %xmm2
707 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm3
708 ; X86-SSE2-NEXT: psrlw $7, %xmm3
709 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm3
710 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm4
711 ; X86-SSE2-NEXT: paddb %xmm2, %xmm4
712 ; X86-SSE2-NEXT: por %xmm3, %xmm4
713 ; X86-SSE2-NEXT: paddb %xmm1, %xmm1
714 ; X86-SSE2-NEXT: pcmpgtb %xmm1, %xmm0
715 ; X86-SSE2-NEXT: pand %xmm0, %xmm4
716 ; X86-SSE2-NEXT: pandn %xmm2, %xmm0
717 ; X86-SSE2-NEXT: por %xmm4, %xmm0
718 ; X86-SSE2-NEXT: retl
719 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> %amt)
724 ; Uniform Variable Shifts
727 define <2 x i64> @splatvar_funnnel_v2i64(<2 x i64> %x, <2 x i64> %amt) nounwind {
728 ; SSE-LABEL: splatvar_funnnel_v2i64:
730 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [63,63]
731 ; SSE-NEXT: pxor %xmm3, %xmm3
732 ; SSE-NEXT: psubq %xmm1, %xmm3
733 ; SSE-NEXT: pand %xmm2, %xmm1
734 ; SSE-NEXT: movdqa %xmm0, %xmm4
735 ; SSE-NEXT: psllq %xmm1, %xmm4
736 ; SSE-NEXT: pand %xmm2, %xmm3
737 ; SSE-NEXT: psrlq %xmm3, %xmm0
738 ; SSE-NEXT: por %xmm4, %xmm0
741 ; AVX1-LABEL: splatvar_funnnel_v2i64:
743 ; AVX1-NEXT: vmovddup {{.*#+}} xmm2 = [63,63]
744 ; AVX1-NEXT: # xmm2 = mem[0,0]
745 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm3
746 ; AVX1-NEXT: vpsllq %xmm3, %xmm0, %xmm3
747 ; AVX1-NEXT: vpxor %xmm4, %xmm4, %xmm4
748 ; AVX1-NEXT: vpsubq %xmm1, %xmm4, %xmm1
749 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm1
750 ; AVX1-NEXT: vpsrlq %xmm1, %xmm0, %xmm0
751 ; AVX1-NEXT: vpor %xmm0, %xmm3, %xmm0
754 ; AVX2-LABEL: splatvar_funnnel_v2i64:
756 ; AVX2-NEXT: vpbroadcastq {{.*#+}} xmm2 = [63,63]
757 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm3
758 ; AVX2-NEXT: vpsllq %xmm3, %xmm0, %xmm3
759 ; AVX2-NEXT: vpxor %xmm4, %xmm4, %xmm4
760 ; AVX2-NEXT: vpsubq %xmm1, %xmm4, %xmm1
761 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm1
762 ; AVX2-NEXT: vpsrlq %xmm1, %xmm0, %xmm0
763 ; AVX2-NEXT: vpor %xmm0, %xmm3, %xmm0
766 ; AVX512F-LABEL: splatvar_funnnel_v2i64:
768 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
769 ; AVX512F-NEXT: vpbroadcastq %xmm1, %xmm1
770 ; AVX512F-NEXT: vprolvq %zmm1, %zmm0, %zmm0
771 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
772 ; AVX512F-NEXT: vzeroupper
775 ; AVX512VL-LABEL: splatvar_funnnel_v2i64:
777 ; AVX512VL-NEXT: vpbroadcastq %xmm1, %xmm1
778 ; AVX512VL-NEXT: vprolvq %xmm1, %xmm0, %xmm0
779 ; AVX512VL-NEXT: retq
781 ; AVX512BW-LABEL: splatvar_funnnel_v2i64:
783 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
784 ; AVX512BW-NEXT: vpbroadcastq %xmm1, %xmm1
785 ; AVX512BW-NEXT: vprolvq %zmm1, %zmm0, %zmm0
786 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
787 ; AVX512BW-NEXT: vzeroupper
788 ; AVX512BW-NEXT: retq
790 ; AVX512VLBW-LABEL: splatvar_funnnel_v2i64:
791 ; AVX512VLBW: # %bb.0:
792 ; AVX512VLBW-NEXT: vpbroadcastq %xmm1, %xmm1
793 ; AVX512VLBW-NEXT: vprolvq %xmm1, %xmm0, %xmm0
794 ; AVX512VLBW-NEXT: retq
796 ; AVX512VBMI2-LABEL: splatvar_funnnel_v2i64:
797 ; AVX512VBMI2: # %bb.0:
798 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
799 ; AVX512VBMI2-NEXT: vpbroadcastq %xmm1, %xmm1
800 ; AVX512VBMI2-NEXT: vprolvq %zmm1, %zmm0, %zmm0
801 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
802 ; AVX512VBMI2-NEXT: vzeroupper
803 ; AVX512VBMI2-NEXT: retq
805 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v2i64:
806 ; AVX512VLVBMI2: # %bb.0:
807 ; AVX512VLVBMI2-NEXT: vpbroadcastq %xmm1, %xmm1
808 ; AVX512VLVBMI2-NEXT: vprolvq %xmm1, %xmm0, %xmm0
809 ; AVX512VLVBMI2-NEXT: retq
811 ; XOPAVX1-LABEL: splatvar_funnnel_v2i64:
813 ; XOPAVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,1,0,1]
814 ; XOPAVX1-NEXT: vprotq %xmm1, %xmm0, %xmm0
817 ; XOPAVX2-LABEL: splatvar_funnnel_v2i64:
819 ; XOPAVX2-NEXT: vpbroadcastq %xmm1, %xmm1
820 ; XOPAVX2-NEXT: vprotq %xmm1, %xmm0, %xmm0
823 ; X86-SSE2-LABEL: splatvar_funnnel_v2i64:
825 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [63,0,63,0]
826 ; X86-SSE2-NEXT: pxor %xmm3, %xmm3
827 ; X86-SSE2-NEXT: psubq %xmm1, %xmm3
828 ; X86-SSE2-NEXT: pand %xmm2, %xmm1
829 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm4
830 ; X86-SSE2-NEXT: psllq %xmm1, %xmm4
831 ; X86-SSE2-NEXT: pand %xmm2, %xmm3
832 ; X86-SSE2-NEXT: psrlq %xmm3, %xmm0
833 ; X86-SSE2-NEXT: por %xmm4, %xmm0
834 ; X86-SSE2-NEXT: retl
835 %splat = shufflevector <2 x i64> %amt, <2 x i64> undef, <2 x i32> zeroinitializer
836 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> %splat)
840 define <4 x i32> @splatvar_funnnel_v4i32(<4 x i32> %x, <4 x i32> %amt) nounwind {
841 ; SSE-LABEL: splatvar_funnnel_v4i32:
843 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
844 ; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,2,3,3]
845 ; SSE-NEXT: psllq %xmm1, %xmm2
846 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
847 ; SSE-NEXT: psllq %xmm1, %xmm0
848 ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,3],xmm2[1,3]
851 ; AVX-LABEL: splatvar_funnnel_v4i32:
853 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
854 ; AVX-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[2,2,3,3]
855 ; AVX-NEXT: vpsllq %xmm1, %xmm2, %xmm2
856 ; AVX-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
857 ; AVX-NEXT: vpsllq %xmm1, %xmm0, %xmm0
858 ; AVX-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,3],xmm2[1,3]
861 ; AVX512F-LABEL: splatvar_funnnel_v4i32:
863 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
864 ; AVX512F-NEXT: vpbroadcastd %xmm1, %xmm1
865 ; AVX512F-NEXT: vprolvd %zmm1, %zmm0, %zmm0
866 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
867 ; AVX512F-NEXT: vzeroupper
870 ; AVX512VL-LABEL: splatvar_funnnel_v4i32:
872 ; AVX512VL-NEXT: vpbroadcastd %xmm1, %xmm1
873 ; AVX512VL-NEXT: vprolvd %xmm1, %xmm0, %xmm0
874 ; AVX512VL-NEXT: retq
876 ; AVX512BW-LABEL: splatvar_funnnel_v4i32:
878 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
879 ; AVX512BW-NEXT: vpbroadcastd %xmm1, %xmm1
880 ; AVX512BW-NEXT: vprolvd %zmm1, %zmm0, %zmm0
881 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
882 ; AVX512BW-NEXT: vzeroupper
883 ; AVX512BW-NEXT: retq
885 ; AVX512VLBW-LABEL: splatvar_funnnel_v4i32:
886 ; AVX512VLBW: # %bb.0:
887 ; AVX512VLBW-NEXT: vpbroadcastd %xmm1, %xmm1
888 ; AVX512VLBW-NEXT: vprolvd %xmm1, %xmm0, %xmm0
889 ; AVX512VLBW-NEXT: retq
891 ; AVX512VBMI2-LABEL: splatvar_funnnel_v4i32:
892 ; AVX512VBMI2: # %bb.0:
893 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
894 ; AVX512VBMI2-NEXT: vpbroadcastd %xmm1, %xmm1
895 ; AVX512VBMI2-NEXT: vprolvd %zmm1, %zmm0, %zmm0
896 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
897 ; AVX512VBMI2-NEXT: vzeroupper
898 ; AVX512VBMI2-NEXT: retq
900 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v4i32:
901 ; AVX512VLVBMI2: # %bb.0:
902 ; AVX512VLVBMI2-NEXT: vpbroadcastd %xmm1, %xmm1
903 ; AVX512VLVBMI2-NEXT: vprolvd %xmm1, %xmm0, %xmm0
904 ; AVX512VLVBMI2-NEXT: retq
906 ; XOPAVX1-LABEL: splatvar_funnnel_v4i32:
908 ; XOPAVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,0,0]
909 ; XOPAVX1-NEXT: vprotd %xmm1, %xmm0, %xmm0
912 ; XOPAVX2-LABEL: splatvar_funnnel_v4i32:
914 ; XOPAVX2-NEXT: vpbroadcastd %xmm1, %xmm1
915 ; XOPAVX2-NEXT: vprotd %xmm1, %xmm0, %xmm0
918 ; X86-SSE2-LABEL: splatvar_funnnel_v4i32:
920 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
921 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,2,3,3]
922 ; X86-SSE2-NEXT: psllq %xmm1, %xmm2
923 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
924 ; X86-SSE2-NEXT: psllq %xmm1, %xmm0
925 ; X86-SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,3],xmm2[1,3]
926 ; X86-SSE2-NEXT: retl
927 %splat = shufflevector <4 x i32> %amt, <4 x i32> undef, <4 x i32> zeroinitializer
928 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> %splat)
932 define <8 x i16> @splatvar_funnnel_v8i16(<8 x i16> %x, <8 x i16> %amt) nounwind {
933 ; SSE2-LABEL: splatvar_funnnel_v8i16:
935 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
936 ; SSE2-NEXT: movdqa %xmm0, %xmm2
937 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
938 ; SSE2-NEXT: pslld %xmm1, %xmm2
939 ; SSE2-NEXT: psrad $16, %xmm2
940 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
941 ; SSE2-NEXT: pslld %xmm1, %xmm0
942 ; SSE2-NEXT: psrad $16, %xmm0
943 ; SSE2-NEXT: packssdw %xmm2, %xmm0
946 ; SSE41-LABEL: splatvar_funnnel_v8i16:
948 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [15,0,0,0]
949 ; SSE41-NEXT: movdqa %xmm1, %xmm3
950 ; SSE41-NEXT: pandn %xmm2, %xmm3
951 ; SSE41-NEXT: movdqa %xmm0, %xmm4
952 ; SSE41-NEXT: psrlw $1, %xmm4
953 ; SSE41-NEXT: psrlw %xmm3, %xmm4
954 ; SSE41-NEXT: pand %xmm2, %xmm1
955 ; SSE41-NEXT: psllw %xmm1, %xmm0
956 ; SSE41-NEXT: por %xmm4, %xmm0
959 ; AVX-LABEL: splatvar_funnnel_v8i16:
961 ; AVX-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
962 ; AVX-NEXT: vpandn %xmm2, %xmm1, %xmm3
963 ; AVX-NEXT: vpsrlw $1, %xmm0, %xmm4
964 ; AVX-NEXT: vpsrlw %xmm3, %xmm4, %xmm3
965 ; AVX-NEXT: vpand %xmm2, %xmm1, %xmm1
966 ; AVX-NEXT: vpsllw %xmm1, %xmm0, %xmm0
967 ; AVX-NEXT: vpor %xmm3, %xmm0, %xmm0
970 ; AVX512F-LABEL: splatvar_funnnel_v8i16:
972 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
973 ; AVX512F-NEXT: vpandn %xmm2, %xmm1, %xmm3
974 ; AVX512F-NEXT: vpsrlw $1, %xmm0, %xmm4
975 ; AVX512F-NEXT: vpsrlw %xmm3, %xmm4, %xmm3
976 ; AVX512F-NEXT: vpand %xmm2, %xmm1, %xmm1
977 ; AVX512F-NEXT: vpsllw %xmm1, %xmm0, %xmm0
978 ; AVX512F-NEXT: vpor %xmm3, %xmm0, %xmm0
981 ; AVX512VL-LABEL: splatvar_funnnel_v8i16:
983 ; AVX512VL-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
984 ; AVX512VL-NEXT: vpandn %xmm2, %xmm1, %xmm3
985 ; AVX512VL-NEXT: vpsrlw $1, %xmm0, %xmm4
986 ; AVX512VL-NEXT: vpsrlw %xmm3, %xmm4, %xmm3
987 ; AVX512VL-NEXT: vpand %xmm2, %xmm1, %xmm1
988 ; AVX512VL-NEXT: vpsllw %xmm1, %xmm0, %xmm0
989 ; AVX512VL-NEXT: vpor %xmm3, %xmm0, %xmm0
990 ; AVX512VL-NEXT: retq
992 ; AVX512BW-LABEL: splatvar_funnnel_v8i16:
994 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
995 ; AVX512BW-NEXT: vpandn %xmm2, %xmm1, %xmm3
996 ; AVX512BW-NEXT: vpsrlw $1, %xmm0, %xmm4
997 ; AVX512BW-NEXT: vpsrlw %xmm3, %xmm4, %xmm3
998 ; AVX512BW-NEXT: vpand %xmm2, %xmm1, %xmm1
999 ; AVX512BW-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1000 ; AVX512BW-NEXT: vpor %xmm3, %xmm0, %xmm0
1001 ; AVX512BW-NEXT: retq
1003 ; AVX512VLBW-LABEL: splatvar_funnnel_v8i16:
1004 ; AVX512VLBW: # %bb.0:
1005 ; AVX512VLBW-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
1006 ; AVX512VLBW-NEXT: vpandn %xmm2, %xmm1, %xmm3
1007 ; AVX512VLBW-NEXT: vpsrlw $1, %xmm0, %xmm4
1008 ; AVX512VLBW-NEXT: vpsrlw %xmm3, %xmm4, %xmm3
1009 ; AVX512VLBW-NEXT: vpand %xmm2, %xmm1, %xmm1
1010 ; AVX512VLBW-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1011 ; AVX512VLBW-NEXT: vpor %xmm3, %xmm0, %xmm0
1012 ; AVX512VLBW-NEXT: retq
1014 ; AVX512VBMI2-LABEL: splatvar_funnnel_v8i16:
1015 ; AVX512VBMI2: # %bb.0:
1016 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1017 ; AVX512VBMI2-NEXT: vpbroadcastw %xmm1, %xmm1
1018 ; AVX512VBMI2-NEXT: vpshldvw %zmm1, %zmm0, %zmm0
1019 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1020 ; AVX512VBMI2-NEXT: vzeroupper
1021 ; AVX512VBMI2-NEXT: retq
1023 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v8i16:
1024 ; AVX512VLVBMI2: # %bb.0:
1025 ; AVX512VLVBMI2-NEXT: vpbroadcastw %xmm1, %xmm1
1026 ; AVX512VLVBMI2-NEXT: vpshldvw %xmm1, %xmm0, %xmm0
1027 ; AVX512VLVBMI2-NEXT: retq
1029 ; XOPAVX1-LABEL: splatvar_funnnel_v8i16:
1031 ; XOPAVX1-NEXT: vpshuflw {{.*#+}} xmm1 = xmm1[0,0,0,0,4,5,6,7]
1032 ; XOPAVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,0,0]
1033 ; XOPAVX1-NEXT: vprotw %xmm1, %xmm0, %xmm0
1034 ; XOPAVX1-NEXT: retq
1036 ; XOPAVX2-LABEL: splatvar_funnnel_v8i16:
1038 ; XOPAVX2-NEXT: vpbroadcastw %xmm1, %xmm1
1039 ; XOPAVX2-NEXT: vprotw %xmm1, %xmm0, %xmm0
1040 ; XOPAVX2-NEXT: retq
1042 ; X86-SSE2-LABEL: splatvar_funnnel_v8i16:
1043 ; X86-SSE2: # %bb.0:
1044 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1045 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1046 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
1047 ; X86-SSE2-NEXT: pslld %xmm1, %xmm2
1048 ; X86-SSE2-NEXT: psrad $16, %xmm2
1049 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1050 ; X86-SSE2-NEXT: pslld %xmm1, %xmm0
1051 ; X86-SSE2-NEXT: psrad $16, %xmm0
1052 ; X86-SSE2-NEXT: packssdw %xmm2, %xmm0
1053 ; X86-SSE2-NEXT: retl
1054 %splat = shufflevector <8 x i16> %amt, <8 x i16> undef, <8 x i32> zeroinitializer
1055 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> %splat)
1059 define <16 x i8> @splatvar_funnnel_v16i8(<16 x i8> %x, <16 x i8> %amt) nounwind {
1060 ; SSE-LABEL: splatvar_funnnel_v16i8:
1062 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1063 ; SSE-NEXT: movdqa %xmm0, %xmm2
1064 ; SSE-NEXT: punpckhbw {{.*#+}} xmm2 = xmm2[8],xmm0[8],xmm2[9],xmm0[9],xmm2[10],xmm0[10],xmm2[11],xmm0[11],xmm2[12],xmm0[12],xmm2[13],xmm0[13],xmm2[14],xmm0[14],xmm2[15],xmm0[15]
1065 ; SSE-NEXT: psllw %xmm1, %xmm2
1066 ; SSE-NEXT: psrlw $8, %xmm2
1067 ; SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1068 ; SSE-NEXT: psllw %xmm1, %xmm0
1069 ; SSE-NEXT: psrlw $8, %xmm0
1070 ; SSE-NEXT: packuswb %xmm2, %xmm0
1073 ; AVX-LABEL: splatvar_funnnel_v16i8:
1075 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1076 ; AVX-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1077 ; AVX-NEXT: vpsllw %xmm1, %xmm2, %xmm2
1078 ; AVX-NEXT: vpsrlw $8, %xmm2, %xmm2
1079 ; AVX-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1080 ; AVX-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1081 ; AVX-NEXT: vpsrlw $8, %xmm0, %xmm0
1082 ; AVX-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1085 ; AVX512F-LABEL: splatvar_funnnel_v16i8:
1087 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1088 ; AVX512F-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1089 ; AVX512F-NEXT: vpsllw %xmm1, %xmm2, %xmm2
1090 ; AVX512F-NEXT: vpsrlw $8, %xmm2, %xmm2
1091 ; AVX512F-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1092 ; AVX512F-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1093 ; AVX512F-NEXT: vpsrlw $8, %xmm0, %xmm0
1094 ; AVX512F-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1095 ; AVX512F-NEXT: retq
1097 ; AVX512VL-LABEL: splatvar_funnnel_v16i8:
1098 ; AVX512VL: # %bb.0:
1099 ; AVX512VL-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1100 ; AVX512VL-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1101 ; AVX512VL-NEXT: vpsllw %xmm1, %xmm2, %xmm2
1102 ; AVX512VL-NEXT: vpsrlw $8, %xmm2, %xmm2
1103 ; AVX512VL-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1104 ; AVX512VL-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1105 ; AVX512VL-NEXT: vpsrlw $8, %xmm0, %xmm0
1106 ; AVX512VL-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1107 ; AVX512VL-NEXT: retq
1109 ; AVX512BW-LABEL: splatvar_funnnel_v16i8:
1110 ; AVX512BW: # %bb.0:
1111 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1112 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1113 ; AVX512BW-NEXT: vpsllw %xmm1, %xmm2, %xmm2
1114 ; AVX512BW-NEXT: vpsrlw $8, %xmm2, %xmm2
1115 ; AVX512BW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1116 ; AVX512BW-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1117 ; AVX512BW-NEXT: vpsrlw $8, %xmm0, %xmm0
1118 ; AVX512BW-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1119 ; AVX512BW-NEXT: retq
1121 ; AVX512VLBW-LABEL: splatvar_funnnel_v16i8:
1122 ; AVX512VLBW: # %bb.0:
1123 ; AVX512VLBW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1124 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1125 ; AVX512VLBW-NEXT: vpsllw %xmm1, %xmm2, %xmm2
1126 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm2, %xmm2
1127 ; AVX512VLBW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1128 ; AVX512VLBW-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1129 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm0, %xmm0
1130 ; AVX512VLBW-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1131 ; AVX512VLBW-NEXT: retq
1133 ; AVX512VBMI2-LABEL: splatvar_funnnel_v16i8:
1134 ; AVX512VBMI2: # %bb.0:
1135 ; AVX512VBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1136 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1137 ; AVX512VBMI2-NEXT: vpsllw %xmm1, %xmm2, %xmm2
1138 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm2, %xmm2
1139 ; AVX512VBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1140 ; AVX512VBMI2-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1141 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1142 ; AVX512VBMI2-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1143 ; AVX512VBMI2-NEXT: retq
1145 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v16i8:
1146 ; AVX512VLVBMI2: # %bb.0:
1147 ; AVX512VLVBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1148 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1149 ; AVX512VLVBMI2-NEXT: vpsllw %xmm1, %xmm2, %xmm2
1150 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm2, %xmm2
1151 ; AVX512VLVBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1152 ; AVX512VLVBMI2-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1153 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1154 ; AVX512VLVBMI2-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1155 ; AVX512VLVBMI2-NEXT: retq
1157 ; XOPAVX1-LABEL: splatvar_funnnel_v16i8:
1159 ; XOPAVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1160 ; XOPAVX1-NEXT: vpshufb %xmm2, %xmm1, %xmm1
1161 ; XOPAVX1-NEXT: vprotb %xmm1, %xmm0, %xmm0
1162 ; XOPAVX1-NEXT: retq
1164 ; XOPAVX2-LABEL: splatvar_funnnel_v16i8:
1166 ; XOPAVX2-NEXT: vpbroadcastb %xmm1, %xmm1
1167 ; XOPAVX2-NEXT: vprotb %xmm1, %xmm0, %xmm0
1168 ; XOPAVX2-NEXT: retq
1170 ; X86-SSE2-LABEL: splatvar_funnnel_v16i8:
1171 ; X86-SSE2: # %bb.0:
1172 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1173 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1174 ; X86-SSE2-NEXT: punpckhbw {{.*#+}} xmm2 = xmm2[8],xmm0[8],xmm2[9],xmm0[9],xmm2[10],xmm0[10],xmm2[11],xmm0[11],xmm2[12],xmm0[12],xmm2[13],xmm0[13],xmm2[14],xmm0[14],xmm2[15],xmm0[15]
1175 ; X86-SSE2-NEXT: psllw %xmm1, %xmm2
1176 ; X86-SSE2-NEXT: psrlw $8, %xmm2
1177 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1178 ; X86-SSE2-NEXT: psllw %xmm1, %xmm0
1179 ; X86-SSE2-NEXT: psrlw $8, %xmm0
1180 ; X86-SSE2-NEXT: packuswb %xmm2, %xmm0
1181 ; X86-SSE2-NEXT: retl
1182 %splat = shufflevector <16 x i8> %amt, <16 x i8> undef, <16 x i32> zeroinitializer
1183 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> %splat)
1191 define <2 x i64> @constant_funnnel_v2i64(<2 x i64> %x) nounwind {
1192 ; SSE2-LABEL: constant_funnnel_v2i64:
1194 ; SSE2-NEXT: movdqa %xmm0, %xmm1
1195 ; SSE2-NEXT: psrlq $60, %xmm1
1196 ; SSE2-NEXT: movdqa %xmm0, %xmm2
1197 ; SSE2-NEXT: psrlq $50, %xmm2
1198 ; SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm1[0],xmm2[1]
1199 ; SSE2-NEXT: movdqa %xmm0, %xmm1
1200 ; SSE2-NEXT: psllq $4, %xmm1
1201 ; SSE2-NEXT: psllq $14, %xmm0
1202 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
1203 ; SSE2-NEXT: orpd %xmm2, %xmm0
1206 ; SSE41-LABEL: constant_funnnel_v2i64:
1208 ; SSE41-NEXT: movdqa %xmm0, %xmm1
1209 ; SSE41-NEXT: psrlq $50, %xmm1
1210 ; SSE41-NEXT: movdqa %xmm0, %xmm2
1211 ; SSE41-NEXT: psrlq $60, %xmm2
1212 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1,2,3],xmm1[4,5,6,7]
1213 ; SSE41-NEXT: movdqa %xmm0, %xmm1
1214 ; SSE41-NEXT: psllq $14, %xmm1
1215 ; SSE41-NEXT: psllq $4, %xmm0
1216 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]
1217 ; SSE41-NEXT: por %xmm2, %xmm0
1220 ; AVX1-LABEL: constant_funnnel_v2i64:
1222 ; AVX1-NEXT: vpsrlq $50, %xmm0, %xmm1
1223 ; AVX1-NEXT: vpsrlq $60, %xmm0, %xmm2
1224 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm2[0,1,2,3],xmm1[4,5,6,7]
1225 ; AVX1-NEXT: vpsllq $14, %xmm0, %xmm2
1226 ; AVX1-NEXT: vpsllq $4, %xmm0, %xmm0
1227 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm2[4,5,6,7]
1228 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
1231 ; AVX2-LABEL: constant_funnnel_v2i64:
1233 ; AVX2-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1
1234 ; AVX2-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1235 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1238 ; AVX512F-LABEL: constant_funnnel_v2i64:
1240 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1241 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm1 = [4,14]
1242 ; AVX512F-NEXT: vprolvq %zmm1, %zmm0, %zmm0
1243 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1244 ; AVX512F-NEXT: vzeroupper
1245 ; AVX512F-NEXT: retq
1247 ; AVX512VL-LABEL: constant_funnnel_v2i64:
1248 ; AVX512VL: # %bb.0:
1249 ; AVX512VL-NEXT: vprolvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1250 ; AVX512VL-NEXT: retq
1252 ; AVX512BW-LABEL: constant_funnnel_v2i64:
1253 ; AVX512BW: # %bb.0:
1254 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1255 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [4,14]
1256 ; AVX512BW-NEXT: vprolvq %zmm1, %zmm0, %zmm0
1257 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1258 ; AVX512BW-NEXT: vzeroupper
1259 ; AVX512BW-NEXT: retq
1261 ; AVX512VLBW-LABEL: constant_funnnel_v2i64:
1262 ; AVX512VLBW: # %bb.0:
1263 ; AVX512VLBW-NEXT: vprolvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1264 ; AVX512VLBW-NEXT: retq
1266 ; AVX512VBMI2-LABEL: constant_funnnel_v2i64:
1267 ; AVX512VBMI2: # %bb.0:
1268 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1269 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [4,14]
1270 ; AVX512VBMI2-NEXT: vprolvq %zmm1, %zmm0, %zmm0
1271 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1272 ; AVX512VBMI2-NEXT: vzeroupper
1273 ; AVX512VBMI2-NEXT: retq
1275 ; AVX512VLVBMI2-LABEL: constant_funnnel_v2i64:
1276 ; AVX512VLVBMI2: # %bb.0:
1277 ; AVX512VLVBMI2-NEXT: vprolvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1278 ; AVX512VLVBMI2-NEXT: retq
1280 ; XOP-LABEL: constant_funnnel_v2i64:
1282 ; XOP-NEXT: vprotq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1285 ; X86-SSE2-LABEL: constant_funnnel_v2i64:
1286 ; X86-SSE2: # %bb.0:
1287 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1288 ; X86-SSE2-NEXT: psrlq $60, %xmm1
1289 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1290 ; X86-SSE2-NEXT: psrlq $50, %xmm2
1291 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm1[0],xmm2[1]
1292 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1293 ; X86-SSE2-NEXT: psllq $4, %xmm1
1294 ; X86-SSE2-NEXT: psllq $14, %xmm0
1295 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
1296 ; X86-SSE2-NEXT: orpd %xmm2, %xmm0
1297 ; X86-SSE2-NEXT: retl
1298 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> <i64 4, i64 14>)
1302 define <4 x i32> @constant_funnnel_v4i32(<4 x i32> %x) nounwind {
1303 ; SSE2-LABEL: constant_funnnel_v4i32:
1305 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1306 ; SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1307 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,2,3]
1308 ; SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1309 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,3,2,3]
1310 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
1311 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
1312 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
1313 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1314 ; SSE2-NEXT: por %xmm2, %xmm0
1317 ; SSE41-LABEL: constant_funnnel_v4i32:
1319 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1320 ; SSE41-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1321 ; SSE41-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1322 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
1323 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7]
1324 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,0,2,2]
1325 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3],xmm0[4,5],xmm1[6,7]
1326 ; SSE41-NEXT: por %xmm2, %xmm0
1329 ; AVX1-LABEL: constant_funnnel_v4i32:
1331 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1332 ; AVX1-NEXT: vpmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1333 ; AVX1-NEXT: vpmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1334 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
1335 ; AVX1-NEXT: vpblendw {{.*#+}} xmm2 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7]
1336 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,2,2]
1337 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3],xmm0[4,5],xmm1[6,7]
1338 ; AVX1-NEXT: vpor %xmm2, %xmm0, %xmm0
1341 ; AVX2-LABEL: constant_funnnel_v4i32:
1343 ; AVX2-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1
1344 ; AVX2-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1345 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1348 ; AVX512F-LABEL: constant_funnnel_v4i32:
1350 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1351 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm1 = [4,5,6,7]
1352 ; AVX512F-NEXT: vprolvd %zmm1, %zmm0, %zmm0
1353 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1354 ; AVX512F-NEXT: vzeroupper
1355 ; AVX512F-NEXT: retq
1357 ; AVX512VL-LABEL: constant_funnnel_v4i32:
1358 ; AVX512VL: # %bb.0:
1359 ; AVX512VL-NEXT: vprolvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1360 ; AVX512VL-NEXT: retq
1362 ; AVX512BW-LABEL: constant_funnnel_v4i32:
1363 ; AVX512BW: # %bb.0:
1364 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1365 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [4,5,6,7]
1366 ; AVX512BW-NEXT: vprolvd %zmm1, %zmm0, %zmm0
1367 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1368 ; AVX512BW-NEXT: vzeroupper
1369 ; AVX512BW-NEXT: retq
1371 ; AVX512VLBW-LABEL: constant_funnnel_v4i32:
1372 ; AVX512VLBW: # %bb.0:
1373 ; AVX512VLBW-NEXT: vprolvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1374 ; AVX512VLBW-NEXT: retq
1376 ; AVX512VBMI2-LABEL: constant_funnnel_v4i32:
1377 ; AVX512VBMI2: # %bb.0:
1378 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1379 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [4,5,6,7]
1380 ; AVX512VBMI2-NEXT: vprolvd %zmm1, %zmm0, %zmm0
1381 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1382 ; AVX512VBMI2-NEXT: vzeroupper
1383 ; AVX512VBMI2-NEXT: retq
1385 ; AVX512VLVBMI2-LABEL: constant_funnnel_v4i32:
1386 ; AVX512VLVBMI2: # %bb.0:
1387 ; AVX512VLVBMI2-NEXT: vprolvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1388 ; AVX512VLVBMI2-NEXT: retq
1390 ; XOP-LABEL: constant_funnnel_v4i32:
1392 ; XOP-NEXT: vprotd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1395 ; X86-SSE2-LABEL: constant_funnnel_v4i32:
1396 ; X86-SSE2: # %bb.0:
1397 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1398 ; X86-SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1399 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,2,3]
1400 ; X86-SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1401 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,3,2,3]
1402 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
1403 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
1404 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
1405 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1406 ; X86-SSE2-NEXT: por %xmm2, %xmm0
1407 ; X86-SSE2-NEXT: retl
1408 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> <i32 4, i32 5, i32 6, i32 7>)
1412 define <8 x i16> @constant_funnnel_v8i16(<8 x i16> %x) nounwind {
1413 ; SSE-LABEL: constant_funnnel_v8i16:
1415 ; SSE-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
1416 ; SSE-NEXT: movdqa %xmm0, %xmm2
1417 ; SSE-NEXT: pmulhuw %xmm1, %xmm2
1418 ; SSE-NEXT: pmullw %xmm1, %xmm0
1419 ; SSE-NEXT: por %xmm2, %xmm0
1422 ; AVX-LABEL: constant_funnnel_v8i16:
1424 ; AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
1425 ; AVX-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
1426 ; AVX-NEXT: vpmullw %xmm1, %xmm0, %xmm0
1427 ; AVX-NEXT: vpor %xmm2, %xmm0, %xmm0
1430 ; AVX512F-LABEL: constant_funnnel_v8i16:
1432 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
1433 ; AVX512F-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
1434 ; AVX512F-NEXT: vpmullw %xmm1, %xmm0, %xmm0
1435 ; AVX512F-NEXT: vpor %xmm2, %xmm0, %xmm0
1436 ; AVX512F-NEXT: retq
1438 ; AVX512VL-LABEL: constant_funnnel_v8i16:
1439 ; AVX512VL: # %bb.0:
1440 ; AVX512VL-NEXT: vmovdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
1441 ; AVX512VL-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
1442 ; AVX512VL-NEXT: vpmullw %xmm1, %xmm0, %xmm0
1443 ; AVX512VL-NEXT: vpor %xmm2, %xmm0, %xmm0
1444 ; AVX512VL-NEXT: retq
1446 ; AVX512BW-LABEL: constant_funnnel_v8i16:
1447 ; AVX512BW: # %bb.0:
1448 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1449 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [16,15,14,13,12,11,10,9]
1450 ; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm1
1451 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,2,3,4,5,6,7]
1452 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
1453 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1454 ; AVX512BW-NEXT: vzeroupper
1455 ; AVX512BW-NEXT: retq
1457 ; AVX512VLBW-LABEL: constant_funnnel_v8i16:
1458 ; AVX512VLBW: # %bb.0:
1459 ; AVX512VLBW-NEXT: vpsrlvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1
1460 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1461 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1462 ; AVX512VLBW-NEXT: retq
1464 ; AVX512VBMI2-LABEL: constant_funnnel_v8i16:
1465 ; AVX512VBMI2: # %bb.0:
1466 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1467 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [0,1,2,3,4,5,6,7]
1468 ; AVX512VBMI2-NEXT: vpshldvw %zmm1, %zmm0, %zmm0
1469 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1470 ; AVX512VBMI2-NEXT: vzeroupper
1471 ; AVX512VBMI2-NEXT: retq
1473 ; AVX512VLVBMI2-LABEL: constant_funnnel_v8i16:
1474 ; AVX512VLVBMI2: # %bb.0:
1475 ; AVX512VLVBMI2-NEXT: vpshldvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1476 ; AVX512VLVBMI2-NEXT: retq
1478 ; XOP-LABEL: constant_funnnel_v8i16:
1480 ; XOP-NEXT: vprotw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1483 ; X86-SSE2-LABEL: constant_funnnel_v8i16:
1484 ; X86-SSE2: # %bb.0:
1485 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
1486 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1487 ; X86-SSE2-NEXT: pmulhuw %xmm1, %xmm2
1488 ; X86-SSE2-NEXT: pmullw %xmm1, %xmm0
1489 ; X86-SSE2-NEXT: por %xmm2, %xmm0
1490 ; X86-SSE2-NEXT: retl
1491 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>)
1495 define <16 x i8> @constant_funnnel_v16i8(<16 x i8> %x) nounwind {
1496 ; SSE-LABEL: constant_funnnel_v16i8:
1498 ; SSE-NEXT: movdqa %xmm0, %xmm1
1499 ; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
1500 ; SSE-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1501 ; SSE-NEXT: psrlw $8, %xmm1
1502 ; SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1503 ; SSE-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1504 ; SSE-NEXT: psrlw $8, %xmm0
1505 ; SSE-NEXT: packuswb %xmm1, %xmm0
1508 ; AVX-LABEL: constant_funnnel_v16i8:
1510 ; AVX-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1511 ; AVX-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1512 ; AVX-NEXT: vpsrlw $8, %xmm1, %xmm1
1513 ; AVX-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1514 ; AVX-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1515 ; AVX-NEXT: vpsrlw $8, %xmm0, %xmm0
1516 ; AVX-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1519 ; AVX512F-LABEL: constant_funnnel_v16i8:
1521 ; AVX512F-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1522 ; AVX512F-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1523 ; AVX512F-NEXT: vpsrlw $8, %xmm1, %xmm1
1524 ; AVX512F-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1525 ; AVX512F-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1526 ; AVX512F-NEXT: vpsrlw $8, %xmm0, %xmm0
1527 ; AVX512F-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1528 ; AVX512F-NEXT: retq
1530 ; AVX512VL-LABEL: constant_funnnel_v16i8:
1531 ; AVX512VL: # %bb.0:
1532 ; AVX512VL-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1533 ; AVX512VL-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1534 ; AVX512VL-NEXT: vpsrlw $8, %xmm1, %xmm1
1535 ; AVX512VL-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1536 ; AVX512VL-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1537 ; AVX512VL-NEXT: vpsrlw $8, %xmm0, %xmm0
1538 ; AVX512VL-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1539 ; AVX512VL-NEXT: retq
1541 ; AVX512BW-LABEL: constant_funnnel_v16i8:
1542 ; AVX512BW: # %bb.0:
1543 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [0,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0]
1544 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1545 ; AVX512BW-NEXT: vpsllvw %zmm1, %zmm2, %zmm1
1546 ; AVX512BW-NEXT: vpsrlw $8, %xmm1, %xmm1
1547 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0]
1548 ; AVX512BW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1549 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
1550 ; AVX512BW-NEXT: vpsrlw $8, %xmm0, %xmm0
1551 ; AVX512BW-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1552 ; AVX512BW-NEXT: vzeroupper
1553 ; AVX512BW-NEXT: retq
1555 ; AVX512VLBW-LABEL: constant_funnnel_v16i8:
1556 ; AVX512VLBW: # %bb.0:
1557 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1558 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1559 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm1, %xmm1
1560 ; AVX512VLBW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1561 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1562 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm0, %xmm0
1563 ; AVX512VLBW-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1564 ; AVX512VLBW-NEXT: retq
1566 ; AVX512VBMI2-LABEL: constant_funnnel_v16i8:
1567 ; AVX512VBMI2: # %bb.0:
1568 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [0,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0]
1569 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1570 ; AVX512VBMI2-NEXT: vpsllvw %zmm1, %zmm2, %zmm1
1571 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm1, %xmm1
1572 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm2 = [0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0]
1573 ; AVX512VBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1574 ; AVX512VBMI2-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
1575 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1576 ; AVX512VBMI2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1577 ; AVX512VBMI2-NEXT: vzeroupper
1578 ; AVX512VBMI2-NEXT: retq
1580 ; AVX512VLVBMI2-LABEL: constant_funnnel_v16i8:
1581 ; AVX512VLVBMI2: # %bb.0:
1582 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1583 ; AVX512VLVBMI2-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1584 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm1, %xmm1
1585 ; AVX512VLVBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1586 ; AVX512VLVBMI2-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1587 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1588 ; AVX512VLVBMI2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1589 ; AVX512VLVBMI2-NEXT: retq
1591 ; XOP-LABEL: constant_funnnel_v16i8:
1593 ; XOP-NEXT: vprotb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1596 ; X86-SSE2-LABEL: constant_funnnel_v16i8:
1597 ; X86-SSE2: # %bb.0:
1598 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1599 ; X86-SSE2-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
1600 ; X86-SSE2-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1601 ; X86-SSE2-NEXT: psrlw $8, %xmm1
1602 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1603 ; X86-SSE2-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1604 ; X86-SSE2-NEXT: psrlw $8, %xmm0
1605 ; X86-SSE2-NEXT: packuswb %xmm1, %xmm0
1606 ; X86-SSE2-NEXT: retl
1607 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1>)
1612 ; Uniform Constant Shifts
1615 define <2 x i64> @splatconstant_funnnel_v2i64(<2 x i64> %x) nounwind {
1616 ; SSE-LABEL: splatconstant_funnnel_v2i64:
1618 ; SSE-NEXT: movdqa %xmm0, %xmm1
1619 ; SSE-NEXT: psrlq $50, %xmm1
1620 ; SSE-NEXT: psllq $14, %xmm0
1621 ; SSE-NEXT: por %xmm1, %xmm0
1624 ; AVX-LABEL: splatconstant_funnnel_v2i64:
1626 ; AVX-NEXT: vpsrlq $50, %xmm0, %xmm1
1627 ; AVX-NEXT: vpsllq $14, %xmm0, %xmm0
1628 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1631 ; AVX512F-LABEL: splatconstant_funnnel_v2i64:
1633 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1634 ; AVX512F-NEXT: vprolq $14, %zmm0, %zmm0
1635 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1636 ; AVX512F-NEXT: vzeroupper
1637 ; AVX512F-NEXT: retq
1639 ; AVX512VL-LABEL: splatconstant_funnnel_v2i64:
1640 ; AVX512VL: # %bb.0:
1641 ; AVX512VL-NEXT: vprolq $14, %xmm0, %xmm0
1642 ; AVX512VL-NEXT: retq
1644 ; AVX512BW-LABEL: splatconstant_funnnel_v2i64:
1645 ; AVX512BW: # %bb.0:
1646 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1647 ; AVX512BW-NEXT: vprolq $14, %zmm0, %zmm0
1648 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1649 ; AVX512BW-NEXT: vzeroupper
1650 ; AVX512BW-NEXT: retq
1652 ; AVX512VLBW-LABEL: splatconstant_funnnel_v2i64:
1653 ; AVX512VLBW: # %bb.0:
1654 ; AVX512VLBW-NEXT: vprolq $14, %xmm0, %xmm0
1655 ; AVX512VLBW-NEXT: retq
1657 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v2i64:
1658 ; AVX512VBMI2: # %bb.0:
1659 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1660 ; AVX512VBMI2-NEXT: vprolq $14, %zmm0, %zmm0
1661 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1662 ; AVX512VBMI2-NEXT: vzeroupper
1663 ; AVX512VBMI2-NEXT: retq
1665 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v2i64:
1666 ; AVX512VLVBMI2: # %bb.0:
1667 ; AVX512VLVBMI2-NEXT: vprolq $14, %xmm0, %xmm0
1668 ; AVX512VLVBMI2-NEXT: retq
1670 ; XOP-LABEL: splatconstant_funnnel_v2i64:
1672 ; XOP-NEXT: vprotq $14, %xmm0, %xmm0
1675 ; X86-SSE2-LABEL: splatconstant_funnnel_v2i64:
1676 ; X86-SSE2: # %bb.0:
1677 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1678 ; X86-SSE2-NEXT: psrlq $50, %xmm1
1679 ; X86-SSE2-NEXT: psllq $14, %xmm0
1680 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1681 ; X86-SSE2-NEXT: retl
1682 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> <i64 14, i64 14>)
1686 define <4 x i32> @splatconstant_funnnel_v4i32(<4 x i32> %x) nounwind {
1687 ; SSE-LABEL: splatconstant_funnnel_v4i32:
1689 ; SSE-NEXT: movdqa %xmm0, %xmm1
1690 ; SSE-NEXT: psrld $28, %xmm1
1691 ; SSE-NEXT: pslld $4, %xmm0
1692 ; SSE-NEXT: por %xmm1, %xmm0
1695 ; AVX-LABEL: splatconstant_funnnel_v4i32:
1697 ; AVX-NEXT: vpsrld $28, %xmm0, %xmm1
1698 ; AVX-NEXT: vpslld $4, %xmm0, %xmm0
1699 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1702 ; AVX512F-LABEL: splatconstant_funnnel_v4i32:
1704 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1705 ; AVX512F-NEXT: vprold $4, %zmm0, %zmm0
1706 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1707 ; AVX512F-NEXT: vzeroupper
1708 ; AVX512F-NEXT: retq
1710 ; AVX512VL-LABEL: splatconstant_funnnel_v4i32:
1711 ; AVX512VL: # %bb.0:
1712 ; AVX512VL-NEXT: vprold $4, %xmm0, %xmm0
1713 ; AVX512VL-NEXT: retq
1715 ; AVX512BW-LABEL: splatconstant_funnnel_v4i32:
1716 ; AVX512BW: # %bb.0:
1717 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1718 ; AVX512BW-NEXT: vprold $4, %zmm0, %zmm0
1719 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1720 ; AVX512BW-NEXT: vzeroupper
1721 ; AVX512BW-NEXT: retq
1723 ; AVX512VLBW-LABEL: splatconstant_funnnel_v4i32:
1724 ; AVX512VLBW: # %bb.0:
1725 ; AVX512VLBW-NEXT: vprold $4, %xmm0, %xmm0
1726 ; AVX512VLBW-NEXT: retq
1728 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v4i32:
1729 ; AVX512VBMI2: # %bb.0:
1730 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1731 ; AVX512VBMI2-NEXT: vprold $4, %zmm0, %zmm0
1732 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1733 ; AVX512VBMI2-NEXT: vzeroupper
1734 ; AVX512VBMI2-NEXT: retq
1736 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v4i32:
1737 ; AVX512VLVBMI2: # %bb.0:
1738 ; AVX512VLVBMI2-NEXT: vprold $4, %xmm0, %xmm0
1739 ; AVX512VLVBMI2-NEXT: retq
1741 ; XOP-LABEL: splatconstant_funnnel_v4i32:
1743 ; XOP-NEXT: vprotd $4, %xmm0, %xmm0
1746 ; X86-SSE2-LABEL: splatconstant_funnnel_v4i32:
1747 ; X86-SSE2: # %bb.0:
1748 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1749 ; X86-SSE2-NEXT: psrld $28, %xmm1
1750 ; X86-SSE2-NEXT: pslld $4, %xmm0
1751 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1752 ; X86-SSE2-NEXT: retl
1753 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> <i32 4, i32 4, i32 4, i32 4>)
1757 define <8 x i16> @splatconstant_funnnel_v8i16(<8 x i16> %x) nounwind {
1758 ; SSE-LABEL: splatconstant_funnnel_v8i16:
1760 ; SSE-NEXT: movdqa %xmm0, %xmm1
1761 ; SSE-NEXT: psrlw $9, %xmm1
1762 ; SSE-NEXT: psllw $7, %xmm0
1763 ; SSE-NEXT: por %xmm1, %xmm0
1766 ; AVX-LABEL: splatconstant_funnnel_v8i16:
1768 ; AVX-NEXT: vpsrlw $9, %xmm0, %xmm1
1769 ; AVX-NEXT: vpsllw $7, %xmm0, %xmm0
1770 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1773 ; AVX512F-LABEL: splatconstant_funnnel_v8i16:
1775 ; AVX512F-NEXT: vpsrlw $9, %xmm0, %xmm1
1776 ; AVX512F-NEXT: vpsllw $7, %xmm0, %xmm0
1777 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
1778 ; AVX512F-NEXT: retq
1780 ; AVX512VL-LABEL: splatconstant_funnnel_v8i16:
1781 ; AVX512VL: # %bb.0:
1782 ; AVX512VL-NEXT: vpsrlw $9, %xmm0, %xmm1
1783 ; AVX512VL-NEXT: vpsllw $7, %xmm0, %xmm0
1784 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
1785 ; AVX512VL-NEXT: retq
1787 ; AVX512BW-LABEL: splatconstant_funnnel_v8i16:
1788 ; AVX512BW: # %bb.0:
1789 ; AVX512BW-NEXT: vpsrlw $9, %xmm0, %xmm1
1790 ; AVX512BW-NEXT: vpsllw $7, %xmm0, %xmm0
1791 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1792 ; AVX512BW-NEXT: retq
1794 ; AVX512VLBW-LABEL: splatconstant_funnnel_v8i16:
1795 ; AVX512VLBW: # %bb.0:
1796 ; AVX512VLBW-NEXT: vpsrlw $9, %xmm0, %xmm1
1797 ; AVX512VLBW-NEXT: vpsllw $7, %xmm0, %xmm0
1798 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1799 ; AVX512VLBW-NEXT: retq
1801 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v8i16:
1802 ; AVX512VBMI2: # %bb.0:
1803 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1804 ; AVX512VBMI2-NEXT: vpshldw $7, %zmm0, %zmm0, %zmm0
1805 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1806 ; AVX512VBMI2-NEXT: vzeroupper
1807 ; AVX512VBMI2-NEXT: retq
1809 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v8i16:
1810 ; AVX512VLVBMI2: # %bb.0:
1811 ; AVX512VLVBMI2-NEXT: vpshldw $7, %xmm0, %xmm0, %xmm0
1812 ; AVX512VLVBMI2-NEXT: retq
1814 ; XOP-LABEL: splatconstant_funnnel_v8i16:
1816 ; XOP-NEXT: vprotw $7, %xmm0, %xmm0
1819 ; X86-SSE2-LABEL: splatconstant_funnnel_v8i16:
1820 ; X86-SSE2: # %bb.0:
1821 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1822 ; X86-SSE2-NEXT: psrlw $9, %xmm1
1823 ; X86-SSE2-NEXT: psllw $7, %xmm0
1824 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1825 ; X86-SSE2-NEXT: retl
1826 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>)
1830 define <16 x i8> @splatconstant_funnnel_v16i8(<16 x i8> %x) nounwind {
1831 ; SSE-LABEL: splatconstant_funnnel_v16i8:
1833 ; SSE-NEXT: movdqa %xmm0, %xmm1
1834 ; SSE-NEXT: psrlw $4, %xmm1
1835 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1836 ; SSE-NEXT: psllw $4, %xmm0
1837 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1838 ; SSE-NEXT: por %xmm1, %xmm0
1841 ; AVX-LABEL: splatconstant_funnnel_v16i8:
1843 ; AVX-NEXT: vpsrlw $4, %xmm0, %xmm1
1844 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1845 ; AVX-NEXT: vpsllw $4, %xmm0, %xmm0
1846 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1847 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1850 ; AVX512F-LABEL: splatconstant_funnnel_v16i8:
1852 ; AVX512F-NEXT: vpsllw $4, %xmm0, %xmm1
1853 ; AVX512F-NEXT: vpsrlw $4, %xmm0, %xmm0
1854 ; AVX512F-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm1, %zmm0
1855 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1856 ; AVX512F-NEXT: vzeroupper
1857 ; AVX512F-NEXT: retq
1859 ; AVX512VL-LABEL: splatconstant_funnnel_v16i8:
1860 ; AVX512VL: # %bb.0:
1861 ; AVX512VL-NEXT: vpsllw $4, %xmm0, %xmm1
1862 ; AVX512VL-NEXT: vpsrlw $4, %xmm0, %xmm0
1863 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm1, %xmm0
1864 ; AVX512VL-NEXT: retq
1866 ; AVX512BW-LABEL: splatconstant_funnnel_v16i8:
1867 ; AVX512BW: # %bb.0:
1868 ; AVX512BW-NEXT: vpsllw $4, %xmm0, %xmm1
1869 ; AVX512BW-NEXT: vpsrlw $4, %xmm0, %xmm0
1870 ; AVX512BW-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm1, %zmm0
1871 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1872 ; AVX512BW-NEXT: vzeroupper
1873 ; AVX512BW-NEXT: retq
1875 ; AVX512VLBW-LABEL: splatconstant_funnnel_v16i8:
1876 ; AVX512VLBW: # %bb.0:
1877 ; AVX512VLBW-NEXT: vpsllw $4, %xmm0, %xmm1
1878 ; AVX512VLBW-NEXT: vpsrlw $4, %xmm0, %xmm0
1879 ; AVX512VLBW-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm1, %xmm0
1880 ; AVX512VLBW-NEXT: retq
1882 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v16i8:
1883 ; AVX512VBMI2: # %bb.0:
1884 ; AVX512VBMI2-NEXT: vpsllw $4, %xmm0, %xmm1
1885 ; AVX512VBMI2-NEXT: vpsrlw $4, %xmm0, %xmm0
1886 ; AVX512VBMI2-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm1, %zmm0
1887 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1888 ; AVX512VBMI2-NEXT: vzeroupper
1889 ; AVX512VBMI2-NEXT: retq
1891 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v16i8:
1892 ; AVX512VLVBMI2: # %bb.0:
1893 ; AVX512VLVBMI2-NEXT: vpsllw $4, %xmm0, %xmm1
1894 ; AVX512VLVBMI2-NEXT: vpsrlw $4, %xmm0, %xmm0
1895 ; AVX512VLVBMI2-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm1, %xmm0
1896 ; AVX512VLVBMI2-NEXT: retq
1898 ; XOP-LABEL: splatconstant_funnnel_v16i8:
1900 ; XOP-NEXT: vprotb $4, %xmm0, %xmm0
1903 ; X86-SSE2-LABEL: splatconstant_funnnel_v16i8:
1904 ; X86-SSE2: # %bb.0:
1905 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1906 ; X86-SSE2-NEXT: psrlw $4, %xmm1
1907 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1908 ; X86-SSE2-NEXT: psllw $4, %xmm0
1909 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1910 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1911 ; X86-SSE2-NEXT: retl
1912 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>)