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-prefixes=AVX512F
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=AVX512VL
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=AVX512BW
9 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vbmi,+avx512vbmi2 | FileCheck %s --check-prefixes=AVX512VBMI2
10 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefixes=AVX512VLBW
11 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vbmi,+avx512vbmi2,+avx512vl | FileCheck %s --check-prefixes=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-prefixes=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> %y, <2 x i64> %amt) nounwind {
28 ; SSE2-LABEL: var_funnnel_v2i64:
30 ; SSE2-NEXT: movdqa {{.*#+}} xmm3 = [63,63]
31 ; SSE2-NEXT: movdqa %xmm2, %xmm4
32 ; SSE2-NEXT: pandn %xmm3, %xmm4
33 ; SSE2-NEXT: psrlq $1, %xmm1
34 ; SSE2-NEXT: movdqa %xmm1, %xmm5
35 ; SSE2-NEXT: psrlq %xmm4, %xmm5
36 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[2,3,2,3]
37 ; SSE2-NEXT: psrlq %xmm4, %xmm1
38 ; SSE2-NEXT: shufpd {{.*#+}} xmm5 = xmm5[0],xmm1[1]
39 ; SSE2-NEXT: pand %xmm3, %xmm2
40 ; SSE2-NEXT: movdqa %xmm0, %xmm1
41 ; SSE2-NEXT: psllq %xmm2, %xmm1
42 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[2,3,2,3]
43 ; SSE2-NEXT: psllq %xmm2, %xmm0
44 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
45 ; SSE2-NEXT: orpd %xmm5, %xmm0
48 ; SSE41-LABEL: var_funnnel_v2i64:
50 ; SSE41-NEXT: movdqa {{.*#+}} xmm3 = [63,63]
51 ; SSE41-NEXT: movdqa %xmm2, %xmm4
52 ; SSE41-NEXT: pandn %xmm3, %xmm4
53 ; SSE41-NEXT: psrlq $1, %xmm1
54 ; SSE41-NEXT: movdqa %xmm1, %xmm5
55 ; SSE41-NEXT: psrlq %xmm4, %xmm5
56 ; SSE41-NEXT: pshufd {{.*#+}} xmm4 = xmm4[2,3,2,3]
57 ; SSE41-NEXT: psrlq %xmm4, %xmm1
58 ; SSE41-NEXT: pblendw {{.*#+}} xmm5 = xmm5[0,1,2,3],xmm1[4,5,6,7]
59 ; SSE41-NEXT: pand %xmm3, %xmm2
60 ; SSE41-NEXT: movdqa %xmm0, %xmm1
61 ; SSE41-NEXT: psllq %xmm2, %xmm1
62 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm2[2,3,2,3]
63 ; SSE41-NEXT: psllq %xmm2, %xmm0
64 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm1[0,1,2,3],xmm0[4,5,6,7]
65 ; SSE41-NEXT: por %xmm5, %xmm0
68 ; AVX1-LABEL: var_funnnel_v2i64:
70 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
71 ; AVX1-NEXT: vpandn %xmm3, %xmm2, %xmm4
72 ; AVX1-NEXT: vpsrlq $1, %xmm1, %xmm1
73 ; AVX1-NEXT: vpsrlq %xmm4, %xmm1, %xmm5
74 ; AVX1-NEXT: vpshufd {{.*#+}} xmm4 = xmm4[2,3,2,3]
75 ; AVX1-NEXT: vpsrlq %xmm4, %xmm1, %xmm1
76 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm5[0,1,2,3],xmm1[4,5,6,7]
77 ; AVX1-NEXT: vpand %xmm3, %xmm2, %xmm2
78 ; AVX1-NEXT: vpsllq %xmm2, %xmm0, %xmm3
79 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[2,3,2,3]
80 ; AVX1-NEXT: vpsllq %xmm2, %xmm0, %xmm0
81 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm3[0,1,2,3],xmm0[4,5,6,7]
82 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
85 ; AVX2-LABEL: var_funnnel_v2i64:
87 ; AVX2-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
88 ; AVX2-NEXT: vpandn %xmm3, %xmm2, %xmm4
89 ; AVX2-NEXT: vpsrlq $1, %xmm1, %xmm1
90 ; AVX2-NEXT: vpsrlvq %xmm4, %xmm1, %xmm1
91 ; AVX2-NEXT: vpand %xmm3, %xmm2, %xmm2
92 ; AVX2-NEXT: vpsllvq %xmm2, %xmm0, %xmm0
93 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
96 ; AVX512F-LABEL: var_funnnel_v2i64:
98 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
99 ; AVX512F-NEXT: vpandn %xmm3, %xmm2, %xmm4
100 ; AVX512F-NEXT: vpsrlq $1, %xmm1, %xmm1
101 ; AVX512F-NEXT: vpsrlvq %xmm4, %xmm1, %xmm1
102 ; AVX512F-NEXT: vpand %xmm3, %xmm2, %xmm2
103 ; AVX512F-NEXT: vpsllvq %xmm2, %xmm0, %xmm0
104 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
107 ; AVX512VL-LABEL: var_funnnel_v2i64:
109 ; AVX512VL-NEXT: vpbroadcastq {{.*#+}} xmm3 = [63,63]
110 ; AVX512VL-NEXT: vpandn %xmm3, %xmm2, %xmm4
111 ; AVX512VL-NEXT: vpsrlq $1, %xmm1, %xmm1
112 ; AVX512VL-NEXT: vpsrlvq %xmm4, %xmm1, %xmm1
113 ; AVX512VL-NEXT: vpand %xmm3, %xmm2, %xmm2
114 ; AVX512VL-NEXT: vpsllvq %xmm2, %xmm0, %xmm0
115 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
116 ; AVX512VL-NEXT: retq
118 ; AVX512BW-LABEL: var_funnnel_v2i64:
120 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
121 ; AVX512BW-NEXT: vpandn %xmm3, %xmm2, %xmm4
122 ; AVX512BW-NEXT: vpsrlq $1, %xmm1, %xmm1
123 ; AVX512BW-NEXT: vpsrlvq %xmm4, %xmm1, %xmm1
124 ; AVX512BW-NEXT: vpand %xmm3, %xmm2, %xmm2
125 ; AVX512BW-NEXT: vpsllvq %xmm2, %xmm0, %xmm0
126 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
127 ; AVX512BW-NEXT: retq
129 ; AVX512VBMI2-LABEL: var_funnnel_v2i64:
130 ; AVX512VBMI2: # %bb.0:
131 ; AVX512VBMI2-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
132 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
133 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
134 ; AVX512VBMI2-NEXT: vpshldvq %zmm2, %zmm1, %zmm0
135 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
136 ; AVX512VBMI2-NEXT: vzeroupper
137 ; AVX512VBMI2-NEXT: retq
139 ; AVX512VLBW-LABEL: var_funnnel_v2i64:
140 ; AVX512VLBW: # %bb.0:
141 ; AVX512VLBW-NEXT: vpbroadcastq {{.*#+}} xmm3 = [63,63]
142 ; AVX512VLBW-NEXT: vpandn %xmm3, %xmm2, %xmm4
143 ; AVX512VLBW-NEXT: vpsrlq $1, %xmm1, %xmm1
144 ; AVX512VLBW-NEXT: vpsrlvq %xmm4, %xmm1, %xmm1
145 ; AVX512VLBW-NEXT: vpand %xmm3, %xmm2, %xmm2
146 ; AVX512VLBW-NEXT: vpsllvq %xmm2, %xmm0, %xmm0
147 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
148 ; AVX512VLBW-NEXT: retq
150 ; AVX512VLVBMI2-LABEL: var_funnnel_v2i64:
151 ; AVX512VLVBMI2: # %bb.0:
152 ; AVX512VLVBMI2-NEXT: vpshldvq %xmm2, %xmm1, %xmm0
153 ; AVX512VLVBMI2-NEXT: retq
155 ; XOPAVX1-LABEL: var_funnnel_v2i64:
157 ; XOPAVX1-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
158 ; XOPAVX1-NEXT: vpand %xmm3, %xmm2, %xmm4
159 ; XOPAVX1-NEXT: vpshlq %xmm4, %xmm0, %xmm0
160 ; XOPAVX1-NEXT: vpandn %xmm3, %xmm2, %xmm2
161 ; XOPAVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
162 ; XOPAVX1-NEXT: vpsubq %xmm2, %xmm3, %xmm2
163 ; XOPAVX1-NEXT: vpsrlq $1, %xmm1, %xmm1
164 ; XOPAVX1-NEXT: vpshlq %xmm2, %xmm1, %xmm1
165 ; XOPAVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
168 ; XOPAVX2-LABEL: var_funnnel_v2i64:
170 ; XOPAVX2-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
171 ; XOPAVX2-NEXT: vpandn %xmm3, %xmm2, %xmm4
172 ; XOPAVX2-NEXT: vpsrlq $1, %xmm1, %xmm1
173 ; XOPAVX2-NEXT: vpsrlvq %xmm4, %xmm1, %xmm1
174 ; XOPAVX2-NEXT: vpand %xmm3, %xmm2, %xmm2
175 ; XOPAVX2-NEXT: vpsllvq %xmm2, %xmm0, %xmm0
176 ; XOPAVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
179 ; X86-SSE2-LABEL: var_funnnel_v2i64:
181 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm4 = [63,0,63,0]
182 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm5
183 ; X86-SSE2-NEXT: pandn %xmm4, %xmm5
184 ; X86-SSE2-NEXT: psrlq $1, %xmm1
185 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm3
186 ; X86-SSE2-NEXT: psrlq %xmm5, %xmm3
187 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm5[2,3,2,3]
188 ; X86-SSE2-NEXT: psrlq %xmm5, %xmm1
189 ; X86-SSE2-NEXT: shufpd {{.*#+}} xmm3 = xmm3[0],xmm1[1]
190 ; X86-SSE2-NEXT: pand %xmm4, %xmm2
191 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
192 ; X86-SSE2-NEXT: psllq %xmm2, %xmm1
193 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[2,3,2,3]
194 ; X86-SSE2-NEXT: psllq %xmm2, %xmm0
195 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
196 ; X86-SSE2-NEXT: orpd %xmm3, %xmm0
197 ; X86-SSE2-NEXT: retl
198 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %y, <2 x i64> %amt)
202 define <4 x i32> @var_funnnel_v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> %amt) nounwind {
203 ; SSE2-LABEL: var_funnnel_v4i32:
205 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [31,31,31,31]
206 ; SSE2-NEXT: movdqa %xmm2, %xmm5
207 ; SSE2-NEXT: pandn %xmm4, %xmm5
208 ; SSE2-NEXT: pshuflw {{.*#+}} xmm3 = xmm5[2,3,3,3,4,5,6,7]
209 ; SSE2-NEXT: psrld $1, %xmm1
210 ; SSE2-NEXT: movdqa %xmm1, %xmm6
211 ; SSE2-NEXT: psrld %xmm3, %xmm6
212 ; SSE2-NEXT: pshuflw {{.*#+}} xmm7 = xmm5[0,1,1,1,4,5,6,7]
213 ; SSE2-NEXT: movdqa %xmm1, %xmm3
214 ; SSE2-NEXT: psrld %xmm7, %xmm3
215 ; SSE2-NEXT: punpcklqdq {{.*#+}} xmm3 = xmm3[0],xmm6[0]
216 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm5[2,3,2,3]
217 ; SSE2-NEXT: pshuflw {{.*#+}} xmm6 = xmm5[2,3,3,3,4,5,6,7]
218 ; SSE2-NEXT: movdqa %xmm1, %xmm7
219 ; SSE2-NEXT: psrld %xmm6, %xmm7
220 ; SSE2-NEXT: pshuflw {{.*#+}} xmm5 = xmm5[0,1,1,1,4,5,6,7]
221 ; SSE2-NEXT: psrld %xmm5, %xmm1
222 ; SSE2-NEXT: punpckhqdq {{.*#+}} xmm1 = xmm1[1],xmm7[1]
223 ; SSE2-NEXT: shufps {{.*#+}} xmm3 = xmm3[0,3],xmm1[0,3]
224 ; SSE2-NEXT: pand %xmm4, %xmm2
225 ; SSE2-NEXT: pslld $23, %xmm2
226 ; SSE2-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
227 ; SSE2-NEXT: cvttps2dq %xmm2, %xmm1
228 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
229 ; SSE2-NEXT: pmuludq %xmm1, %xmm0
230 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
231 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
232 ; SSE2-NEXT: pmuludq %xmm2, %xmm1
233 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
234 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
235 ; SSE2-NEXT: por %xmm3, %xmm0
238 ; SSE41-LABEL: var_funnnel_v4i32:
240 ; SSE41-NEXT: movdqa {{.*#+}} xmm8 = [31,31,31,31]
241 ; SSE41-NEXT: movdqa %xmm2, %xmm4
242 ; SSE41-NEXT: pandn %xmm8, %xmm4
243 ; SSE41-NEXT: pshuflw {{.*#+}} xmm5 = xmm4[2,3,3,3,4,5,6,7]
244 ; SSE41-NEXT: psrld $1, %xmm1
245 ; SSE41-NEXT: movdqa %xmm1, %xmm6
246 ; SSE41-NEXT: psrld %xmm5, %xmm6
247 ; SSE41-NEXT: pshufd {{.*#+}} xmm5 = xmm4[2,3,2,3]
248 ; SSE41-NEXT: pshuflw {{.*#+}} xmm7 = xmm5[2,3,3,3,4,5,6,7]
249 ; SSE41-NEXT: movdqa %xmm1, %xmm3
250 ; SSE41-NEXT: psrld %xmm7, %xmm3
251 ; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm6[0,1,2,3],xmm3[4,5,6,7]
252 ; SSE41-NEXT: pshuflw {{.*#+}} xmm4 = xmm4[0,1,1,1,4,5,6,7]
253 ; SSE41-NEXT: movdqa %xmm1, %xmm6
254 ; SSE41-NEXT: psrld %xmm4, %xmm6
255 ; SSE41-NEXT: pshuflw {{.*#+}} xmm4 = xmm5[0,1,1,1,4,5,6,7]
256 ; SSE41-NEXT: psrld %xmm4, %xmm1
257 ; SSE41-NEXT: pblendw {{.*#+}} xmm6 = xmm6[0,1,2,3],xmm1[4,5,6,7]
258 ; SSE41-NEXT: pblendw {{.*#+}} xmm6 = xmm6[0,1],xmm3[2,3],xmm6[4,5],xmm3[6,7]
259 ; SSE41-NEXT: pand %xmm8, %xmm2
260 ; SSE41-NEXT: pslld $23, %xmm2
261 ; SSE41-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
262 ; SSE41-NEXT: cvttps2dq %xmm2, %xmm1
263 ; SSE41-NEXT: pmulld %xmm1, %xmm0
264 ; SSE41-NEXT: por %xmm6, %xmm0
267 ; AVX1-LABEL: var_funnnel_v4i32:
269 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm3 = [31,31,31,31]
270 ; AVX1-NEXT: vpandn %xmm3, %xmm2, %xmm4
271 ; AVX1-NEXT: vpsrldq {{.*#+}} xmm5 = xmm4[12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
272 ; AVX1-NEXT: vpsrld $1, %xmm1, %xmm1
273 ; AVX1-NEXT: vpsrld %xmm5, %xmm1, %xmm5
274 ; AVX1-NEXT: vpsrlq $32, %xmm4, %xmm6
275 ; AVX1-NEXT: vpsrld %xmm6, %xmm1, %xmm6
276 ; AVX1-NEXT: vpblendw {{.*#+}} xmm5 = xmm6[0,1,2,3],xmm5[4,5,6,7]
277 ; AVX1-NEXT: vpxor %xmm6, %xmm6, %xmm6
278 ; AVX1-NEXT: vpunpckhdq {{.*#+}} xmm6 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
279 ; AVX1-NEXT: vpsrld %xmm6, %xmm1, %xmm6
280 ; AVX1-NEXT: vpmovzxdq {{.*#+}} xmm4 = xmm4[0],zero,xmm4[1],zero
281 ; AVX1-NEXT: vpsrld %xmm4, %xmm1, %xmm1
282 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm6[4,5,6,7]
283 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1],xmm5[2,3],xmm1[4,5],xmm5[6,7]
284 ; AVX1-NEXT: vpand %xmm3, %xmm2, %xmm2
285 ; AVX1-NEXT: vpslld $23, %xmm2, %xmm2
286 ; AVX1-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
287 ; AVX1-NEXT: vcvttps2dq %xmm2, %xmm2
288 ; AVX1-NEXT: vpmulld %xmm2, %xmm0, %xmm0
289 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
292 ; AVX2-LABEL: var_funnnel_v4i32:
294 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm3 = [31,31,31,31]
295 ; AVX2-NEXT: vpandn %xmm3, %xmm2, %xmm4
296 ; AVX2-NEXT: vpsrld $1, %xmm1, %xmm1
297 ; AVX2-NEXT: vpsrlvd %xmm4, %xmm1, %xmm1
298 ; AVX2-NEXT: vpand %xmm3, %xmm2, %xmm2
299 ; AVX2-NEXT: vpsllvd %xmm2, %xmm0, %xmm0
300 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
303 ; AVX512F-LABEL: var_funnnel_v4i32:
305 ; AVX512F-NEXT: vpbroadcastd {{.*#+}} xmm3 = [31,31,31,31]
306 ; AVX512F-NEXT: vpandn %xmm3, %xmm2, %xmm4
307 ; AVX512F-NEXT: vpsrld $1, %xmm1, %xmm1
308 ; AVX512F-NEXT: vpsrlvd %xmm4, %xmm1, %xmm1
309 ; AVX512F-NEXT: vpand %xmm3, %xmm2, %xmm2
310 ; AVX512F-NEXT: vpsllvd %xmm2, %xmm0, %xmm0
311 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
314 ; AVX512VL-LABEL: var_funnnel_v4i32:
316 ; AVX512VL-NEXT: vpbroadcastd {{.*#+}} xmm3 = [31,31,31,31]
317 ; AVX512VL-NEXT: vpandn %xmm3, %xmm2, %xmm4
318 ; AVX512VL-NEXT: vpsrld $1, %xmm1, %xmm1
319 ; AVX512VL-NEXT: vpsrlvd %xmm4, %xmm1, %xmm1
320 ; AVX512VL-NEXT: vpand %xmm3, %xmm2, %xmm2
321 ; AVX512VL-NEXT: vpsllvd %xmm2, %xmm0, %xmm0
322 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
323 ; AVX512VL-NEXT: retq
325 ; AVX512BW-LABEL: var_funnnel_v4i32:
327 ; AVX512BW-NEXT: vpbroadcastd {{.*#+}} xmm3 = [31,31,31,31]
328 ; AVX512BW-NEXT: vpandn %xmm3, %xmm2, %xmm4
329 ; AVX512BW-NEXT: vpsrld $1, %xmm1, %xmm1
330 ; AVX512BW-NEXT: vpsrlvd %xmm4, %xmm1, %xmm1
331 ; AVX512BW-NEXT: vpand %xmm3, %xmm2, %xmm2
332 ; AVX512BW-NEXT: vpsllvd %xmm2, %xmm0, %xmm0
333 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
334 ; AVX512BW-NEXT: retq
336 ; AVX512VBMI2-LABEL: var_funnnel_v4i32:
337 ; AVX512VBMI2: # %bb.0:
338 ; AVX512VBMI2-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
339 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
340 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
341 ; AVX512VBMI2-NEXT: vpshldvd %zmm2, %zmm1, %zmm0
342 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
343 ; AVX512VBMI2-NEXT: vzeroupper
344 ; AVX512VBMI2-NEXT: retq
346 ; AVX512VLBW-LABEL: var_funnnel_v4i32:
347 ; AVX512VLBW: # %bb.0:
348 ; AVX512VLBW-NEXT: vpbroadcastd {{.*#+}} xmm3 = [31,31,31,31]
349 ; AVX512VLBW-NEXT: vpandn %xmm3, %xmm2, %xmm4
350 ; AVX512VLBW-NEXT: vpsrld $1, %xmm1, %xmm1
351 ; AVX512VLBW-NEXT: vpsrlvd %xmm4, %xmm1, %xmm1
352 ; AVX512VLBW-NEXT: vpand %xmm3, %xmm2, %xmm2
353 ; AVX512VLBW-NEXT: vpsllvd %xmm2, %xmm0, %xmm0
354 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
355 ; AVX512VLBW-NEXT: retq
357 ; AVX512VLVBMI2-LABEL: var_funnnel_v4i32:
358 ; AVX512VLVBMI2: # %bb.0:
359 ; AVX512VLVBMI2-NEXT: vpshldvd %xmm2, %xmm1, %xmm0
360 ; AVX512VLVBMI2-NEXT: retq
362 ; XOPAVX1-LABEL: var_funnnel_v4i32:
364 ; XOPAVX1-NEXT: vmovdqa {{.*#+}} xmm3 = [31,31,31,31]
365 ; XOPAVX1-NEXT: vpand %xmm3, %xmm2, %xmm4
366 ; XOPAVX1-NEXT: vpshld %xmm4, %xmm0, %xmm0
367 ; XOPAVX1-NEXT: vpandn %xmm3, %xmm2, %xmm2
368 ; XOPAVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
369 ; XOPAVX1-NEXT: vpsubd %xmm2, %xmm3, %xmm2
370 ; XOPAVX1-NEXT: vpsrld $1, %xmm1, %xmm1
371 ; XOPAVX1-NEXT: vpshld %xmm2, %xmm1, %xmm1
372 ; XOPAVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
375 ; XOPAVX2-LABEL: var_funnnel_v4i32:
377 ; XOPAVX2-NEXT: vpbroadcastd {{.*#+}} xmm3 = [31,31,31,31]
378 ; XOPAVX2-NEXT: vpandn %xmm3, %xmm2, %xmm4
379 ; XOPAVX2-NEXT: vpsrld $1, %xmm1, %xmm1
380 ; XOPAVX2-NEXT: vpsrlvd %xmm4, %xmm1, %xmm1
381 ; XOPAVX2-NEXT: vpand %xmm3, %xmm2, %xmm2
382 ; XOPAVX2-NEXT: vpsllvd %xmm2, %xmm0, %xmm0
383 ; XOPAVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
386 ; X86-SSE2-LABEL: var_funnnel_v4i32:
388 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm4 = [31,31,31,31]
389 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm5
390 ; X86-SSE2-NEXT: pandn %xmm4, %xmm5
391 ; X86-SSE2-NEXT: pshuflw {{.*#+}} xmm3 = xmm5[2,3,3,3,4,5,6,7]
392 ; X86-SSE2-NEXT: psrld $1, %xmm1
393 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm6
394 ; X86-SSE2-NEXT: psrld %xmm3, %xmm6
395 ; X86-SSE2-NEXT: pshuflw {{.*#+}} xmm7 = xmm5[0,1,1,1,4,5,6,7]
396 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm3
397 ; X86-SSE2-NEXT: psrld %xmm7, %xmm3
398 ; X86-SSE2-NEXT: punpcklqdq {{.*#+}} xmm3 = xmm3[0],xmm6[0]
399 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm5[2,3,2,3]
400 ; X86-SSE2-NEXT: pshuflw {{.*#+}} xmm6 = xmm5[2,3,3,3,4,5,6,7]
401 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm7
402 ; X86-SSE2-NEXT: psrld %xmm6, %xmm7
403 ; X86-SSE2-NEXT: pshuflw {{.*#+}} xmm5 = xmm5[0,1,1,1,4,5,6,7]
404 ; X86-SSE2-NEXT: psrld %xmm5, %xmm1
405 ; X86-SSE2-NEXT: punpckhqdq {{.*#+}} xmm1 = xmm1[1],xmm7[1]
406 ; X86-SSE2-NEXT: shufps {{.*#+}} xmm3 = xmm3[0,3],xmm1[0,3]
407 ; X86-SSE2-NEXT: pand %xmm4, %xmm2
408 ; X86-SSE2-NEXT: pslld $23, %xmm2
409 ; X86-SSE2-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
410 ; X86-SSE2-NEXT: cvttps2dq %xmm2, %xmm1
411 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
412 ; X86-SSE2-NEXT: pmuludq %xmm1, %xmm0
413 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
414 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
415 ; X86-SSE2-NEXT: pmuludq %xmm2, %xmm1
416 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
417 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
418 ; X86-SSE2-NEXT: por %xmm3, %xmm0
419 ; X86-SSE2-NEXT: retl
420 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> %amt)
424 define <8 x i16> @var_funnnel_v8i16(<8 x i16> %x, <8 x i16> %y, <8 x i16> %amt) nounwind {
425 ; SSE2-LABEL: var_funnnel_v8i16:
427 ; SSE2-NEXT: movdqa %xmm1, %xmm3
428 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
429 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
430 ; SSE2-NEXT: movdqa %xmm2, %xmm4
431 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm4 = xmm4[4,4,5,5,6,6,7,7]
432 ; SSE2-NEXT: pslld $23, %xmm4
433 ; SSE2-NEXT: movdqa {{.*#+}} xmm5 = [1065353216,1065353216,1065353216,1065353216]
434 ; SSE2-NEXT: paddd %xmm5, %xmm4
435 ; SSE2-NEXT: cvttps2dq %xmm4, %xmm4
436 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm3[1,1,3,3]
437 ; SSE2-NEXT: pmuludq %xmm4, %xmm3
438 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[0,2,2,3]
439 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,1,3,3]
440 ; SSE2-NEXT: pmuludq %xmm6, %xmm4
441 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[0,2,2,3]
442 ; SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
443 ; SSE2-NEXT: psrad $16, %xmm3
444 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
445 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3]
446 ; SSE2-NEXT: pslld $23, %xmm2
447 ; SSE2-NEXT: paddd %xmm5, %xmm2
448 ; SSE2-NEXT: cvttps2dq %xmm2, %xmm2
449 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm1[1,1,3,3]
450 ; SSE2-NEXT: pmuludq %xmm2, %xmm1
451 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
452 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3]
453 ; SSE2-NEXT: pmuludq %xmm4, %xmm1
454 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
455 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
456 ; SSE2-NEXT: psrad $16, %xmm0
457 ; SSE2-NEXT: packssdw %xmm3, %xmm0
460 ; SSE41-LABEL: var_funnnel_v8i16:
462 ; SSE41-NEXT: movdqa %xmm1, %xmm3
463 ; SSE41-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
464 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
465 ; SSE41-NEXT: pmovzxwd {{.*#+}} xmm4 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero
466 ; SSE41-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4,4,5,5,6,6,7,7]
467 ; SSE41-NEXT: pslld $23, %xmm2
468 ; SSE41-NEXT: movdqa {{.*#+}} xmm5 = [1065353216,1065353216,1065353216,1065353216]
469 ; SSE41-NEXT: paddd %xmm5, %xmm2
470 ; SSE41-NEXT: cvttps2dq %xmm2, %xmm2
471 ; SSE41-NEXT: pmulld %xmm3, %xmm2
472 ; SSE41-NEXT: psrld $16, %xmm2
473 ; SSE41-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
474 ; SSE41-NEXT: pslld $23, %xmm4
475 ; SSE41-NEXT: paddd %xmm5, %xmm4
476 ; SSE41-NEXT: cvttps2dq %xmm4, %xmm0
477 ; SSE41-NEXT: pmulld %xmm1, %xmm0
478 ; SSE41-NEXT: psrld $16, %xmm0
479 ; SSE41-NEXT: packusdw %xmm2, %xmm0
482 ; AVX1-LABEL: var_funnnel_v8i16:
484 ; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm3 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
485 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
486 ; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm4 = xmm2[4,4,5,5,6,6,7,7]
487 ; AVX1-NEXT: vpslld $23, %xmm4, %xmm4
488 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm5 = [1065353216,1065353216,1065353216,1065353216]
489 ; AVX1-NEXT: vpaddd %xmm5, %xmm4, %xmm4
490 ; AVX1-NEXT: vcvttps2dq %xmm4, %xmm4
491 ; AVX1-NEXT: vpmulld %xmm4, %xmm3, %xmm3
492 ; AVX1-NEXT: vpsrld $16, %xmm3, %xmm3
493 ; AVX1-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
494 ; AVX1-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero
495 ; AVX1-NEXT: vpslld $23, %xmm1, %xmm1
496 ; AVX1-NEXT: vpaddd %xmm5, %xmm1, %xmm1
497 ; AVX1-NEXT: vcvttps2dq %xmm1, %xmm1
498 ; AVX1-NEXT: vpmulld %xmm1, %xmm0, %xmm0
499 ; AVX1-NEXT: vpsrld $16, %xmm0, %xmm0
500 ; AVX1-NEXT: vpackusdw %xmm3, %xmm0, %xmm0
503 ; AVX2-LABEL: var_funnnel_v8i16:
505 ; AVX2-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
506 ; AVX2-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
507 ; AVX2-NEXT: vpslld $16, %ymm0, %ymm0
508 ; AVX2-NEXT: vpblendw {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7],ymm1[8],ymm0[9],ymm1[10],ymm0[11],ymm1[12],ymm0[13],ymm1[14],ymm0[15]
509 ; AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm1
510 ; AVX2-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
511 ; AVX2-NEXT: vpsllvd %ymm1, %ymm0, %ymm0
512 ; AVX2-NEXT: vpsrld $16, %ymm0, %ymm0
513 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
514 ; AVX2-NEXT: vpackusdw %xmm1, %xmm0, %xmm0
515 ; AVX2-NEXT: vzeroupper
518 ; AVX512F-LABEL: var_funnnel_v8i16:
520 ; AVX512F-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
521 ; AVX512F-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
522 ; AVX512F-NEXT: vpslld $16, %ymm0, %ymm0
523 ; AVX512F-NEXT: vpblendw {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7],ymm1[8],ymm0[9],ymm1[10],ymm0[11],ymm1[12],ymm0[13],ymm1[14],ymm0[15]
524 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm1
525 ; AVX512F-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
526 ; AVX512F-NEXT: vpsllvd %ymm1, %ymm0, %ymm0
527 ; AVX512F-NEXT: vpsrld $16, %ymm0, %ymm0
528 ; AVX512F-NEXT: vpmovdw %zmm0, %ymm0
529 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
530 ; AVX512F-NEXT: vzeroupper
533 ; AVX512VL-LABEL: var_funnnel_v8i16:
535 ; AVX512VL-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
536 ; AVX512VL-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
537 ; AVX512VL-NEXT: vpslld $16, %ymm0, %ymm0
538 ; AVX512VL-NEXT: vpblendw {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7],ymm1[8],ymm0[9],ymm1[10],ymm0[11],ymm1[12],ymm0[13],ymm1[14],ymm0[15]
539 ; AVX512VL-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm1
540 ; AVX512VL-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
541 ; AVX512VL-NEXT: vpsllvd %ymm1, %ymm0, %ymm0
542 ; AVX512VL-NEXT: vpsrld $16, %ymm0, %ymm0
543 ; AVX512VL-NEXT: vpmovdw %ymm0, %xmm0
544 ; AVX512VL-NEXT: vzeroupper
545 ; AVX512VL-NEXT: retq
547 ; AVX512BW-LABEL: var_funnnel_v8i16:
549 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
550 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm3 = [15,15,15,15,15,15,15,15]
551 ; AVX512BW-NEXT: vpandn %xmm3, %xmm2, %xmm4
552 ; AVX512BW-NEXT: vpsrlw $1, %xmm1, %xmm1
553 ; AVX512BW-NEXT: vpsrlvw %zmm4, %zmm1, %zmm1
554 ; AVX512BW-NEXT: vpand %xmm3, %xmm2, %xmm2
555 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
556 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
557 ; AVX512BW-NEXT: vzeroupper
558 ; AVX512BW-NEXT: retq
560 ; AVX512VBMI2-LABEL: var_funnnel_v8i16:
561 ; AVX512VBMI2: # %bb.0:
562 ; AVX512VBMI2-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
563 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
564 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
565 ; AVX512VBMI2-NEXT: vpshldvw %zmm2, %zmm1, %zmm0
566 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
567 ; AVX512VBMI2-NEXT: vzeroupper
568 ; AVX512VBMI2-NEXT: retq
570 ; AVX512VLBW-LABEL: var_funnnel_v8i16:
571 ; AVX512VLBW: # %bb.0:
572 ; AVX512VLBW-NEXT: vmovdqa {{.*#+}} xmm3 = [15,15,15,15,15,15,15,15]
573 ; AVX512VLBW-NEXT: vpandn %xmm3, %xmm2, %xmm4
574 ; AVX512VLBW-NEXT: vpsrlw $1, %xmm1, %xmm1
575 ; AVX512VLBW-NEXT: vpsrlvw %xmm4, %xmm1, %xmm1
576 ; AVX512VLBW-NEXT: vpand %xmm3, %xmm2, %xmm2
577 ; AVX512VLBW-NEXT: vpsllvw %xmm2, %xmm0, %xmm0
578 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
579 ; AVX512VLBW-NEXT: retq
581 ; AVX512VLVBMI2-LABEL: var_funnnel_v8i16:
582 ; AVX512VLVBMI2: # %bb.0:
583 ; AVX512VLVBMI2-NEXT: vpshldvw %xmm2, %xmm1, %xmm0
584 ; AVX512VLVBMI2-NEXT: retq
586 ; XOP-LABEL: var_funnnel_v8i16:
588 ; XOP-NEXT: vmovdqa {{.*#+}} xmm3 = [15,15,15,15,15,15,15,15]
589 ; XOP-NEXT: vpand %xmm3, %xmm2, %xmm4
590 ; XOP-NEXT: vpshlw %xmm4, %xmm0, %xmm0
591 ; XOP-NEXT: vpandn %xmm3, %xmm2, %xmm2
592 ; XOP-NEXT: vpxor %xmm3, %xmm3, %xmm3
593 ; XOP-NEXT: vpsubw %xmm2, %xmm3, %xmm2
594 ; XOP-NEXT: vpsrlw $1, %xmm1, %xmm1
595 ; XOP-NEXT: vpshlw %xmm2, %xmm1, %xmm1
596 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
599 ; X86-SSE2-LABEL: var_funnnel_v8i16:
601 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm3
602 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
603 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
604 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm5
605 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm5 = xmm5[4,4,5,5,6,6,7,7]
606 ; X86-SSE2-NEXT: pslld $23, %xmm5
607 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm4 = [1065353216,1065353216,1065353216,1065353216]
608 ; X86-SSE2-NEXT: paddd %xmm4, %xmm5
609 ; X86-SSE2-NEXT: cvttps2dq %xmm5, %xmm5
610 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm3[1,1,3,3]
611 ; X86-SSE2-NEXT: pmuludq %xmm5, %xmm3
612 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[0,2,2,3]
613 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm5[1,1,3,3]
614 ; X86-SSE2-NEXT: pmuludq %xmm6, %xmm5
615 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm5[0,2,2,3]
616 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
617 ; X86-SSE2-NEXT: psrad $16, %xmm3
618 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
619 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3]
620 ; X86-SSE2-NEXT: pslld $23, %xmm2
621 ; X86-SSE2-NEXT: paddd %xmm4, %xmm2
622 ; X86-SSE2-NEXT: cvttps2dq %xmm2, %xmm2
623 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm1[1,1,3,3]
624 ; X86-SSE2-NEXT: pmuludq %xmm2, %xmm1
625 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
626 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3]
627 ; X86-SSE2-NEXT: pmuludq %xmm4, %xmm1
628 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
629 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
630 ; X86-SSE2-NEXT: psrad $16, %xmm0
631 ; X86-SSE2-NEXT: packssdw %xmm3, %xmm0
632 ; X86-SSE2-NEXT: retl
633 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %y, <8 x i16> %amt)
637 define <16 x i8> @var_funnnel_v16i8(<16 x i8> %x, <16 x i8> %y, <16 x i8> %amt) nounwind {
638 ; SSE2-LABEL: var_funnnel_v16i8:
640 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
641 ; SSE2-NEXT: pxor %xmm5, %xmm5
642 ; SSE2-NEXT: movdqa %xmm2, %xmm4
643 ; SSE2-NEXT: punpckhbw {{.*#+}} xmm4 = xmm4[8],xmm5[8],xmm4[9],xmm5[9],xmm4[10],xmm5[10],xmm4[11],xmm5[11],xmm4[12],xmm5[12],xmm4[13],xmm5[13],xmm4[14],xmm5[14],xmm4[15],xmm5[15]
644 ; SSE2-NEXT: movdqa %xmm4, %xmm6
645 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm6 = xmm6[4,4,5,5,6,6,7,7]
646 ; SSE2-NEXT: pslld $23, %xmm6
647 ; SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
648 ; SSE2-NEXT: paddd %xmm3, %xmm6
649 ; SSE2-NEXT: cvttps2dq %xmm6, %xmm6
650 ; SSE2-NEXT: pslld $16, %xmm6
651 ; SSE2-NEXT: psrad $16, %xmm6
652 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0,0,1,1,2,2,3,3]
653 ; SSE2-NEXT: pslld $23, %xmm4
654 ; SSE2-NEXT: paddd %xmm3, %xmm4
655 ; SSE2-NEXT: cvttps2dq %xmm4, %xmm7
656 ; SSE2-NEXT: pslld $16, %xmm7
657 ; SSE2-NEXT: psrad $16, %xmm7
658 ; SSE2-NEXT: packssdw %xmm6, %xmm7
659 ; SSE2-NEXT: movdqa %xmm1, %xmm4
660 ; SSE2-NEXT: punpckhbw {{.*#+}} xmm4 = xmm4[8],xmm0[8],xmm4[9],xmm0[9],xmm4[10],xmm0[10],xmm4[11],xmm0[11],xmm4[12],xmm0[12],xmm4[13],xmm0[13],xmm4[14],xmm0[14],xmm4[15],xmm0[15]
661 ; SSE2-NEXT: pmullw %xmm7, %xmm4
662 ; SSE2-NEXT: psrlw $8, %xmm4
663 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1],xmm2[2],xmm5[2],xmm2[3],xmm5[3],xmm2[4],xmm5[4],xmm2[5],xmm5[5],xmm2[6],xmm5[6],xmm2[7],xmm5[7]
664 ; SSE2-NEXT: movdqa %xmm2, %xmm5
665 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm5 = xmm5[4,4,5,5,6,6,7,7]
666 ; SSE2-NEXT: pslld $23, %xmm5
667 ; SSE2-NEXT: paddd %xmm3, %xmm5
668 ; SSE2-NEXT: cvttps2dq %xmm5, %xmm5
669 ; SSE2-NEXT: pslld $16, %xmm5
670 ; SSE2-NEXT: psrad $16, %xmm5
671 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3]
672 ; SSE2-NEXT: pslld $23, %xmm2
673 ; SSE2-NEXT: paddd %xmm3, %xmm2
674 ; SSE2-NEXT: cvttps2dq %xmm2, %xmm2
675 ; SSE2-NEXT: pslld $16, %xmm2
676 ; SSE2-NEXT: psrad $16, %xmm2
677 ; SSE2-NEXT: packssdw %xmm5, %xmm2
678 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
679 ; SSE2-NEXT: pmullw %xmm1, %xmm2
680 ; SSE2-NEXT: psrlw $8, %xmm2
681 ; SSE2-NEXT: packuswb %xmm4, %xmm2
682 ; SSE2-NEXT: movdqa %xmm2, %xmm0
685 ; SSE41-LABEL: var_funnnel_v16i8:
687 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
688 ; SSE41-NEXT: pxor %xmm3, %xmm3
689 ; SSE41-NEXT: pmovzxbd {{.*#+}} xmm4 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero
690 ; SSE41-NEXT: pmovzxbw {{.*#+}} xmm5 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero,xmm2[4],zero,xmm2[5],zero,xmm2[6],zero,xmm2[7],zero
691 ; SSE41-NEXT: punpckhbw {{.*#+}} xmm2 = xmm2[8],xmm3[8],xmm2[9],xmm3[9],xmm2[10],xmm3[10],xmm2[11],xmm3[11],xmm2[12],xmm3[12],xmm2[13],xmm3[13],xmm2[14],xmm3[14],xmm2[15],xmm3[15]
692 ; SSE41-NEXT: pmovzxwd {{.*#+}} xmm3 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero
693 ; SSE41-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4,4,5,5,6,6,7,7]
694 ; SSE41-NEXT: pslld $23, %xmm2
695 ; SSE41-NEXT: movdqa {{.*#+}} xmm6 = [1065353216,1065353216,1065353216,1065353216]
696 ; SSE41-NEXT: paddd %xmm6, %xmm2
697 ; SSE41-NEXT: cvttps2dq %xmm2, %xmm2
698 ; SSE41-NEXT: pslld $23, %xmm3
699 ; SSE41-NEXT: paddd %xmm6, %xmm3
700 ; SSE41-NEXT: cvttps2dq %xmm3, %xmm3
701 ; SSE41-NEXT: packusdw %xmm2, %xmm3
702 ; SSE41-NEXT: movdqa %xmm1, %xmm7
703 ; SSE41-NEXT: punpckhbw {{.*#+}} xmm7 = xmm7[8],xmm0[8],xmm7[9],xmm0[9],xmm7[10],xmm0[10],xmm7[11],xmm0[11],xmm7[12],xmm0[12],xmm7[13],xmm0[13],xmm7[14],xmm0[14],xmm7[15],xmm0[15]
704 ; SSE41-NEXT: pmullw %xmm3, %xmm7
705 ; SSE41-NEXT: psrlw $8, %xmm7
706 ; SSE41-NEXT: pslld $23, %xmm4
707 ; SSE41-NEXT: paddd %xmm6, %xmm4
708 ; SSE41-NEXT: cvttps2dq %xmm4, %xmm2
709 ; SSE41-NEXT: punpckhwd {{.*#+}} xmm5 = xmm5[4,4,5,5,6,6,7,7]
710 ; SSE41-NEXT: pslld $23, %xmm5
711 ; SSE41-NEXT: paddd %xmm6, %xmm5
712 ; SSE41-NEXT: cvttps2dq %xmm5, %xmm3
713 ; SSE41-NEXT: packusdw %xmm3, %xmm2
714 ; SSE41-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
715 ; SSE41-NEXT: pmullw %xmm1, %xmm2
716 ; SSE41-NEXT: psrlw $8, %xmm2
717 ; SSE41-NEXT: packuswb %xmm7, %xmm2
718 ; SSE41-NEXT: movdqa %xmm2, %xmm0
721 ; AVX1-LABEL: var_funnnel_v16i8:
723 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
724 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
725 ; AVX1-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm2[8],xmm3[8],xmm2[9],xmm3[9],xmm2[10],xmm3[10],xmm2[11],xmm3[11],xmm2[12],xmm3[12],xmm2[13],xmm3[13],xmm2[14],xmm3[14],xmm2[15],xmm3[15]
726 ; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm4 = xmm3[4,4,5,5,6,6,7,7]
727 ; AVX1-NEXT: vpslld $23, %xmm4, %xmm4
728 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm5 = [1065353216,1065353216,1065353216,1065353216]
729 ; AVX1-NEXT: vpaddd %xmm5, %xmm4, %xmm4
730 ; AVX1-NEXT: vcvttps2dq %xmm4, %xmm4
731 ; AVX1-NEXT: vpmovzxwd {{.*#+}} xmm3 = xmm3[0],zero,xmm3[1],zero,xmm3[2],zero,xmm3[3],zero
732 ; AVX1-NEXT: vpslld $23, %xmm3, %xmm3
733 ; AVX1-NEXT: vpaddd %xmm5, %xmm3, %xmm3
734 ; AVX1-NEXT: vcvttps2dq %xmm3, %xmm3
735 ; AVX1-NEXT: vpackusdw %xmm4, %xmm3, %xmm3
736 ; AVX1-NEXT: vpunpckhbw {{.*#+}} xmm4 = 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]
737 ; AVX1-NEXT: vpmullw %xmm3, %xmm4, %xmm3
738 ; AVX1-NEXT: vpsrlw $8, %xmm3, %xmm3
739 ; AVX1-NEXT: vpmovzxbd {{.*#+}} xmm4 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero
740 ; AVX1-NEXT: vpslld $23, %xmm4, %xmm4
741 ; AVX1-NEXT: vpaddd %xmm5, %xmm4, %xmm4
742 ; AVX1-NEXT: vcvttps2dq %xmm4, %xmm4
743 ; AVX1-NEXT: vpmovzxbw {{.*#+}} xmm2 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero,xmm2[4],zero,xmm2[5],zero,xmm2[6],zero,xmm2[7],zero
744 ; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm2[4,4,5,5,6,6,7,7]
745 ; AVX1-NEXT: vpslld $23, %xmm2, %xmm2
746 ; AVX1-NEXT: vpaddd %xmm5, %xmm2, %xmm2
747 ; AVX1-NEXT: vcvttps2dq %xmm2, %xmm2
748 ; AVX1-NEXT: vpackusdw %xmm2, %xmm4, %xmm2
749 ; AVX1-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
750 ; AVX1-NEXT: vpmullw %xmm2, %xmm0, %xmm0
751 ; AVX1-NEXT: vpsrlw $8, %xmm0, %xmm0
752 ; AVX1-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
755 ; AVX2-LABEL: var_funnnel_v16i8:
757 ; AVX2-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
758 ; AVX2-NEXT: vpmovzxwd {{.*#+}} ymm3 = xmm3[0],zero,xmm3[1],zero,xmm3[2],zero,xmm3[3],zero,xmm3[4],zero,xmm3[5],zero,xmm3[6],zero,xmm3[7],zero
759 ; AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
760 ; AVX2-NEXT: vpxor %xmm4, %xmm4, %xmm4
761 ; AVX2-NEXT: vpunpckhbw {{.*#+}} xmm4 = xmm2[8],xmm4[8],xmm2[9],xmm4[9],xmm2[10],xmm4[10],xmm2[11],xmm4[11],xmm2[12],xmm4[12],xmm2[13],xmm4[13],xmm2[14],xmm4[14],xmm2[15],xmm4[15]
762 ; AVX2-NEXT: vpmovzxwd {{.*#+}} ymm4 = xmm4[0],zero,xmm4[1],zero,xmm4[2],zero,xmm4[3],zero,xmm4[4],zero,xmm4[5],zero,xmm4[6],zero,xmm4[7],zero
763 ; AVX2-NEXT: vpsllvd %ymm4, %ymm3, %ymm3
764 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm4 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15,16,17,20,21,24,25,28,29,24,25,28,29,28,29,30,31]
765 ; AVX2-NEXT: vpshufb %ymm4, %ymm3, %ymm3
766 ; AVX2-NEXT: vpermq {{.*#+}} ymm3 = ymm3[0,2,2,3]
767 ; AVX2-NEXT: vpsrlw $8, %xmm3, %xmm3
768 ; AVX2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
769 ; AVX2-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
770 ; AVX2-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero,xmm2[4],zero,xmm2[5],zero,xmm2[6],zero,xmm2[7],zero
771 ; AVX2-NEXT: vpmovzxwd {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
772 ; AVX2-NEXT: vpsllvd %ymm1, %ymm0, %ymm0
773 ; AVX2-NEXT: vpshufb %ymm4, %ymm0, %ymm0
774 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,2,3]
775 ; AVX2-NEXT: vpsrlw $8, %xmm0, %xmm0
776 ; AVX2-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
777 ; AVX2-NEXT: vzeroupper
780 ; AVX512F-LABEL: var_funnnel_v16i8:
782 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm3 = [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]
783 ; AVX512F-NEXT: vpand %xmm3, %xmm2, %xmm4
784 ; AVX512F-NEXT: vpmovzxbd {{.*#+}} zmm4 = xmm4[0],zero,zero,zero,xmm4[1],zero,zero,zero,xmm4[2],zero,zero,zero,xmm4[3],zero,zero,zero,xmm4[4],zero,zero,zero,xmm4[5],zero,zero,zero,xmm4[6],zero,zero,zero,xmm4[7],zero,zero,zero,xmm4[8],zero,zero,zero,xmm4[9],zero,zero,zero,xmm4[10],zero,zero,zero,xmm4[11],zero,zero,zero,xmm4[12],zero,zero,zero,xmm4[13],zero,zero,zero,xmm4[14],zero,zero,zero,xmm4[15],zero,zero,zero
785 ; 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
786 ; AVX512F-NEXT: vpsllvd %zmm4, %zmm0, %zmm0
787 ; AVX512F-NEXT: vpandn %xmm3, %xmm2, %xmm2
788 ; AVX512F-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
789 ; AVX512F-NEXT: vpsrlw $1, %xmm1, %xmm1
790 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
791 ; 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
792 ; AVX512F-NEXT: vpsrlvd %zmm2, %zmm1, %zmm1
793 ; AVX512F-NEXT: vpord %zmm1, %zmm0, %zmm0
794 ; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
795 ; AVX512F-NEXT: vzeroupper
798 ; AVX512VL-LABEL: var_funnnel_v16i8:
800 ; AVX512VL-NEXT: vmovdqa {{.*#+}} xmm3 = [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]
801 ; AVX512VL-NEXT: vpand %xmm3, %xmm2, %xmm4
802 ; AVX512VL-NEXT: vpmovzxbd {{.*#+}} zmm4 = xmm4[0],zero,zero,zero,xmm4[1],zero,zero,zero,xmm4[2],zero,zero,zero,xmm4[3],zero,zero,zero,xmm4[4],zero,zero,zero,xmm4[5],zero,zero,zero,xmm4[6],zero,zero,zero,xmm4[7],zero,zero,zero,xmm4[8],zero,zero,zero,xmm4[9],zero,zero,zero,xmm4[10],zero,zero,zero,xmm4[11],zero,zero,zero,xmm4[12],zero,zero,zero,xmm4[13],zero,zero,zero,xmm4[14],zero,zero,zero,xmm4[15],zero,zero,zero
803 ; 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
804 ; AVX512VL-NEXT: vpsllvd %zmm4, %zmm0, %zmm0
805 ; AVX512VL-NEXT: vpandn %xmm3, %xmm2, %xmm2
806 ; AVX512VL-NEXT: vpmovzxbd {{.*#+}} zmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero,xmm2[4],zero,zero,zero,xmm2[5],zero,zero,zero,xmm2[6],zero,zero,zero,xmm2[7],zero,zero,zero,xmm2[8],zero,zero,zero,xmm2[9],zero,zero,zero,xmm2[10],zero,zero,zero,xmm2[11],zero,zero,zero,xmm2[12],zero,zero,zero,xmm2[13],zero,zero,zero,xmm2[14],zero,zero,zero,xmm2[15],zero,zero,zero
807 ; AVX512VL-NEXT: vpsrlw $1, %xmm1, %xmm1
808 ; AVX512VL-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
809 ; 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
810 ; AVX512VL-NEXT: vpsrlvd %zmm2, %zmm1, %zmm1
811 ; AVX512VL-NEXT: vpord %zmm1, %zmm0, %zmm0
812 ; AVX512VL-NEXT: vpmovdb %zmm0, %xmm0
813 ; AVX512VL-NEXT: vzeroupper
814 ; AVX512VL-NEXT: retq
816 ; AVX512BW-LABEL: var_funnnel_v16i8:
818 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
819 ; AVX512BW-NEXT: vpmovzxbw {{.*#+}} ymm2 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero,xmm2[4],zero,xmm2[5],zero,xmm2[6],zero,xmm2[7],zero,xmm2[8],zero,xmm2[9],zero,xmm2[10],zero,xmm2[11],zero,xmm2[12],zero,xmm2[13],zero,xmm2[14],zero,xmm2[15],zero
820 ; AVX512BW-NEXT: vpmovzxbw {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero,xmm1[8],zero,xmm1[9],zero,xmm1[10],zero,xmm1[11],zero,xmm1[12],zero,xmm1[13],zero,xmm1[14],zero,xmm1[15],zero
821 ; AVX512BW-NEXT: vpmovzxbw {{.*#+}} 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,xmm0[8],zero,xmm0[9],zero,xmm0[10],zero,xmm0[11],zero,xmm0[12],zero,xmm0[13],zero,xmm0[14],zero,xmm0[15],zero
822 ; AVX512BW-NEXT: vpsllw $8, %ymm0, %ymm0
823 ; AVX512BW-NEXT: vpor %ymm1, %ymm0, %ymm0
824 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
825 ; AVX512BW-NEXT: vpsrlw $8, %ymm0, %ymm0
826 ; AVX512BW-NEXT: vpmovwb %zmm0, %ymm0
827 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
828 ; AVX512BW-NEXT: vzeroupper
829 ; AVX512BW-NEXT: retq
831 ; AVX512VBMI2-LABEL: var_funnnel_v16i8:
832 ; AVX512VBMI2: # %bb.0:
833 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
834 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
835 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} ymm3 = [0,64,1,65,2,66,3,67,4,68,5,69,6,70,7,71,8,72,9,73,10,74,11,75,12,76,13,77,14,78,15,79]
836 ; AVX512VBMI2-NEXT: vpermt2b %zmm0, %zmm3, %zmm1
837 ; AVX512VBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm0
838 ; AVX512VBMI2-NEXT: vpmovzxbw {{.*#+}} 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,xmm0[8],zero,xmm0[9],zero,xmm0[10],zero,xmm0[11],zero,xmm0[12],zero,xmm0[13],zero,xmm0[14],zero,xmm0[15],zero
839 ; AVX512VBMI2-NEXT: vpsllvw %zmm0, %zmm1, %zmm0
840 ; AVX512VBMI2-NEXT: vpsrlw $8, %ymm0, %ymm0
841 ; AVX512VBMI2-NEXT: vpmovwb %zmm0, %ymm0
842 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
843 ; AVX512VBMI2-NEXT: vzeroupper
844 ; AVX512VBMI2-NEXT: retq
846 ; AVX512VLBW-LABEL: var_funnnel_v16i8:
847 ; AVX512VLBW: # %bb.0:
848 ; AVX512VLBW-NEXT: vpmovzxbw {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero,xmm1[8],zero,xmm1[9],zero,xmm1[10],zero,xmm1[11],zero,xmm1[12],zero,xmm1[13],zero,xmm1[14],zero,xmm1[15],zero
849 ; AVX512VLBW-NEXT: vpmovzxbw {{.*#+}} 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,xmm0[8],zero,xmm0[9],zero,xmm0[10],zero,xmm0[11],zero,xmm0[12],zero,xmm0[13],zero,xmm0[14],zero,xmm0[15],zero
850 ; AVX512VLBW-NEXT: vpsllw $8, %ymm0, %ymm0
851 ; AVX512VLBW-NEXT: vpor %ymm1, %ymm0, %ymm0
852 ; AVX512VLBW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm1
853 ; AVX512VLBW-NEXT: vpmovzxbw {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero,xmm1[8],zero,xmm1[9],zero,xmm1[10],zero,xmm1[11],zero,xmm1[12],zero,xmm1[13],zero,xmm1[14],zero,xmm1[15],zero
854 ; AVX512VLBW-NEXT: vpsllvw %ymm1, %ymm0, %ymm0
855 ; AVX512VLBW-NEXT: vpsrlw $8, %ymm0, %ymm0
856 ; AVX512VLBW-NEXT: vpmovwb %ymm0, %xmm0
857 ; AVX512VLBW-NEXT: vzeroupper
858 ; AVX512VLBW-NEXT: retq
860 ; AVX512VLVBMI2-LABEL: var_funnnel_v16i8:
861 ; AVX512VLVBMI2: # %bb.0:
862 ; AVX512VLVBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $ymm1
863 ; AVX512VLVBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
864 ; AVX512VLVBMI2-NEXT: vmovdqa {{.*#+}} ymm3 = [0,32,1,33,2,34,3,35,4,36,5,37,6,38,7,39,8,40,9,41,10,42,11,43,12,44,13,45,14,46,15,47]
865 ; AVX512VLVBMI2-NEXT: vpermi2b %ymm0, %ymm1, %ymm3
866 ; AVX512VLVBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm0
867 ; AVX512VLVBMI2-NEXT: vpmovzxbw {{.*#+}} 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,xmm0[8],zero,xmm0[9],zero,xmm0[10],zero,xmm0[11],zero,xmm0[12],zero,xmm0[13],zero,xmm0[14],zero,xmm0[15],zero
868 ; AVX512VLVBMI2-NEXT: vpsllvw %ymm0, %ymm3, %ymm0
869 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %ymm0, %ymm0
870 ; AVX512VLVBMI2-NEXT: vpmovwb %ymm0, %xmm0
871 ; AVX512VLVBMI2-NEXT: vzeroupper
872 ; AVX512VLVBMI2-NEXT: retq
874 ; XOP-LABEL: var_funnnel_v16i8:
876 ; XOP-NEXT: vpcmpeqd %xmm3, %xmm3, %xmm3
877 ; XOP-NEXT: vpshlb %xmm3, %xmm1, %xmm1
878 ; XOP-NEXT: vmovdqa {{.*#+}} xmm3 = [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]
879 ; XOP-NEXT: vpandn %xmm3, %xmm2, %xmm4
880 ; XOP-NEXT: vpxor %xmm5, %xmm5, %xmm5
881 ; XOP-NEXT: vpsubb %xmm4, %xmm5, %xmm4
882 ; XOP-NEXT: vpshlb %xmm4, %xmm1, %xmm1
883 ; XOP-NEXT: vpand %xmm3, %xmm2, %xmm2
884 ; XOP-NEXT: vpshlb %xmm2, %xmm0, %xmm0
885 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
888 ; X86-SSE2-LABEL: var_funnnel_v16i8:
890 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
891 ; X86-SSE2-NEXT: pxor %xmm5, %xmm5
892 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm4
893 ; X86-SSE2-NEXT: punpckhbw {{.*#+}} xmm4 = xmm4[8],xmm5[8],xmm4[9],xmm5[9],xmm4[10],xmm5[10],xmm4[11],xmm5[11],xmm4[12],xmm5[12],xmm4[13],xmm5[13],xmm4[14],xmm5[14],xmm4[15],xmm5[15]
894 ; X86-SSE2-NEXT: movdqa %xmm4, %xmm6
895 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm6 = xmm6[4,4,5,5,6,6,7,7]
896 ; X86-SSE2-NEXT: pslld $23, %xmm6
897 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
898 ; X86-SSE2-NEXT: paddd %xmm3, %xmm6
899 ; X86-SSE2-NEXT: cvttps2dq %xmm6, %xmm6
900 ; X86-SSE2-NEXT: pslld $16, %xmm6
901 ; X86-SSE2-NEXT: psrad $16, %xmm6
902 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0,0,1,1,2,2,3,3]
903 ; X86-SSE2-NEXT: pslld $23, %xmm4
904 ; X86-SSE2-NEXT: paddd %xmm3, %xmm4
905 ; X86-SSE2-NEXT: cvttps2dq %xmm4, %xmm7
906 ; X86-SSE2-NEXT: pslld $16, %xmm7
907 ; X86-SSE2-NEXT: psrad $16, %xmm7
908 ; X86-SSE2-NEXT: packssdw %xmm6, %xmm7
909 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm4
910 ; X86-SSE2-NEXT: punpckhbw {{.*#+}} xmm4 = xmm4[8],xmm0[8],xmm4[9],xmm0[9],xmm4[10],xmm0[10],xmm4[11],xmm0[11],xmm4[12],xmm0[12],xmm4[13],xmm0[13],xmm4[14],xmm0[14],xmm4[15],xmm0[15]
911 ; X86-SSE2-NEXT: pmullw %xmm7, %xmm4
912 ; X86-SSE2-NEXT: psrlw $8, %xmm4
913 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1],xmm2[2],xmm5[2],xmm2[3],xmm5[3],xmm2[4],xmm5[4],xmm2[5],xmm5[5],xmm2[6],xmm5[6],xmm2[7],xmm5[7]
914 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm5
915 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm5 = xmm5[4,4,5,5,6,6,7,7]
916 ; X86-SSE2-NEXT: pslld $23, %xmm5
917 ; X86-SSE2-NEXT: paddd %xmm3, %xmm5
918 ; X86-SSE2-NEXT: cvttps2dq %xmm5, %xmm5
919 ; X86-SSE2-NEXT: pslld $16, %xmm5
920 ; X86-SSE2-NEXT: psrad $16, %xmm5
921 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3]
922 ; X86-SSE2-NEXT: pslld $23, %xmm2
923 ; X86-SSE2-NEXT: paddd %xmm3, %xmm2
924 ; X86-SSE2-NEXT: cvttps2dq %xmm2, %xmm2
925 ; X86-SSE2-NEXT: pslld $16, %xmm2
926 ; X86-SSE2-NEXT: psrad $16, %xmm2
927 ; X86-SSE2-NEXT: packssdw %xmm5, %xmm2
928 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
929 ; X86-SSE2-NEXT: pmullw %xmm1, %xmm2
930 ; X86-SSE2-NEXT: psrlw $8, %xmm2
931 ; X86-SSE2-NEXT: packuswb %xmm4, %xmm2
932 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm0
933 ; X86-SSE2-NEXT: retl
934 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %y, <16 x i8> %amt)
939 ; Uniform Variable Shifts
942 define <2 x i64> @splatvar_funnnel_v2i64(<2 x i64> %x, <2 x i64> %y, <2 x i64> %amt) nounwind {
943 ; SSE-LABEL: splatvar_funnnel_v2i64:
945 ; SSE-NEXT: movdqa {{.*#+}} xmm3 = [63,63]
946 ; SSE-NEXT: movdqa %xmm2, %xmm4
947 ; SSE-NEXT: pandn %xmm3, %xmm4
948 ; SSE-NEXT: psrlq $1, %xmm1
949 ; SSE-NEXT: psrlq %xmm4, %xmm1
950 ; SSE-NEXT: pand %xmm3, %xmm2
951 ; SSE-NEXT: psllq %xmm2, %xmm0
952 ; SSE-NEXT: por %xmm1, %xmm0
955 ; AVX-LABEL: splatvar_funnnel_v2i64:
957 ; AVX-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
958 ; AVX-NEXT: vpandn %xmm3, %xmm2, %xmm4
959 ; AVX-NEXT: vpsrlq $1, %xmm1, %xmm1
960 ; AVX-NEXT: vpsrlq %xmm4, %xmm1, %xmm1
961 ; AVX-NEXT: vpand %xmm3, %xmm2, %xmm2
962 ; AVX-NEXT: vpsllq %xmm2, %xmm0, %xmm0
963 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
966 ; AVX512F-LABEL: splatvar_funnnel_v2i64:
968 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
969 ; AVX512F-NEXT: vpandn %xmm3, %xmm2, %xmm4
970 ; AVX512F-NEXT: vpsrlq $1, %xmm1, %xmm1
971 ; AVX512F-NEXT: vpsrlq %xmm4, %xmm1, %xmm1
972 ; AVX512F-NEXT: vpand %xmm3, %xmm2, %xmm2
973 ; AVX512F-NEXT: vpsllq %xmm2, %xmm0, %xmm0
974 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
977 ; AVX512VL-LABEL: splatvar_funnnel_v2i64:
979 ; AVX512VL-NEXT: vpbroadcastq {{.*#+}} xmm3 = [63,63]
980 ; AVX512VL-NEXT: vpandn %xmm3, %xmm2, %xmm4
981 ; AVX512VL-NEXT: vpsrlq $1, %xmm1, %xmm1
982 ; AVX512VL-NEXT: vpsrlq %xmm4, %xmm1, %xmm1
983 ; AVX512VL-NEXT: vpand %xmm3, %xmm2, %xmm2
984 ; AVX512VL-NEXT: vpsllq %xmm2, %xmm0, %xmm0
985 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
986 ; AVX512VL-NEXT: retq
988 ; AVX512BW-LABEL: splatvar_funnnel_v2i64:
990 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
991 ; AVX512BW-NEXT: vpandn %xmm3, %xmm2, %xmm4
992 ; AVX512BW-NEXT: vpsrlq $1, %xmm1, %xmm1
993 ; AVX512BW-NEXT: vpsrlq %xmm4, %xmm1, %xmm1
994 ; AVX512BW-NEXT: vpand %xmm3, %xmm2, %xmm2
995 ; AVX512BW-NEXT: vpsllq %xmm2, %xmm0, %xmm0
996 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
997 ; AVX512BW-NEXT: retq
999 ; AVX512VBMI2-LABEL: splatvar_funnnel_v2i64:
1000 ; AVX512VBMI2: # %bb.0:
1001 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1002 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1003 ; AVX512VBMI2-NEXT: vpbroadcastq %xmm2, %xmm2
1004 ; AVX512VBMI2-NEXT: vpshldvq %zmm2, %zmm1, %zmm0
1005 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1006 ; AVX512VBMI2-NEXT: vzeroupper
1007 ; AVX512VBMI2-NEXT: retq
1009 ; AVX512VLBW-LABEL: splatvar_funnnel_v2i64:
1010 ; AVX512VLBW: # %bb.0:
1011 ; AVX512VLBW-NEXT: vpbroadcastq {{.*#+}} xmm3 = [63,63]
1012 ; AVX512VLBW-NEXT: vpandn %xmm3, %xmm2, %xmm4
1013 ; AVX512VLBW-NEXT: vpsrlq $1, %xmm1, %xmm1
1014 ; AVX512VLBW-NEXT: vpsrlq %xmm4, %xmm1, %xmm1
1015 ; AVX512VLBW-NEXT: vpand %xmm3, %xmm2, %xmm2
1016 ; AVX512VLBW-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1017 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1018 ; AVX512VLBW-NEXT: retq
1020 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v2i64:
1021 ; AVX512VLVBMI2: # %bb.0:
1022 ; AVX512VLVBMI2-NEXT: vpbroadcastq %xmm2, %xmm2
1023 ; AVX512VLVBMI2-NEXT: vpshldvq %xmm2, %xmm1, %xmm0
1024 ; AVX512VLVBMI2-NEXT: retq
1026 ; XOP-LABEL: splatvar_funnnel_v2i64:
1028 ; XOP-NEXT: vmovdqa {{.*#+}} xmm3 = [63,63]
1029 ; XOP-NEXT: vpandn %xmm3, %xmm2, %xmm4
1030 ; XOP-NEXT: vpsrlq $1, %xmm1, %xmm1
1031 ; XOP-NEXT: vpsrlq %xmm4, %xmm1, %xmm1
1032 ; XOP-NEXT: vpand %xmm3, %xmm2, %xmm2
1033 ; XOP-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1034 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
1037 ; X86-SSE2-LABEL: splatvar_funnnel_v2i64:
1038 ; X86-SSE2: # %bb.0:
1039 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm3 = [63,0,63,0]
1040 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm4
1041 ; X86-SSE2-NEXT: pandn %xmm3, %xmm4
1042 ; X86-SSE2-NEXT: psrlq $1, %xmm1
1043 ; X86-SSE2-NEXT: psrlq %xmm4, %xmm1
1044 ; X86-SSE2-NEXT: pand %xmm3, %xmm2
1045 ; X86-SSE2-NEXT: psllq %xmm2, %xmm0
1046 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1047 ; X86-SSE2-NEXT: retl
1048 %splat = shufflevector <2 x i64> %amt, <2 x i64> undef, <2 x i32> zeroinitializer
1049 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %y, <2 x i64> %splat)
1053 define <4 x i32> @splatvar_funnnel_v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> %amt) nounwind {
1054 ; SSE-LABEL: splatvar_funnnel_v4i32:
1056 ; SSE-NEXT: movdqa %xmm1, %xmm3
1057 ; SSE-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm0[2],xmm3[3],xmm0[3]
1058 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
1059 ; SSE-NEXT: psllq %xmm2, %xmm3
1060 ; SSE-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1061 ; SSE-NEXT: psllq %xmm2, %xmm1
1062 ; SSE-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,3],xmm3[1,3]
1063 ; SSE-NEXT: movaps %xmm1, %xmm0
1066 ; AVX-LABEL: splatvar_funnnel_v4i32:
1068 ; AVX-NEXT: vpunpckhdq {{.*#+}} xmm3 = xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1069 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1070 ; AVX-NEXT: vpsllq %xmm2, %xmm3, %xmm3
1071 ; AVX-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1072 ; AVX-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1073 ; AVX-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,3],xmm3[1,3]
1076 ; AVX512F-LABEL: splatvar_funnnel_v4i32:
1078 ; AVX512F-NEXT: vpunpckhdq {{.*#+}} xmm3 = xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1079 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1080 ; AVX512F-NEXT: vpsllq %xmm2, %xmm3, %xmm3
1081 ; AVX512F-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1082 ; AVX512F-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1083 ; AVX512F-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,3],xmm3[1,3]
1084 ; AVX512F-NEXT: retq
1086 ; AVX512VL-LABEL: splatvar_funnnel_v4i32:
1087 ; AVX512VL: # %bb.0:
1088 ; AVX512VL-NEXT: vpunpckhdq {{.*#+}} xmm3 = xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1089 ; AVX512VL-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1090 ; AVX512VL-NEXT: vpsllq %xmm2, %xmm3, %xmm3
1091 ; AVX512VL-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1092 ; AVX512VL-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1093 ; AVX512VL-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,3],xmm3[1,3]
1094 ; AVX512VL-NEXT: retq
1096 ; AVX512BW-LABEL: splatvar_funnnel_v4i32:
1097 ; AVX512BW: # %bb.0:
1098 ; AVX512BW-NEXT: vpunpckhdq {{.*#+}} xmm3 = xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1099 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1100 ; AVX512BW-NEXT: vpsllq %xmm2, %xmm3, %xmm3
1101 ; AVX512BW-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1102 ; AVX512BW-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1103 ; AVX512BW-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,3],xmm3[1,3]
1104 ; AVX512BW-NEXT: retq
1106 ; AVX512VBMI2-LABEL: splatvar_funnnel_v4i32:
1107 ; AVX512VBMI2: # %bb.0:
1108 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1109 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1110 ; AVX512VBMI2-NEXT: vpbroadcastd %xmm2, %xmm2
1111 ; AVX512VBMI2-NEXT: vpshldvd %zmm2, %zmm1, %zmm0
1112 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1113 ; AVX512VBMI2-NEXT: vzeroupper
1114 ; AVX512VBMI2-NEXT: retq
1116 ; AVX512VLBW-LABEL: splatvar_funnnel_v4i32:
1117 ; AVX512VLBW: # %bb.0:
1118 ; AVX512VLBW-NEXT: vpunpckhdq {{.*#+}} xmm3 = xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1119 ; AVX512VLBW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1120 ; AVX512VLBW-NEXT: vpsllq %xmm2, %xmm3, %xmm3
1121 ; AVX512VLBW-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1122 ; AVX512VLBW-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1123 ; AVX512VLBW-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,3],xmm3[1,3]
1124 ; AVX512VLBW-NEXT: retq
1126 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v4i32:
1127 ; AVX512VLVBMI2: # %bb.0:
1128 ; AVX512VLVBMI2-NEXT: vpbroadcastd %xmm2, %xmm2
1129 ; AVX512VLVBMI2-NEXT: vpshldvd %xmm2, %xmm1, %xmm0
1130 ; AVX512VLVBMI2-NEXT: retq
1132 ; XOP-LABEL: splatvar_funnnel_v4i32:
1134 ; XOP-NEXT: vpunpckhdq {{.*#+}} xmm3 = xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1135 ; XOP-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1136 ; XOP-NEXT: vpsllq %xmm2, %xmm3, %xmm3
1137 ; XOP-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1138 ; XOP-NEXT: vpsllq %xmm2, %xmm0, %xmm0
1139 ; XOP-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,3],xmm3[1,3]
1142 ; X86-SSE2-LABEL: splatvar_funnnel_v4i32:
1143 ; X86-SSE2: # %bb.0:
1144 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm3
1145 ; X86-SSE2-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm0[2],xmm3[3],xmm0[3]
1146 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
1147 ; X86-SSE2-NEXT: psllq %xmm2, %xmm3
1148 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1149 ; X86-SSE2-NEXT: psllq %xmm2, %xmm1
1150 ; X86-SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,3],xmm3[1,3]
1151 ; X86-SSE2-NEXT: movaps %xmm1, %xmm0
1152 ; X86-SSE2-NEXT: retl
1153 %splat = shufflevector <4 x i32> %amt, <4 x i32> undef, <4 x i32> zeroinitializer
1154 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> %splat)
1158 define <8 x i16> @splatvar_funnnel_v8i16(<8 x i16> %x, <8 x i16> %y, <8 x i16> %amt) nounwind {
1159 ; SSE-LABEL: splatvar_funnnel_v8i16:
1161 ; SSE-NEXT: movdqa {{.*#+}} xmm3 = [15,0,0,0]
1162 ; SSE-NEXT: movdqa %xmm2, %xmm4
1163 ; SSE-NEXT: pandn %xmm3, %xmm4
1164 ; SSE-NEXT: psrlw $1, %xmm1
1165 ; SSE-NEXT: psrlw %xmm4, %xmm1
1166 ; SSE-NEXT: pand %xmm3, %xmm2
1167 ; SSE-NEXT: psllw %xmm2, %xmm0
1168 ; SSE-NEXT: por %xmm1, %xmm0
1171 ; AVX-LABEL: splatvar_funnnel_v8i16:
1173 ; AVX-NEXT: vmovdqa {{.*#+}} xmm3 = [15,0,0,0]
1174 ; AVX-NEXT: vpandn %xmm3, %xmm2, %xmm4
1175 ; AVX-NEXT: vpsrlw $1, %xmm1, %xmm1
1176 ; AVX-NEXT: vpsrlw %xmm4, %xmm1, %xmm1
1177 ; AVX-NEXT: vpand %xmm3, %xmm2, %xmm2
1178 ; AVX-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1179 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1182 ; AVX512F-LABEL: splatvar_funnnel_v8i16:
1184 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm3 = [15,0,0,0]
1185 ; AVX512F-NEXT: vpandn %xmm3, %xmm2, %xmm4
1186 ; AVX512F-NEXT: vpsrlw $1, %xmm1, %xmm1
1187 ; AVX512F-NEXT: vpsrlw %xmm4, %xmm1, %xmm1
1188 ; AVX512F-NEXT: vpand %xmm3, %xmm2, %xmm2
1189 ; AVX512F-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1190 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
1191 ; AVX512F-NEXT: retq
1193 ; AVX512VL-LABEL: splatvar_funnnel_v8i16:
1194 ; AVX512VL: # %bb.0:
1195 ; AVX512VL-NEXT: vmovdqa {{.*#+}} xmm3 = [15,0,0,0]
1196 ; AVX512VL-NEXT: vpandn %xmm3, %xmm2, %xmm4
1197 ; AVX512VL-NEXT: vpsrlw $1, %xmm1, %xmm1
1198 ; AVX512VL-NEXT: vpsrlw %xmm4, %xmm1, %xmm1
1199 ; AVX512VL-NEXT: vpand %xmm3, %xmm2, %xmm2
1200 ; AVX512VL-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1201 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
1202 ; AVX512VL-NEXT: retq
1204 ; AVX512BW-LABEL: splatvar_funnnel_v8i16:
1205 ; AVX512BW: # %bb.0:
1206 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm3 = [15,0,0,0]
1207 ; AVX512BW-NEXT: vpandn %xmm3, %xmm2, %xmm4
1208 ; AVX512BW-NEXT: vpsrlw $1, %xmm1, %xmm1
1209 ; AVX512BW-NEXT: vpsrlw %xmm4, %xmm1, %xmm1
1210 ; AVX512BW-NEXT: vpand %xmm3, %xmm2, %xmm2
1211 ; AVX512BW-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1212 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1213 ; AVX512BW-NEXT: retq
1215 ; AVX512VBMI2-LABEL: splatvar_funnnel_v8i16:
1216 ; AVX512VBMI2: # %bb.0:
1217 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1218 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1219 ; AVX512VBMI2-NEXT: vpbroadcastw %xmm2, %xmm2
1220 ; AVX512VBMI2-NEXT: vpshldvw %zmm2, %zmm1, %zmm0
1221 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1222 ; AVX512VBMI2-NEXT: vzeroupper
1223 ; AVX512VBMI2-NEXT: retq
1225 ; AVX512VLBW-LABEL: splatvar_funnnel_v8i16:
1226 ; AVX512VLBW: # %bb.0:
1227 ; AVX512VLBW-NEXT: vmovdqa {{.*#+}} xmm3 = [15,0,0,0]
1228 ; AVX512VLBW-NEXT: vpandn %xmm3, %xmm2, %xmm4
1229 ; AVX512VLBW-NEXT: vpsrlw $1, %xmm1, %xmm1
1230 ; AVX512VLBW-NEXT: vpsrlw %xmm4, %xmm1, %xmm1
1231 ; AVX512VLBW-NEXT: vpand %xmm3, %xmm2, %xmm2
1232 ; AVX512VLBW-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1233 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1234 ; AVX512VLBW-NEXT: retq
1236 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v8i16:
1237 ; AVX512VLVBMI2: # %bb.0:
1238 ; AVX512VLVBMI2-NEXT: vpbroadcastw %xmm2, %xmm2
1239 ; AVX512VLVBMI2-NEXT: vpshldvw %xmm2, %xmm1, %xmm0
1240 ; AVX512VLVBMI2-NEXT: retq
1242 ; XOP-LABEL: splatvar_funnnel_v8i16:
1244 ; XOP-NEXT: vmovdqa {{.*#+}} xmm3 = [15,0,0,0]
1245 ; XOP-NEXT: vpandn %xmm3, %xmm2, %xmm4
1246 ; XOP-NEXT: vpsrlw $1, %xmm1, %xmm1
1247 ; XOP-NEXT: vpsrlw %xmm4, %xmm1, %xmm1
1248 ; XOP-NEXT: vpand %xmm3, %xmm2, %xmm2
1249 ; XOP-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1250 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
1253 ; X86-SSE2-LABEL: splatvar_funnnel_v8i16:
1254 ; X86-SSE2: # %bb.0:
1255 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm3 = [15,0,0,0]
1256 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm4
1257 ; X86-SSE2-NEXT: pandn %xmm3, %xmm4
1258 ; X86-SSE2-NEXT: psrlw $1, %xmm1
1259 ; X86-SSE2-NEXT: psrlw %xmm4, %xmm1
1260 ; X86-SSE2-NEXT: pand %xmm3, %xmm2
1261 ; X86-SSE2-NEXT: psllw %xmm2, %xmm0
1262 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1263 ; X86-SSE2-NEXT: retl
1264 %splat = shufflevector <8 x i16> %amt, <8 x i16> undef, <8 x i32> zeroinitializer
1265 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %y, <8 x i16> %splat)
1269 define <16 x i8> @splatvar_funnnel_v16i8(<16 x i8> %x, <16 x i8> %y, <16 x i8> %amt) nounwind {
1270 ; SSE-LABEL: splatvar_funnnel_v16i8:
1272 ; SSE-NEXT: movdqa %xmm1, %xmm3
1273 ; SSE-NEXT: punpckhbw {{.*#+}} xmm3 = xmm3[8],xmm0[8],xmm3[9],xmm0[9],xmm3[10],xmm0[10],xmm3[11],xmm0[11],xmm3[12],xmm0[12],xmm3[13],xmm0[13],xmm3[14],xmm0[14],xmm3[15],xmm0[15]
1274 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
1275 ; SSE-NEXT: psllw %xmm2, %xmm3
1276 ; SSE-NEXT: psrlw $8, %xmm3
1277 ; SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1278 ; SSE-NEXT: psllw %xmm2, %xmm1
1279 ; SSE-NEXT: psrlw $8, %xmm1
1280 ; SSE-NEXT: packuswb %xmm3, %xmm1
1281 ; SSE-NEXT: movdqa %xmm1, %xmm0
1284 ; AVX-LABEL: splatvar_funnnel_v16i8:
1286 ; AVX-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1287 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1288 ; AVX-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1289 ; AVX-NEXT: vpsrlw $8, %xmm3, %xmm3
1290 ; AVX-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1291 ; AVX-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1292 ; AVX-NEXT: vpsrlw $8, %xmm0, %xmm0
1293 ; AVX-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
1296 ; AVX512F-LABEL: splatvar_funnnel_v16i8:
1298 ; AVX512F-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1299 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1300 ; AVX512F-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1301 ; AVX512F-NEXT: vpsrlw $8, %xmm3, %xmm3
1302 ; AVX512F-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1303 ; AVX512F-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1304 ; AVX512F-NEXT: vpsrlw $8, %xmm0, %xmm0
1305 ; AVX512F-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
1306 ; AVX512F-NEXT: retq
1308 ; AVX512VL-LABEL: splatvar_funnnel_v16i8:
1309 ; AVX512VL: # %bb.0:
1310 ; AVX512VL-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1311 ; AVX512VL-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1312 ; AVX512VL-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1313 ; AVX512VL-NEXT: vpsrlw $8, %xmm3, %xmm3
1314 ; AVX512VL-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1315 ; AVX512VL-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1316 ; AVX512VL-NEXT: vpsrlw $8, %xmm0, %xmm0
1317 ; AVX512VL-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
1318 ; AVX512VL-NEXT: retq
1320 ; AVX512BW-LABEL: splatvar_funnnel_v16i8:
1321 ; AVX512BW: # %bb.0:
1322 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1323 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1324 ; AVX512BW-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1325 ; AVX512BW-NEXT: vpsrlw $8, %xmm3, %xmm3
1326 ; AVX512BW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1327 ; AVX512BW-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1328 ; AVX512BW-NEXT: vpsrlw $8, %xmm0, %xmm0
1329 ; AVX512BW-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
1330 ; AVX512BW-NEXT: retq
1332 ; AVX512VBMI2-LABEL: splatvar_funnnel_v16i8:
1333 ; AVX512VBMI2: # %bb.0:
1334 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1335 ; AVX512VBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1336 ; AVX512VBMI2-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1337 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm3, %xmm3
1338 ; AVX512VBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1339 ; AVX512VBMI2-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1340 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1341 ; AVX512VBMI2-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
1342 ; AVX512VBMI2-NEXT: retq
1344 ; AVX512VLBW-LABEL: splatvar_funnnel_v16i8:
1345 ; AVX512VLBW: # %bb.0:
1346 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1347 ; AVX512VLBW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1348 ; AVX512VLBW-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1349 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm3, %xmm3
1350 ; AVX512VLBW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1351 ; AVX512VLBW-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1352 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm0, %xmm0
1353 ; AVX512VLBW-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
1354 ; AVX512VLBW-NEXT: retq
1356 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v16i8:
1357 ; AVX512VLVBMI2: # %bb.0:
1358 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1359 ; AVX512VLVBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1360 ; AVX512VLVBMI2-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1361 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm3, %xmm3
1362 ; AVX512VLVBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1363 ; AVX512VLVBMI2-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1364 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1365 ; AVX512VLVBMI2-NEXT: vpackuswb %xmm3, %xmm0, %xmm0
1366 ; AVX512VLVBMI2-NEXT: retq
1368 ; XOP-LABEL: splatvar_funnnel_v16i8:
1370 ; XOP-NEXT: vpunpckhbw {{.*#+}} xmm3 = 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]
1371 ; XOP-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1372 ; XOP-NEXT: vpsllw %xmm2, %xmm3, %xmm3
1373 ; XOP-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1374 ; XOP-NEXT: vpsllw %xmm2, %xmm0, %xmm0
1375 ; XOP-NEXT: vpperm {{.*#+}} xmm0 = xmm0[1,3,5,7,9,11,13,15],xmm3[1,3,5,7,9,11,13,15]
1378 ; X86-SSE2-LABEL: splatvar_funnnel_v16i8:
1379 ; X86-SSE2: # %bb.0:
1380 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm3
1381 ; X86-SSE2-NEXT: punpckhbw {{.*#+}} xmm3 = xmm3[8],xmm0[8],xmm3[9],xmm0[9],xmm3[10],xmm0[10],xmm3[11],xmm0[11],xmm3[12],xmm0[12],xmm3[13],xmm0[13],xmm3[14],xmm0[14],xmm3[15],xmm0[15]
1382 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
1383 ; X86-SSE2-NEXT: psllw %xmm2, %xmm3
1384 ; X86-SSE2-NEXT: psrlw $8, %xmm3
1385 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1386 ; X86-SSE2-NEXT: psllw %xmm2, %xmm1
1387 ; X86-SSE2-NEXT: psrlw $8, %xmm1
1388 ; X86-SSE2-NEXT: packuswb %xmm3, %xmm1
1389 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm0
1390 ; X86-SSE2-NEXT: retl
1391 %splat = shufflevector <16 x i8> %amt, <16 x i8> undef, <16 x i32> zeroinitializer
1392 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %y, <16 x i8> %splat)
1396 ; CGP should allow a cross-block splat shift amount to be seen in SDAG.
1397 ; PR37426 - https://bugs.llvm.org/show_bug.cgi?id=37426
1399 define void @sink_splatvar(ptr %p, i32 %shift_amt) {
1400 ; SSE-LABEL: sink_splatvar:
1401 ; SSE: # %bb.0: # %entry
1402 ; SSE-NEXT: movd %esi, %xmm0
1403 ; SSE-NEXT: movq $-1024, %rax # imm = 0xFC00
1404 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1405 ; SSE-NEXT: .p2align 4, 0x90
1406 ; SSE-NEXT: .LBB8_1: # %loop
1407 ; SSE-NEXT: # =>This Inner Loop Header: Depth=1
1408 ; SSE-NEXT: movdqu 1024(%rdi,%rax), %xmm1
1409 ; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm1[2,2,3,3]
1410 ; SSE-NEXT: psllq %xmm0, %xmm2
1411 ; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,0,1,1]
1412 ; SSE-NEXT: psllq %xmm0, %xmm1
1413 ; SSE-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,3],xmm2[1,3]
1414 ; SSE-NEXT: movups %xmm1, 1024(%rdi,%rax)
1415 ; SSE-NEXT: addq $16, %rax
1416 ; SSE-NEXT: jne .LBB8_1
1417 ; SSE-NEXT: # %bb.2: # %end
1420 ; AVX1-LABEL: sink_splatvar:
1421 ; AVX1: # %bb.0: # %entry
1422 ; AVX1-NEXT: vmovd %esi, %xmm0
1423 ; AVX1-NEXT: movq $-1024, %rax # imm = 0xFC00
1424 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1425 ; AVX1-NEXT: .p2align 4, 0x90
1426 ; AVX1-NEXT: .LBB8_1: # %loop
1427 ; AVX1-NEXT: # =>This Inner Loop Header: Depth=1
1428 ; AVX1-NEXT: vmovdqu 1024(%rdi,%rax), %xmm1
1429 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm1[2,2,3,3]
1430 ; AVX1-NEXT: vpsllq %xmm0, %xmm2, %xmm2
1431 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,1,1]
1432 ; AVX1-NEXT: vpsllq %xmm0, %xmm1, %xmm1
1433 ; AVX1-NEXT: vshufps {{.*#+}} xmm1 = xmm1[1,3],xmm2[1,3]
1434 ; AVX1-NEXT: vmovups %xmm1, 1024(%rdi,%rax)
1435 ; AVX1-NEXT: addq $16, %rax
1436 ; AVX1-NEXT: jne .LBB8_1
1437 ; AVX1-NEXT: # %bb.2: # %end
1440 ; AVX2-LABEL: sink_splatvar:
1441 ; AVX2: # %bb.0: # %entry
1442 ; AVX2-NEXT: vmovd %esi, %xmm0
1443 ; AVX2-NEXT: vpbroadcastd %xmm0, %xmm0
1444 ; AVX2-NEXT: movq $-1024, %rax # imm = 0xFC00
1445 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm1 = [31,31,31,31]
1446 ; AVX2-NEXT: vpand %xmm1, %xmm0, %xmm0
1447 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm1 = [32,32,32,32]
1448 ; AVX2-NEXT: vpsubd %xmm0, %xmm1, %xmm1
1449 ; AVX2-NEXT: .p2align 4, 0x90
1450 ; AVX2-NEXT: .LBB8_1: # %loop
1451 ; AVX2-NEXT: # =>This Inner Loop Header: Depth=1
1452 ; AVX2-NEXT: vmovdqu 1024(%rdi,%rax), %xmm2
1453 ; AVX2-NEXT: vpsllvd %xmm0, %xmm2, %xmm3
1454 ; AVX2-NEXT: vpsrlvd %xmm1, %xmm2, %xmm2
1455 ; AVX2-NEXT: vpor %xmm2, %xmm3, %xmm2
1456 ; AVX2-NEXT: vmovdqu %xmm2, 1024(%rdi,%rax)
1457 ; AVX2-NEXT: addq $16, %rax
1458 ; AVX2-NEXT: jne .LBB8_1
1459 ; AVX2-NEXT: # %bb.2: # %end
1462 ; AVX512F-LABEL: sink_splatvar:
1463 ; AVX512F: # %bb.0: # %entry
1464 ; AVX512F-NEXT: vmovd %esi, %xmm0
1465 ; AVX512F-NEXT: vpbroadcastd %xmm0, %xmm0
1466 ; AVX512F-NEXT: movq $-1024, %rax # imm = 0xFC00
1467 ; AVX512F-NEXT: .p2align 4, 0x90
1468 ; AVX512F-NEXT: .LBB8_1: # %loop
1469 ; AVX512F-NEXT: # =>This Inner Loop Header: Depth=1
1470 ; AVX512F-NEXT: vmovdqu 1024(%rdi,%rax), %xmm1
1471 ; AVX512F-NEXT: vprolvd %zmm0, %zmm1, %zmm1
1472 ; AVX512F-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1473 ; AVX512F-NEXT: addq $16, %rax
1474 ; AVX512F-NEXT: jne .LBB8_1
1475 ; AVX512F-NEXT: # %bb.2: # %end
1476 ; AVX512F-NEXT: vzeroupper
1477 ; AVX512F-NEXT: retq
1479 ; AVX512VL-LABEL: sink_splatvar:
1480 ; AVX512VL: # %bb.0: # %entry
1481 ; AVX512VL-NEXT: vpbroadcastd %esi, %xmm0
1482 ; AVX512VL-NEXT: movq $-1024, %rax # imm = 0xFC00
1483 ; AVX512VL-NEXT: .p2align 4, 0x90
1484 ; AVX512VL-NEXT: .LBB8_1: # %loop
1485 ; AVX512VL-NEXT: # =>This Inner Loop Header: Depth=1
1486 ; AVX512VL-NEXT: vmovdqu 1024(%rdi,%rax), %xmm1
1487 ; AVX512VL-NEXT: vprolvd %xmm0, %xmm1, %xmm1
1488 ; AVX512VL-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1489 ; AVX512VL-NEXT: addq $16, %rax
1490 ; AVX512VL-NEXT: jne .LBB8_1
1491 ; AVX512VL-NEXT: # %bb.2: # %end
1492 ; AVX512VL-NEXT: retq
1494 ; AVX512BW-LABEL: sink_splatvar:
1495 ; AVX512BW: # %bb.0: # %entry
1496 ; AVX512BW-NEXT: vmovd %esi, %xmm0
1497 ; AVX512BW-NEXT: vpbroadcastd %xmm0, %xmm0
1498 ; AVX512BW-NEXT: movq $-1024, %rax # imm = 0xFC00
1499 ; AVX512BW-NEXT: .p2align 4, 0x90
1500 ; AVX512BW-NEXT: .LBB8_1: # %loop
1501 ; AVX512BW-NEXT: # =>This Inner Loop Header: Depth=1
1502 ; AVX512BW-NEXT: vmovdqu 1024(%rdi,%rax), %xmm1
1503 ; AVX512BW-NEXT: vprolvd %zmm0, %zmm1, %zmm1
1504 ; AVX512BW-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1505 ; AVX512BW-NEXT: addq $16, %rax
1506 ; AVX512BW-NEXT: jne .LBB8_1
1507 ; AVX512BW-NEXT: # %bb.2: # %end
1508 ; AVX512BW-NEXT: vzeroupper
1509 ; AVX512BW-NEXT: retq
1511 ; AVX512VBMI2-LABEL: sink_splatvar:
1512 ; AVX512VBMI2: # %bb.0: # %entry
1513 ; AVX512VBMI2-NEXT: vmovd %esi, %xmm0
1514 ; AVX512VBMI2-NEXT: vpbroadcastd %xmm0, %xmm0
1515 ; AVX512VBMI2-NEXT: movq $-1024, %rax # imm = 0xFC00
1516 ; AVX512VBMI2-NEXT: .p2align 4, 0x90
1517 ; AVX512VBMI2-NEXT: .LBB8_1: # %loop
1518 ; AVX512VBMI2-NEXT: # =>This Inner Loop Header: Depth=1
1519 ; AVX512VBMI2-NEXT: vmovdqu 1024(%rdi,%rax), %xmm1
1520 ; AVX512VBMI2-NEXT: vprolvd %zmm0, %zmm1, %zmm1
1521 ; AVX512VBMI2-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1522 ; AVX512VBMI2-NEXT: addq $16, %rax
1523 ; AVX512VBMI2-NEXT: jne .LBB8_1
1524 ; AVX512VBMI2-NEXT: # %bb.2: # %end
1525 ; AVX512VBMI2-NEXT: vzeroupper
1526 ; AVX512VBMI2-NEXT: retq
1528 ; AVX512VLBW-LABEL: sink_splatvar:
1529 ; AVX512VLBW: # %bb.0: # %entry
1530 ; AVX512VLBW-NEXT: vpbroadcastd %esi, %xmm0
1531 ; AVX512VLBW-NEXT: movq $-1024, %rax # imm = 0xFC00
1532 ; AVX512VLBW-NEXT: .p2align 4, 0x90
1533 ; AVX512VLBW-NEXT: .LBB8_1: # %loop
1534 ; AVX512VLBW-NEXT: # =>This Inner Loop Header: Depth=1
1535 ; AVX512VLBW-NEXT: vmovdqu 1024(%rdi,%rax), %xmm1
1536 ; AVX512VLBW-NEXT: vprolvd %xmm0, %xmm1, %xmm1
1537 ; AVX512VLBW-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1538 ; AVX512VLBW-NEXT: addq $16, %rax
1539 ; AVX512VLBW-NEXT: jne .LBB8_1
1540 ; AVX512VLBW-NEXT: # %bb.2: # %end
1541 ; AVX512VLBW-NEXT: retq
1543 ; AVX512VLVBMI2-LABEL: sink_splatvar:
1544 ; AVX512VLVBMI2: # %bb.0: # %entry
1545 ; AVX512VLVBMI2-NEXT: vpbroadcastd %esi, %xmm0
1546 ; AVX512VLVBMI2-NEXT: movq $-1024, %rax # imm = 0xFC00
1547 ; AVX512VLVBMI2-NEXT: .p2align 4, 0x90
1548 ; AVX512VLVBMI2-NEXT: .LBB8_1: # %loop
1549 ; AVX512VLVBMI2-NEXT: # =>This Inner Loop Header: Depth=1
1550 ; AVX512VLVBMI2-NEXT: vmovdqu 1024(%rdi,%rax), %xmm1
1551 ; AVX512VLVBMI2-NEXT: vprolvd %xmm0, %xmm1, %xmm1
1552 ; AVX512VLVBMI2-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1553 ; AVX512VLVBMI2-NEXT: addq $16, %rax
1554 ; AVX512VLVBMI2-NEXT: jne .LBB8_1
1555 ; AVX512VLVBMI2-NEXT: # %bb.2: # %end
1556 ; AVX512VLVBMI2-NEXT: retq
1558 ; XOPAVX1-LABEL: sink_splatvar:
1559 ; XOPAVX1: # %bb.0: # %entry
1560 ; XOPAVX1-NEXT: vmovd %esi, %xmm0
1561 ; XOPAVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
1562 ; XOPAVX1-NEXT: movq $-1024, %rax # imm = 0xFC00
1563 ; XOPAVX1-NEXT: .p2align 4, 0x90
1564 ; XOPAVX1-NEXT: .LBB8_1: # %loop
1565 ; XOPAVX1-NEXT: # =>This Inner Loop Header: Depth=1
1566 ; XOPAVX1-NEXT: vprotd %xmm0, 1024(%rdi,%rax), %xmm1
1567 ; XOPAVX1-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1568 ; XOPAVX1-NEXT: addq $16, %rax
1569 ; XOPAVX1-NEXT: jne .LBB8_1
1570 ; XOPAVX1-NEXT: # %bb.2: # %end
1571 ; XOPAVX1-NEXT: retq
1573 ; XOPAVX2-LABEL: sink_splatvar:
1574 ; XOPAVX2: # %bb.0: # %entry
1575 ; XOPAVX2-NEXT: vmovd %esi, %xmm0
1576 ; XOPAVX2-NEXT: vpbroadcastd %xmm0, %xmm0
1577 ; XOPAVX2-NEXT: movq $-1024, %rax # imm = 0xFC00
1578 ; XOPAVX2-NEXT: .p2align 4, 0x90
1579 ; XOPAVX2-NEXT: .LBB8_1: # %loop
1580 ; XOPAVX2-NEXT: # =>This Inner Loop Header: Depth=1
1581 ; XOPAVX2-NEXT: vprotd %xmm0, 1024(%rdi,%rax), %xmm1
1582 ; XOPAVX2-NEXT: vmovdqu %xmm1, 1024(%rdi,%rax)
1583 ; XOPAVX2-NEXT: addq $16, %rax
1584 ; XOPAVX2-NEXT: jne .LBB8_1
1585 ; XOPAVX2-NEXT: # %bb.2: # %end
1586 ; XOPAVX2-NEXT: retq
1588 ; X86-SSE2-LABEL: sink_splatvar:
1589 ; X86-SSE2: # %bb.0: # %entry
1590 ; X86-SSE2-NEXT: pushl %esi
1591 ; X86-SSE2-NEXT: .cfi_def_cfa_offset 8
1592 ; X86-SSE2-NEXT: .cfi_offset %esi, -8
1593 ; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
1594 ; X86-SSE2-NEXT: xorl %ecx, %ecx
1595 ; X86-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1596 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1597 ; X86-SSE2-NEXT: xorl %edx, %edx
1598 ; X86-SSE2-NEXT: .p2align 4, 0x90
1599 ; X86-SSE2-NEXT: .LBB8_1: # %loop
1600 ; X86-SSE2-NEXT: # =>This Inner Loop Header: Depth=1
1601 ; X86-SSE2-NEXT: movdqu (%eax,%ecx,4), %xmm1
1602 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[2,2,3,3]
1603 ; X86-SSE2-NEXT: psllq %xmm0, %xmm2
1604 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,0,1,1]
1605 ; X86-SSE2-NEXT: psllq %xmm0, %xmm1
1606 ; X86-SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,3],xmm2[1,3]
1607 ; X86-SSE2-NEXT: movups %xmm1, (%eax,%ecx,4)
1608 ; X86-SSE2-NEXT: addl $4, %ecx
1609 ; X86-SSE2-NEXT: adcl $0, %edx
1610 ; X86-SSE2-NEXT: movl %ecx, %esi
1611 ; X86-SSE2-NEXT: xorl $256, %esi # imm = 0x100
1612 ; X86-SSE2-NEXT: orl %edx, %esi
1613 ; X86-SSE2-NEXT: jne .LBB8_1
1614 ; X86-SSE2-NEXT: # %bb.2: # %end
1615 ; X86-SSE2-NEXT: popl %esi
1616 ; X86-SSE2-NEXT: .cfi_def_cfa_offset 4
1617 ; X86-SSE2-NEXT: retl
1619 %ins = insertelement <4 x i32> undef, i32 %shift_amt, i32 0
1620 %splat = shufflevector <4 x i32> %ins, <4 x i32> undef, <4 x i32> zeroinitializer
1624 %index = phi i64 [ 0, %entry ], [ %inc, %loop ]
1625 %addr = getelementptr inbounds i32, ptr %p, i64 %index
1626 %x = load <4 x i32>, ptr %addr, align 4
1627 %fsh = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> %splat)
1628 store <4 x i32> %fsh, ptr %addr, align 4
1629 %inc = add i64 %index, 4
1630 %iv = icmp eq i64 %inc, 256
1631 br i1 %iv, label %end, label %loop
1641 define <2 x i64> @constant_funnnel_v2i64(<2 x i64> %x, <2 x i64> %y) nounwind {
1642 ; SSE2-LABEL: constant_funnnel_v2i64:
1644 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1645 ; SSE2-NEXT: psrlq $60, %xmm2
1646 ; SSE2-NEXT: psrlq $50, %xmm1
1647 ; SSE2-NEXT: shufpd {{.*#+}} xmm2 = xmm2[0],xmm1[1]
1648 ; SSE2-NEXT: movdqa %xmm0, %xmm1
1649 ; SSE2-NEXT: psllq $4, %xmm1
1650 ; SSE2-NEXT: psllq $14, %xmm0
1651 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
1652 ; SSE2-NEXT: orpd %xmm2, %xmm0
1655 ; SSE41-LABEL: constant_funnnel_v2i64:
1657 ; SSE41-NEXT: movdqa %xmm1, %xmm2
1658 ; SSE41-NEXT: psrlq $50, %xmm2
1659 ; SSE41-NEXT: psrlq $60, %xmm1
1660 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm1[0,1,2,3],xmm2[4,5,6,7]
1661 ; SSE41-NEXT: movdqa %xmm0, %xmm1
1662 ; SSE41-NEXT: psllq $14, %xmm1
1663 ; SSE41-NEXT: psllq $4, %xmm0
1664 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]
1665 ; SSE41-NEXT: por %xmm2, %xmm0
1668 ; AVX1-LABEL: constant_funnnel_v2i64:
1670 ; AVX1-NEXT: vpsrlq $50, %xmm1, %xmm2
1671 ; AVX1-NEXT: vpsrlq $60, %xmm1, %xmm1
1672 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm2[4,5,6,7]
1673 ; AVX1-NEXT: vpsllq $14, %xmm0, %xmm2
1674 ; AVX1-NEXT: vpsllq $4, %xmm0, %xmm0
1675 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm2[4,5,6,7]
1676 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
1679 ; AVX2-LABEL: constant_funnnel_v2i64:
1681 ; AVX2-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1682 ; AVX2-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1683 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1686 ; AVX512F-LABEL: constant_funnnel_v2i64:
1688 ; AVX512F-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1689 ; AVX512F-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1690 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
1691 ; AVX512F-NEXT: retq
1693 ; AVX512VL-LABEL: constant_funnnel_v2i64:
1694 ; AVX512VL: # %bb.0:
1695 ; AVX512VL-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1696 ; AVX512VL-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1697 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
1698 ; AVX512VL-NEXT: retq
1700 ; AVX512BW-LABEL: constant_funnnel_v2i64:
1701 ; AVX512BW: # %bb.0:
1702 ; AVX512BW-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1703 ; AVX512BW-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1704 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1705 ; AVX512BW-NEXT: retq
1707 ; AVX512VBMI2-LABEL: constant_funnnel_v2i64:
1708 ; AVX512VBMI2: # %bb.0:
1709 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1710 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1711 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm2 = [4,14]
1712 ; AVX512VBMI2-NEXT: vpshldvq %zmm2, %zmm1, %zmm0
1713 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1714 ; AVX512VBMI2-NEXT: vzeroupper
1715 ; AVX512VBMI2-NEXT: retq
1717 ; AVX512VLBW-LABEL: constant_funnnel_v2i64:
1718 ; AVX512VLBW: # %bb.0:
1719 ; AVX512VLBW-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1720 ; AVX512VLBW-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1721 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1722 ; AVX512VLBW-NEXT: retq
1724 ; AVX512VLVBMI2-LABEL: constant_funnnel_v2i64:
1725 ; AVX512VLVBMI2: # %bb.0:
1726 ; AVX512VLVBMI2-NEXT: vpshldvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm0
1727 ; AVX512VLVBMI2-NEXT: retq
1729 ; XOPAVX1-LABEL: constant_funnnel_v2i64:
1731 ; XOPAVX1-NEXT: vpshlq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1732 ; XOPAVX1-NEXT: vpshlq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1733 ; XOPAVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
1734 ; XOPAVX1-NEXT: retq
1736 ; XOPAVX2-LABEL: constant_funnnel_v2i64:
1738 ; XOPAVX2-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1739 ; XOPAVX2-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1740 ; XOPAVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1741 ; XOPAVX2-NEXT: retq
1743 ; X86-SSE2-LABEL: constant_funnnel_v2i64:
1744 ; X86-SSE2: # %bb.0:
1745 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm2
1746 ; X86-SSE2-NEXT: psrlq $60, %xmm2
1747 ; X86-SSE2-NEXT: psrlq $50, %xmm1
1748 ; X86-SSE2-NEXT: shufpd {{.*#+}} xmm2 = xmm2[0],xmm1[1]
1749 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1750 ; X86-SSE2-NEXT: psllq $4, %xmm1
1751 ; X86-SSE2-NEXT: psllq $14, %xmm0
1752 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
1753 ; X86-SSE2-NEXT: orpd %xmm2, %xmm0
1754 ; X86-SSE2-NEXT: retl
1755 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %y, <2 x i64> <i64 4, i64 14>)
1759 define <4 x i32> @constant_funnnel_v4i32(<4 x i32> %x, <4 x i32> %y) nounwind {
1760 ; SSE2-LABEL: constant_funnnel_v4i32:
1762 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1763 ; SSE2-NEXT: psrld $25, %xmm2
1764 ; SSE2-NEXT: movdqa %xmm1, %xmm3
1765 ; SSE2-NEXT: psrld $26, %xmm3
1766 ; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm2[1]
1767 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1768 ; SSE2-NEXT: psrld $27, %xmm2
1769 ; SSE2-NEXT: psrld $28, %xmm1
1770 ; SSE2-NEXT: punpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm2[0]
1771 ; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,3],xmm3[0,3]
1772 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
1773 ; SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1774 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
1775 ; SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
1776 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
1777 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1778 ; SSE2-NEXT: por %xmm1, %xmm0
1781 ; SSE41-LABEL: constant_funnnel_v4i32:
1783 ; SSE41-NEXT: movdqa %xmm1, %xmm2
1784 ; SSE41-NEXT: psrld $25, %xmm2
1785 ; SSE41-NEXT: movdqa %xmm1, %xmm3
1786 ; SSE41-NEXT: psrld $27, %xmm3
1787 ; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0,1,2,3],xmm2[4,5,6,7]
1788 ; SSE41-NEXT: movdqa %xmm1, %xmm2
1789 ; SSE41-NEXT: psrld $26, %xmm2
1790 ; SSE41-NEXT: psrld $28, %xmm1
1791 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm1[0,1,2,3],xmm2[4,5,6,7]
1792 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1],xmm3[2,3],xmm2[4,5],xmm3[6,7]
1793 ; SSE41-NEXT: pmulld {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1794 ; SSE41-NEXT: por %xmm2, %xmm0
1797 ; AVX1-LABEL: constant_funnnel_v4i32:
1799 ; AVX1-NEXT: vpsrld $25, %xmm1, %xmm2
1800 ; AVX1-NEXT: vpsrld $27, %xmm1, %xmm3
1801 ; AVX1-NEXT: vpblendw {{.*#+}} xmm2 = xmm3[0,1,2,3],xmm2[4,5,6,7]
1802 ; AVX1-NEXT: vpsrld $26, %xmm1, %xmm3
1803 ; AVX1-NEXT: vpsrld $28, %xmm1, %xmm1
1804 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm3[4,5,6,7]
1805 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1],xmm2[2,3],xmm1[4,5],xmm2[6,7]
1806 ; AVX1-NEXT: vpmulld {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1807 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
1810 ; AVX2-LABEL: constant_funnnel_v4i32:
1812 ; AVX2-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1813 ; AVX2-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1814 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1817 ; AVX512F-LABEL: constant_funnnel_v4i32:
1819 ; AVX512F-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1820 ; AVX512F-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1821 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
1822 ; AVX512F-NEXT: retq
1824 ; AVX512VL-LABEL: constant_funnnel_v4i32:
1825 ; AVX512VL: # %bb.0:
1826 ; AVX512VL-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1827 ; AVX512VL-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1828 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
1829 ; AVX512VL-NEXT: retq
1831 ; AVX512BW-LABEL: constant_funnnel_v4i32:
1832 ; AVX512BW: # %bb.0:
1833 ; AVX512BW-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1834 ; AVX512BW-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1835 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1836 ; AVX512BW-NEXT: retq
1838 ; AVX512VBMI2-LABEL: constant_funnnel_v4i32:
1839 ; AVX512VBMI2: # %bb.0:
1840 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1841 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1842 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm2 = [4,5,6,7]
1843 ; AVX512VBMI2-NEXT: vpshldvd %zmm2, %zmm1, %zmm0
1844 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1845 ; AVX512VBMI2-NEXT: vzeroupper
1846 ; AVX512VBMI2-NEXT: retq
1848 ; AVX512VLBW-LABEL: constant_funnnel_v4i32:
1849 ; AVX512VLBW: # %bb.0:
1850 ; AVX512VLBW-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1851 ; AVX512VLBW-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1852 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1853 ; AVX512VLBW-NEXT: retq
1855 ; AVX512VLVBMI2-LABEL: constant_funnnel_v4i32:
1856 ; AVX512VLVBMI2: # %bb.0:
1857 ; AVX512VLVBMI2-NEXT: vpshldvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm0
1858 ; AVX512VLVBMI2-NEXT: retq
1860 ; XOPAVX1-LABEL: constant_funnnel_v4i32:
1862 ; XOPAVX1-NEXT: vpshld {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1863 ; XOPAVX1-NEXT: vpshld {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1864 ; XOPAVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
1865 ; XOPAVX1-NEXT: retq
1867 ; XOPAVX2-LABEL: constant_funnnel_v4i32:
1869 ; XOPAVX2-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1870 ; XOPAVX2-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1871 ; XOPAVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1872 ; XOPAVX2-NEXT: retq
1874 ; X86-SSE2-LABEL: constant_funnnel_v4i32:
1875 ; X86-SSE2: # %bb.0:
1876 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm2
1877 ; X86-SSE2-NEXT: psrld $25, %xmm2
1878 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm3
1879 ; X86-SSE2-NEXT: psrld $26, %xmm3
1880 ; X86-SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm2[1]
1881 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm2
1882 ; X86-SSE2-NEXT: psrld $27, %xmm2
1883 ; X86-SSE2-NEXT: psrld $28, %xmm1
1884 ; X86-SSE2-NEXT: punpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm2[0]
1885 ; X86-SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,3],xmm3[0,3]
1886 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
1887 ; X86-SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1888 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
1889 ; X86-SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
1890 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
1891 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1892 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1893 ; X86-SSE2-NEXT: retl
1894 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> <i32 4, i32 5, i32 6, i32 7>)
1898 define <8 x i16> @constant_funnnel_v8i16(<8 x i16> %x, <8 x i16> %y) nounwind {
1899 ; SSE-LABEL: constant_funnnel_v8i16:
1901 ; SSE-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1902 ; SSE-NEXT: psrlw $1, %xmm1
1903 ; SSE-NEXT: pmulhuw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1904 ; SSE-NEXT: por %xmm1, %xmm0
1907 ; AVX-LABEL: constant_funnnel_v8i16:
1909 ; AVX-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1910 ; AVX-NEXT: vpsrlw $1, %xmm1, %xmm1
1911 ; AVX-NEXT: vpmulhuw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1912 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1915 ; AVX512F-LABEL: constant_funnnel_v8i16:
1917 ; AVX512F-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1918 ; AVX512F-NEXT: vpsrlw $1, %xmm1, %xmm1
1919 ; AVX512F-NEXT: vpmulhuw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1920 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
1921 ; AVX512F-NEXT: retq
1923 ; AVX512VL-LABEL: constant_funnnel_v8i16:
1924 ; AVX512VL: # %bb.0:
1925 ; AVX512VL-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1926 ; AVX512VL-NEXT: vpsrlw $1, %xmm1, %xmm1
1927 ; AVX512VL-NEXT: vpmulhuw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1928 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
1929 ; AVX512VL-NEXT: retq
1931 ; AVX512BW-LABEL: constant_funnnel_v8i16:
1932 ; AVX512BW: # %bb.0:
1933 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1934 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,2,3,4,5,6,7]
1935 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
1936 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [15,14,13,12,11,10,9,8]
1937 ; AVX512BW-NEXT: vpsrlw $1, %xmm1, %xmm1
1938 ; AVX512BW-NEXT: vpsrlvw %zmm2, %zmm1, %zmm1
1939 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1940 ; AVX512BW-NEXT: vzeroupper
1941 ; AVX512BW-NEXT: retq
1943 ; AVX512VBMI2-LABEL: constant_funnnel_v8i16:
1944 ; AVX512VBMI2: # %bb.0:
1945 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1946 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1947 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,2,3,4,5,6,7]
1948 ; AVX512VBMI2-NEXT: vpshldvw %zmm2, %zmm1, %zmm0
1949 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1950 ; AVX512VBMI2-NEXT: vzeroupper
1951 ; AVX512VBMI2-NEXT: retq
1953 ; AVX512VLBW-LABEL: constant_funnnel_v8i16:
1954 ; AVX512VLBW: # %bb.0:
1955 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1956 ; AVX512VLBW-NEXT: vpsrlw $1, %xmm1, %xmm1
1957 ; AVX512VLBW-NEXT: vpsrlvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1958 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1959 ; AVX512VLBW-NEXT: retq
1961 ; AVX512VLVBMI2-LABEL: constant_funnnel_v8i16:
1962 ; AVX512VLVBMI2: # %bb.0:
1963 ; AVX512VLVBMI2-NEXT: vpshldvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm0
1964 ; AVX512VLVBMI2-NEXT: retq
1966 ; XOP-LABEL: constant_funnnel_v8i16:
1968 ; XOP-NEXT: vpshlw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1969 ; XOP-NEXT: vpsrlw $1, %xmm1, %xmm1
1970 ; XOP-NEXT: vpshlw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1971 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
1974 ; X86-SSE2-LABEL: constant_funnnel_v8i16:
1975 ; X86-SSE2: # %bb.0:
1976 ; X86-SSE2-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1977 ; X86-SSE2-NEXT: psrlw $1, %xmm1
1978 ; X86-SSE2-NEXT: pmulhuw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1979 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1980 ; X86-SSE2-NEXT: retl
1981 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %y, <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>)
1985 define <16 x i8> @constant_funnnel_v16i8(<16 x i8> %x, <16 x i8> %y) nounwind {
1986 ; SSE-LABEL: constant_funnnel_v16i8:
1988 ; SSE-NEXT: movdqa %xmm1, %xmm2
1989 ; 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]
1990 ; SSE-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
1991 ; SSE-NEXT: psrlw $8, %xmm2
1992 ; SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
1993 ; SSE-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1994 ; SSE-NEXT: psrlw $8, %xmm1
1995 ; SSE-NEXT: packuswb %xmm2, %xmm1
1996 ; SSE-NEXT: movdqa %xmm1, %xmm0
1999 ; AVX-LABEL: constant_funnnel_v16i8:
2001 ; AVX-NEXT: vpunpckhbw {{.*#+}} xmm2 = 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]
2002 ; AVX-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
2003 ; AVX-NEXT: vpsrlw $8, %xmm2, %xmm2
2004 ; AVX-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
2005 ; AVX-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
2006 ; AVX-NEXT: vpsrlw $8, %xmm0, %xmm0
2007 ; AVX-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
2010 ; AVX512F-LABEL: constant_funnnel_v16i8:
2012 ; AVX512F-NEXT: vpunpckhbw {{.*#+}} xmm2 = 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]
2013 ; AVX512F-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
2014 ; AVX512F-NEXT: vpsrlw $8, %xmm2, %xmm2
2015 ; AVX512F-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
2016 ; AVX512F-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
2017 ; AVX512F-NEXT: vpsrlw $8, %xmm0, %xmm0
2018 ; AVX512F-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
2019 ; AVX512F-NEXT: retq
2021 ; AVX512VL-LABEL: constant_funnnel_v16i8:
2022 ; AVX512VL: # %bb.0:
2023 ; AVX512VL-NEXT: vpunpckhbw {{.*#+}} xmm2 = 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]
2024 ; AVX512VL-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
2025 ; AVX512VL-NEXT: vpsrlw $8, %xmm2, %xmm2
2026 ; AVX512VL-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
2027 ; AVX512VL-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
2028 ; AVX512VL-NEXT: vpsrlw $8, %xmm0, %xmm0
2029 ; AVX512VL-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
2030 ; AVX512VL-NEXT: retq
2032 ; AVX512BW-LABEL: constant_funnnel_v16i8:
2033 ; AVX512BW: # %bb.0:
2034 ; AVX512BW-NEXT: vmovdqa {{.*#+}} ymm2 = [0,1,2,3,4,5,6,7,0,7,6,5,4,3,2,1]
2035 ; AVX512BW-NEXT: vpmovzxbw {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero,xmm1[8],zero,xmm1[9],zero,xmm1[10],zero,xmm1[11],zero,xmm1[12],zero,xmm1[13],zero,xmm1[14],zero,xmm1[15],zero
2036 ; AVX512BW-NEXT: vpmovzxbw {{.*#+}} 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,xmm0[8],zero,xmm0[9],zero,xmm0[10],zero,xmm0[11],zero,xmm0[12],zero,xmm0[13],zero,xmm0[14],zero,xmm0[15],zero
2037 ; AVX512BW-NEXT: vpsllw $8, %ymm0, %ymm0
2038 ; AVX512BW-NEXT: vpor %ymm1, %ymm0, %ymm0
2039 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
2040 ; AVX512BW-NEXT: vpsrlw $8, %ymm0, %ymm0
2041 ; AVX512BW-NEXT: vpmovwb %zmm0, %ymm0
2042 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
2043 ; AVX512BW-NEXT: vzeroupper
2044 ; AVX512BW-NEXT: retq
2046 ; AVX512VBMI2-LABEL: constant_funnnel_v16i8:
2047 ; AVX512VBMI2: # %bb.0:
2048 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2049 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2050 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} ymm2 = [0,64,1,65,2,66,3,67,4,68,5,69,6,70,7,71,8,72,9,73,10,74,11,75,12,76,13,77,14,78,15,79]
2051 ; AVX512VBMI2-NEXT: vpermt2b %zmm0, %zmm2, %zmm1
2052 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} ymm0 = [0,1,2,3,4,5,6,7,0,7,6,5,4,3,2,1]
2053 ; AVX512VBMI2-NEXT: vpsllvw %zmm0, %zmm1, %zmm0
2054 ; AVX512VBMI2-NEXT: vpsrlw $8, %ymm0, %ymm0
2055 ; AVX512VBMI2-NEXT: vpmovwb %zmm0, %ymm0
2056 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
2057 ; AVX512VBMI2-NEXT: vzeroupper
2058 ; AVX512VBMI2-NEXT: retq
2060 ; AVX512VLBW-LABEL: constant_funnnel_v16i8:
2061 ; AVX512VLBW: # %bb.0:
2062 ; AVX512VLBW-NEXT: vpmovzxbw {{.*#+}} ymm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero,xmm1[8],zero,xmm1[9],zero,xmm1[10],zero,xmm1[11],zero,xmm1[12],zero,xmm1[13],zero,xmm1[14],zero,xmm1[15],zero
2063 ; AVX512VLBW-NEXT: vpmovzxbw {{.*#+}} 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,xmm0[8],zero,xmm0[9],zero,xmm0[10],zero,xmm0[11],zero,xmm0[12],zero,xmm0[13],zero,xmm0[14],zero,xmm0[15],zero
2064 ; AVX512VLBW-NEXT: vpsllw $8, %ymm0, %ymm0
2065 ; AVX512VLBW-NEXT: vpor %ymm1, %ymm0, %ymm0
2066 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
2067 ; AVX512VLBW-NEXT: vpsrlw $8, %ymm0, %ymm0
2068 ; AVX512VLBW-NEXT: vpmovwb %ymm0, %xmm0
2069 ; AVX512VLBW-NEXT: vzeroupper
2070 ; AVX512VLBW-NEXT: retq
2072 ; AVX512VLVBMI2-LABEL: constant_funnnel_v16i8:
2073 ; AVX512VLVBMI2: # %bb.0:
2074 ; AVX512VLVBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $ymm1
2075 ; AVX512VLVBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
2076 ; AVX512VLVBMI2-NEXT: vmovdqa {{.*#+}} ymm2 = [0,32,1,33,2,34,3,35,4,36,5,37,6,38,7,39,8,40,9,41,10,42,11,43,12,44,13,45,14,46,15,47]
2077 ; AVX512VLVBMI2-NEXT: vpermi2b %ymm0, %ymm1, %ymm2
2078 ; AVX512VLVBMI2-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %ymm0
2079 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %ymm0, %ymm0
2080 ; AVX512VLVBMI2-NEXT: vpmovwb %ymm0, %xmm0
2081 ; AVX512VLVBMI2-NEXT: vzeroupper
2082 ; AVX512VLVBMI2-NEXT: retq
2084 ; XOP-LABEL: constant_funnnel_v16i8:
2086 ; XOP-NEXT: vpcmpeqd %xmm2, %xmm2, %xmm2
2087 ; XOP-NEXT: vpshlb %xmm2, %xmm1, %xmm1
2088 ; XOP-NEXT: vpshlb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
2089 ; XOP-NEXT: vpshlb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
2090 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
2093 ; X86-SSE2-LABEL: constant_funnnel_v16i8:
2094 ; X86-SSE2: # %bb.0:
2095 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm2
2096 ; 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]
2097 ; X86-SSE2-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
2098 ; X86-SSE2-NEXT: psrlw $8, %xmm2
2099 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
2100 ; X86-SSE2-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
2101 ; X86-SSE2-NEXT: psrlw $8, %xmm1
2102 ; X86-SSE2-NEXT: packuswb %xmm2, %xmm1
2103 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm0
2104 ; X86-SSE2-NEXT: retl
2105 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %y, <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>)
2110 ; Uniform Constant Shifts
2113 define <2 x i64> @splatconstant_funnnel_v2i64(<2 x i64> %x, <2 x i64> %y) nounwind {
2114 ; SSE-LABEL: splatconstant_funnnel_v2i64:
2116 ; SSE-NEXT: psrlq $50, %xmm1
2117 ; SSE-NEXT: psllq $14, %xmm0
2118 ; SSE-NEXT: por %xmm1, %xmm0
2121 ; AVX-LABEL: splatconstant_funnnel_v2i64:
2123 ; AVX-NEXT: vpsrlq $50, %xmm1, %xmm1
2124 ; AVX-NEXT: vpsllq $14, %xmm0, %xmm0
2125 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
2128 ; AVX512F-LABEL: splatconstant_funnnel_v2i64:
2130 ; AVX512F-NEXT: vpsrlq $50, %xmm1, %xmm1
2131 ; AVX512F-NEXT: vpsllq $14, %xmm0, %xmm0
2132 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
2133 ; AVX512F-NEXT: retq
2135 ; AVX512VL-LABEL: splatconstant_funnnel_v2i64:
2136 ; AVX512VL: # %bb.0:
2137 ; AVX512VL-NEXT: vpsrlq $50, %xmm1, %xmm1
2138 ; AVX512VL-NEXT: vpsllq $14, %xmm0, %xmm0
2139 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
2140 ; AVX512VL-NEXT: retq
2142 ; AVX512BW-LABEL: splatconstant_funnnel_v2i64:
2143 ; AVX512BW: # %bb.0:
2144 ; AVX512BW-NEXT: vpsrlq $50, %xmm1, %xmm1
2145 ; AVX512BW-NEXT: vpsllq $14, %xmm0, %xmm0
2146 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
2147 ; AVX512BW-NEXT: retq
2149 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v2i64:
2150 ; AVX512VBMI2: # %bb.0:
2151 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2152 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2153 ; AVX512VBMI2-NEXT: vpshldq $14, %zmm1, %zmm0, %zmm0
2154 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2155 ; AVX512VBMI2-NEXT: vzeroupper
2156 ; AVX512VBMI2-NEXT: retq
2158 ; AVX512VLBW-LABEL: splatconstant_funnnel_v2i64:
2159 ; AVX512VLBW: # %bb.0:
2160 ; AVX512VLBW-NEXT: vpsrlq $50, %xmm1, %xmm1
2161 ; AVX512VLBW-NEXT: vpsllq $14, %xmm0, %xmm0
2162 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
2163 ; AVX512VLBW-NEXT: retq
2165 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v2i64:
2166 ; AVX512VLVBMI2: # %bb.0:
2167 ; AVX512VLVBMI2-NEXT: vpshldq $14, %xmm1, %xmm0, %xmm0
2168 ; AVX512VLVBMI2-NEXT: retq
2170 ; XOP-LABEL: splatconstant_funnnel_v2i64:
2172 ; XOP-NEXT: vpsrlq $50, %xmm1, %xmm1
2173 ; XOP-NEXT: vpsllq $14, %xmm0, %xmm0
2174 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
2177 ; X86-SSE2-LABEL: splatconstant_funnnel_v2i64:
2178 ; X86-SSE2: # %bb.0:
2179 ; X86-SSE2-NEXT: psrlq $50, %xmm1
2180 ; X86-SSE2-NEXT: psllq $14, %xmm0
2181 ; X86-SSE2-NEXT: por %xmm1, %xmm0
2182 ; X86-SSE2-NEXT: retl
2183 %res = call <2 x i64> @llvm.fshl.v2i64(<2 x i64> %x, <2 x i64> %y, <2 x i64> <i64 14, i64 14>)
2187 define <4 x i32> @splatconstant_funnnel_v4i32(<4 x i32> %x, <4 x i32> %y) nounwind {
2188 ; SSE-LABEL: splatconstant_funnnel_v4i32:
2190 ; SSE-NEXT: psrld $28, %xmm1
2191 ; SSE-NEXT: pslld $4, %xmm0
2192 ; SSE-NEXT: por %xmm1, %xmm0
2195 ; AVX-LABEL: splatconstant_funnnel_v4i32:
2197 ; AVX-NEXT: vpsrld $28, %xmm1, %xmm1
2198 ; AVX-NEXT: vpslld $4, %xmm0, %xmm0
2199 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
2202 ; AVX512F-LABEL: splatconstant_funnnel_v4i32:
2204 ; AVX512F-NEXT: vpsrld $28, %xmm1, %xmm1
2205 ; AVX512F-NEXT: vpslld $4, %xmm0, %xmm0
2206 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
2207 ; AVX512F-NEXT: retq
2209 ; AVX512VL-LABEL: splatconstant_funnnel_v4i32:
2210 ; AVX512VL: # %bb.0:
2211 ; AVX512VL-NEXT: vpsrld $28, %xmm1, %xmm1
2212 ; AVX512VL-NEXT: vpslld $4, %xmm0, %xmm0
2213 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
2214 ; AVX512VL-NEXT: retq
2216 ; AVX512BW-LABEL: splatconstant_funnnel_v4i32:
2217 ; AVX512BW: # %bb.0:
2218 ; AVX512BW-NEXT: vpsrld $28, %xmm1, %xmm1
2219 ; AVX512BW-NEXT: vpslld $4, %xmm0, %xmm0
2220 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
2221 ; AVX512BW-NEXT: retq
2223 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v4i32:
2224 ; AVX512VBMI2: # %bb.0:
2225 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2226 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2227 ; AVX512VBMI2-NEXT: vpshldd $4, %zmm1, %zmm0, %zmm0
2228 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2229 ; AVX512VBMI2-NEXT: vzeroupper
2230 ; AVX512VBMI2-NEXT: retq
2232 ; AVX512VLBW-LABEL: splatconstant_funnnel_v4i32:
2233 ; AVX512VLBW: # %bb.0:
2234 ; AVX512VLBW-NEXT: vpsrld $28, %xmm1, %xmm1
2235 ; AVX512VLBW-NEXT: vpslld $4, %xmm0, %xmm0
2236 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
2237 ; AVX512VLBW-NEXT: retq
2239 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v4i32:
2240 ; AVX512VLVBMI2: # %bb.0:
2241 ; AVX512VLVBMI2-NEXT: vpshldd $4, %xmm1, %xmm0, %xmm0
2242 ; AVX512VLVBMI2-NEXT: retq
2244 ; XOP-LABEL: splatconstant_funnnel_v4i32:
2246 ; XOP-NEXT: vpsrld $28, %xmm1, %xmm1
2247 ; XOP-NEXT: vpslld $4, %xmm0, %xmm0
2248 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
2251 ; X86-SSE2-LABEL: splatconstant_funnnel_v4i32:
2252 ; X86-SSE2: # %bb.0:
2253 ; X86-SSE2-NEXT: psrld $28, %xmm1
2254 ; X86-SSE2-NEXT: pslld $4, %xmm0
2255 ; X86-SSE2-NEXT: por %xmm1, %xmm0
2256 ; X86-SSE2-NEXT: retl
2257 %res = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> <i32 4, i32 4, i32 4, i32 4>)
2261 define <8 x i16> @splatconstant_funnnel_v8i16(<8 x i16> %x, <8 x i16> %y) nounwind {
2262 ; SSE-LABEL: splatconstant_funnnel_v8i16:
2264 ; SSE-NEXT: psrlw $9, %xmm1
2265 ; SSE-NEXT: psllw $7, %xmm0
2266 ; SSE-NEXT: por %xmm1, %xmm0
2269 ; AVX-LABEL: splatconstant_funnnel_v8i16:
2271 ; AVX-NEXT: vpsrlw $9, %xmm1, %xmm1
2272 ; AVX-NEXT: vpsllw $7, %xmm0, %xmm0
2273 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
2276 ; AVX512F-LABEL: splatconstant_funnnel_v8i16:
2278 ; AVX512F-NEXT: vpsrlw $9, %xmm1, %xmm1
2279 ; AVX512F-NEXT: vpsllw $7, %xmm0, %xmm0
2280 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
2281 ; AVX512F-NEXT: retq
2283 ; AVX512VL-LABEL: splatconstant_funnnel_v8i16:
2284 ; AVX512VL: # %bb.0:
2285 ; AVX512VL-NEXT: vpsrlw $9, %xmm1, %xmm1
2286 ; AVX512VL-NEXT: vpsllw $7, %xmm0, %xmm0
2287 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
2288 ; AVX512VL-NEXT: retq
2290 ; AVX512BW-LABEL: splatconstant_funnnel_v8i16:
2291 ; AVX512BW: # %bb.0:
2292 ; AVX512BW-NEXT: vpsrlw $9, %xmm1, %xmm1
2293 ; AVX512BW-NEXT: vpsllw $7, %xmm0, %xmm0
2294 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
2295 ; AVX512BW-NEXT: retq
2297 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v8i16:
2298 ; AVX512VBMI2: # %bb.0:
2299 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
2300 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2301 ; AVX512VBMI2-NEXT: vpshldw $7, %zmm1, %zmm0, %zmm0
2302 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2303 ; AVX512VBMI2-NEXT: vzeroupper
2304 ; AVX512VBMI2-NEXT: retq
2306 ; AVX512VLBW-LABEL: splatconstant_funnnel_v8i16:
2307 ; AVX512VLBW: # %bb.0:
2308 ; AVX512VLBW-NEXT: vpsrlw $9, %xmm1, %xmm1
2309 ; AVX512VLBW-NEXT: vpsllw $7, %xmm0, %xmm0
2310 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
2311 ; AVX512VLBW-NEXT: retq
2313 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v8i16:
2314 ; AVX512VLVBMI2: # %bb.0:
2315 ; AVX512VLVBMI2-NEXT: vpshldw $7, %xmm1, %xmm0, %xmm0
2316 ; AVX512VLVBMI2-NEXT: retq
2318 ; XOP-LABEL: splatconstant_funnnel_v8i16:
2320 ; XOP-NEXT: vpsrlw $9, %xmm1, %xmm1
2321 ; XOP-NEXT: vpsllw $7, %xmm0, %xmm0
2322 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
2325 ; X86-SSE2-LABEL: splatconstant_funnnel_v8i16:
2326 ; X86-SSE2: # %bb.0:
2327 ; X86-SSE2-NEXT: psrlw $9, %xmm1
2328 ; X86-SSE2-NEXT: psllw $7, %xmm0
2329 ; X86-SSE2-NEXT: por %xmm1, %xmm0
2330 ; X86-SSE2-NEXT: retl
2331 %res = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %x, <8 x i16> %y, <8 x i16> <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>)
2335 define <16 x i8> @splatconstant_funnnel_v16i8(<16 x i8> %x, <16 x i8> %y) nounwind {
2336 ; SSE-LABEL: splatconstant_funnnel_v16i8:
2338 ; SSE-NEXT: psrlw $4, %xmm1
2339 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
2340 ; SSE-NEXT: psllw $4, %xmm0
2341 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
2342 ; SSE-NEXT: por %xmm1, %xmm0
2345 ; AVX-LABEL: splatconstant_funnnel_v16i8:
2347 ; AVX-NEXT: vpsrlw $4, %xmm1, %xmm1
2348 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
2349 ; AVX-NEXT: vpsllw $4, %xmm0, %xmm0
2350 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
2351 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
2354 ; AVX512F-LABEL: splatconstant_funnnel_v16i8:
2356 ; AVX512F-NEXT: vpsllw $4, %xmm0, %xmm2
2357 ; AVX512F-NEXT: vpsrlw $4, %xmm1, %xmm0
2358 ; AVX512F-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm2, %zmm0
2359 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2360 ; AVX512F-NEXT: vzeroupper
2361 ; AVX512F-NEXT: retq
2363 ; AVX512VL-LABEL: splatconstant_funnnel_v16i8:
2364 ; AVX512VL: # %bb.0:
2365 ; AVX512VL-NEXT: vpsllw $4, %xmm0, %xmm2
2366 ; AVX512VL-NEXT: vpsrlw $4, %xmm1, %xmm0
2367 ; AVX512VL-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm2, %xmm0
2368 ; AVX512VL-NEXT: retq
2370 ; AVX512BW-LABEL: splatconstant_funnnel_v16i8:
2371 ; AVX512BW: # %bb.0:
2372 ; AVX512BW-NEXT: vpsllw $4, %xmm0, %xmm2
2373 ; AVX512BW-NEXT: vpsrlw $4, %xmm1, %xmm0
2374 ; AVX512BW-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm2, %zmm0
2375 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2376 ; AVX512BW-NEXT: vzeroupper
2377 ; AVX512BW-NEXT: retq
2379 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v16i8:
2380 ; AVX512VBMI2: # %bb.0:
2381 ; AVX512VBMI2-NEXT: vpsllw $4, %xmm0, %xmm2
2382 ; AVX512VBMI2-NEXT: vpsrlw $4, %xmm1, %xmm0
2383 ; AVX512VBMI2-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm2, %zmm0
2384 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2385 ; AVX512VBMI2-NEXT: vzeroupper
2386 ; AVX512VBMI2-NEXT: retq
2388 ; AVX512VLBW-LABEL: splatconstant_funnnel_v16i8:
2389 ; AVX512VLBW: # %bb.0:
2390 ; AVX512VLBW-NEXT: vpsllw $4, %xmm0, %xmm2
2391 ; AVX512VLBW-NEXT: vpsrlw $4, %xmm1, %xmm0
2392 ; AVX512VLBW-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm2, %xmm0
2393 ; AVX512VLBW-NEXT: retq
2395 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v16i8:
2396 ; AVX512VLVBMI2: # %bb.0:
2397 ; AVX512VLVBMI2-NEXT: vpsllw $4, %xmm0, %xmm2
2398 ; AVX512VLVBMI2-NEXT: vpsrlw $4, %xmm1, %xmm0
2399 ; AVX512VLVBMI2-NEXT: vpternlogq $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm2, %xmm0
2400 ; AVX512VLVBMI2-NEXT: retq
2402 ; XOP-LABEL: splatconstant_funnnel_v16i8:
2404 ; XOP-NEXT: vpshlb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
2405 ; XOP-NEXT: vpshlb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
2406 ; XOP-NEXT: vpor %xmm1, %xmm0, %xmm0
2409 ; X86-SSE2-LABEL: splatconstant_funnnel_v16i8:
2410 ; X86-SSE2: # %bb.0:
2411 ; X86-SSE2-NEXT: psrlw $4, %xmm1
2412 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
2413 ; X86-SSE2-NEXT: psllw $4, %xmm0
2414 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
2415 ; X86-SSE2-NEXT: por %xmm1, %xmm0
2416 ; X86-SSE2-NEXT: retl
2417 %res = call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %x, <16 x i8> %y, <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>)