1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=SSE,SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=SSE,SSE41
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX2
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=AVX512F
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefix=AVX512VL
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=AVX512BW
9 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefix=AVX512VLBW
10 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vbmi,+avx512vbmi2 | FileCheck %s --check-prefix=AVX512VBMI2
11 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vbmi,+avx512vbmi2,+avx512vl | FileCheck %s --check-prefix=AVX512VLVBMI2
12 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop,+avx | FileCheck %s --check-prefixes=XOP,XOPAVX1
13 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop,+avx2 | FileCheck %s --check-prefixes=XOP,XOPAVX2
15 ; Just one 32-bit run to make sure we do reasonable things for i64 cases.
16 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86-SSE2
18 declare <2 x i64> @llvm.fshr.v2i64(<2 x i64>, <2 x i64>, <2 x i64>)
19 declare <4 x i32> @llvm.fshr.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)
20 declare <8 x i16> @llvm.fshr.v8i16(<8 x i16>, <8 x i16>, <8 x i16>)
21 declare <16 x i8> @llvm.fshr.v16i8(<16 x i8>, <16 x i8>, <16 x i8>)
27 define <2 x i64> @var_funnnel_v2i64(<2 x i64> %x, <2 x i64> %amt) nounwind {
28 ; SSE2-LABEL: var_funnnel_v2i64:
30 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [63,63]
31 ; SSE2-NEXT: pxor %xmm3, %xmm3
32 ; SSE2-NEXT: psubq %xmm1, %xmm3
33 ; SSE2-NEXT: pand %xmm2, %xmm1
34 ; SSE2-NEXT: movdqa %xmm0, %xmm4
35 ; SSE2-NEXT: psrlq %xmm1, %xmm4
36 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
37 ; SSE2-NEXT: movdqa %xmm0, %xmm5
38 ; SSE2-NEXT: psrlq %xmm1, %xmm5
39 ; SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm4[0],xmm5[1]
40 ; SSE2-NEXT: pand %xmm2, %xmm3
41 ; SSE2-NEXT: movdqa %xmm0, %xmm1
42 ; SSE2-NEXT: psllq %xmm3, %xmm1
43 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,2,3]
44 ; SSE2-NEXT: psllq %xmm2, %xmm0
45 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
46 ; SSE2-NEXT: orpd %xmm5, %xmm0
49 ; SSE41-LABEL: var_funnnel_v2i64:
51 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [63,63]
52 ; SSE41-NEXT: pxor %xmm3, %xmm3
53 ; SSE41-NEXT: psubq %xmm1, %xmm3
54 ; SSE41-NEXT: pand %xmm2, %xmm1
55 ; SSE41-NEXT: movdqa %xmm0, %xmm4
56 ; SSE41-NEXT: psrlq %xmm1, %xmm4
57 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
58 ; SSE41-NEXT: movdqa %xmm0, %xmm5
59 ; SSE41-NEXT: psrlq %xmm1, %xmm5
60 ; SSE41-NEXT: pblendw {{.*#+}} xmm5 = xmm4[0,1,2,3],xmm5[4,5,6,7]
61 ; SSE41-NEXT: pand %xmm2, %xmm3
62 ; SSE41-NEXT: movdqa %xmm0, %xmm1
63 ; SSE41-NEXT: psllq %xmm3, %xmm1
64 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,2,3]
65 ; SSE41-NEXT: psllq %xmm2, %xmm0
66 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm1[0,1,2,3],xmm0[4,5,6,7]
67 ; SSE41-NEXT: por %xmm5, %xmm0
70 ; AVX1-LABEL: var_funnnel_v2i64:
72 ; AVX1-NEXT: vmovddup {{.*#+}} xmm2 = [63,63]
73 ; AVX1-NEXT: # xmm2 = mem[0,0]
74 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm3
75 ; AVX1-NEXT: vpsrlq %xmm3, %xmm0, %xmm4
76 ; AVX1-NEXT: vpshufd {{.*#+}} xmm3 = xmm3[2,3,2,3]
77 ; AVX1-NEXT: vpsrlq %xmm3, %xmm0, %xmm3
78 ; AVX1-NEXT: vpblendw {{.*#+}} xmm3 = xmm4[0,1,2,3],xmm3[4,5,6,7]
79 ; AVX1-NEXT: vpxor %xmm4, %xmm4, %xmm4
80 ; AVX1-NEXT: vpsubq %xmm1, %xmm4, %xmm1
81 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm1
82 ; AVX1-NEXT: vpsllq %xmm1, %xmm0, %xmm2
83 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
84 ; AVX1-NEXT: vpsllq %xmm1, %xmm0, %xmm0
85 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm2[0,1,2,3],xmm0[4,5,6,7]
86 ; AVX1-NEXT: vpor %xmm0, %xmm3, %xmm0
89 ; AVX2-LABEL: var_funnnel_v2i64:
91 ; AVX2-NEXT: vpbroadcastq {{.*#+}} xmm2 = [63,63]
92 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm3
93 ; AVX2-NEXT: vpsrlvq %xmm3, %xmm0, %xmm3
94 ; AVX2-NEXT: vpxor %xmm4, %xmm4, %xmm4
95 ; AVX2-NEXT: vpsubq %xmm1, %xmm4, %xmm1
96 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm1
97 ; AVX2-NEXT: vpsllvq %xmm1, %xmm0, %xmm0
98 ; AVX2-NEXT: vpor %xmm0, %xmm3, %xmm0
101 ; AVX512F-LABEL: var_funnnel_v2i64:
103 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
104 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
105 ; AVX512F-NEXT: vprorvq %zmm1, %zmm0, %zmm0
106 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
107 ; AVX512F-NEXT: vzeroupper
110 ; AVX512VL-LABEL: var_funnnel_v2i64:
112 ; AVX512VL-NEXT: vprorvq %xmm1, %xmm0, %xmm0
113 ; AVX512VL-NEXT: retq
115 ; AVX512BW-LABEL: var_funnnel_v2i64:
117 ; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
118 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
119 ; AVX512BW-NEXT: vprorvq %zmm1, %zmm0, %zmm0
120 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
121 ; AVX512BW-NEXT: vzeroupper
122 ; AVX512BW-NEXT: retq
124 ; AVX512VLBW-LABEL: var_funnnel_v2i64:
125 ; AVX512VLBW: # %bb.0:
126 ; AVX512VLBW-NEXT: vprorvq %xmm1, %xmm0, %xmm0
127 ; AVX512VLBW-NEXT: retq
129 ; AVX512VBMI2-LABEL: var_funnnel_v2i64:
130 ; AVX512VBMI2: # %bb.0:
131 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
132 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
133 ; AVX512VBMI2-NEXT: vprorvq %zmm1, %zmm0, %zmm0
134 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
135 ; AVX512VBMI2-NEXT: vzeroupper
136 ; AVX512VBMI2-NEXT: retq
138 ; AVX512VLVBMI2-LABEL: var_funnnel_v2i64:
139 ; AVX512VLVBMI2: # %bb.0:
140 ; AVX512VLVBMI2-NEXT: vprorvq %xmm1, %xmm0, %xmm0
141 ; AVX512VLVBMI2-NEXT: retq
143 ; XOP-LABEL: var_funnnel_v2i64:
145 ; XOP-NEXT: vpxor %xmm2, %xmm2, %xmm2
146 ; XOP-NEXT: vpsubq %xmm1, %xmm2, %xmm1
147 ; XOP-NEXT: vprotq %xmm1, %xmm0, %xmm0
150 ; X86-SSE2-LABEL: var_funnnel_v2i64:
152 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [63,0,63,0]
153 ; X86-SSE2-NEXT: pxor %xmm3, %xmm3
154 ; X86-SSE2-NEXT: psubq %xmm1, %xmm3
155 ; X86-SSE2-NEXT: pand %xmm2, %xmm1
156 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm4
157 ; X86-SSE2-NEXT: psrlq %xmm1, %xmm4
158 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,2,3]
159 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm5
160 ; X86-SSE2-NEXT: psrlq %xmm1, %xmm5
161 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm4[0],xmm5[1]
162 ; X86-SSE2-NEXT: pand %xmm2, %xmm3
163 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
164 ; X86-SSE2-NEXT: psllq %xmm3, %xmm1
165 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,2,3]
166 ; X86-SSE2-NEXT: psllq %xmm2, %xmm0
167 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
168 ; X86-SSE2-NEXT: orpd %xmm5, %xmm0
169 ; X86-SSE2-NEXT: retl
170 %res = call <2 x i64> @llvm.fshr.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> %amt)
174 define <4 x i32> @var_funnnel_v4i32(<4 x i32> %x, <4 x i32> %amt) nounwind {
175 ; SSE2-LABEL: var_funnnel_v4i32:
177 ; SSE2-NEXT: pxor %xmm2, %xmm2
178 ; SSE2-NEXT: psubd %xmm1, %xmm2
179 ; SSE2-NEXT: pslld $23, %xmm2
180 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
181 ; SSE2-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
182 ; SSE2-NEXT: cvttps2dq %xmm2, %xmm1
183 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
184 ; SSE2-NEXT: pmuludq %xmm1, %xmm0
185 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,3,2,3]
186 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
187 ; SSE2-NEXT: pmuludq %xmm2, %xmm1
188 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,2,3]
189 ; SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
190 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
191 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
192 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
193 ; SSE2-NEXT: por %xmm3, %xmm0
196 ; SSE41-LABEL: var_funnnel_v4i32:
198 ; SSE41-NEXT: pxor %xmm2, %xmm2
199 ; SSE41-NEXT: psubd %xmm1, %xmm2
200 ; SSE41-NEXT: pslld $23, %xmm2
201 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
202 ; SSE41-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
203 ; SSE41-NEXT: cvttps2dq %xmm2, %xmm1
204 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,1,3,3]
205 ; SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3]
206 ; SSE41-NEXT: pmuludq %xmm2, %xmm3
207 ; SSE41-NEXT: pmuludq %xmm1, %xmm0
208 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
209 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1],xmm3[2,3],xmm1[4,5],xmm3[6,7]
210 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,0,2,2]
211 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
212 ; SSE41-NEXT: por %xmm1, %xmm0
215 ; AVX1-LABEL: var_funnnel_v4i32:
217 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
218 ; AVX1-NEXT: vpsubd %xmm1, %xmm2, %xmm1
219 ; AVX1-NEXT: vpslld $23, %xmm1, %xmm1
220 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
221 ; AVX1-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
222 ; AVX1-NEXT: vcvttps2dq %xmm1, %xmm1
223 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm1[1,1,3,3]
224 ; AVX1-NEXT: vpshufd {{.*#+}} xmm3 = xmm0[1,1,3,3]
225 ; AVX1-NEXT: vpmuludq %xmm2, %xmm3, %xmm2
226 ; AVX1-NEXT: vpmuludq %xmm1, %xmm0, %xmm0
227 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
228 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1],xmm2[2,3],xmm1[4,5],xmm2[6,7]
229 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,0,2,2]
230 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
231 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
234 ; AVX2-LABEL: var_funnnel_v4i32:
236 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [31,31,31,31]
237 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm1
238 ; AVX2-NEXT: vpsrlvd %xmm1, %xmm0, %xmm2
239 ; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm3 = [32,32,32,32]
240 ; AVX2-NEXT: vpsubd %xmm1, %xmm3, %xmm1
241 ; AVX2-NEXT: vpsllvd %xmm1, %xmm0, %xmm0
242 ; AVX2-NEXT: vpor %xmm0, %xmm2, %xmm0
245 ; AVX512F-LABEL: var_funnnel_v4i32:
247 ; AVX512F-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
248 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
249 ; AVX512F-NEXT: vprorvd %zmm1, %zmm0, %zmm0
250 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
251 ; AVX512F-NEXT: vzeroupper
254 ; AVX512VL-LABEL: var_funnnel_v4i32:
256 ; AVX512VL-NEXT: vprorvd %xmm1, %xmm0, %xmm0
257 ; AVX512VL-NEXT: retq
259 ; AVX512BW-LABEL: var_funnnel_v4i32:
261 ; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
262 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
263 ; AVX512BW-NEXT: vprorvd %zmm1, %zmm0, %zmm0
264 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
265 ; AVX512BW-NEXT: vzeroupper
266 ; AVX512BW-NEXT: retq
268 ; AVX512VLBW-LABEL: var_funnnel_v4i32:
269 ; AVX512VLBW: # %bb.0:
270 ; AVX512VLBW-NEXT: vprorvd %xmm1, %xmm0, %xmm0
271 ; AVX512VLBW-NEXT: retq
273 ; AVX512VBMI2-LABEL: var_funnnel_v4i32:
274 ; AVX512VBMI2: # %bb.0:
275 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
276 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
277 ; AVX512VBMI2-NEXT: vprorvd %zmm1, %zmm0, %zmm0
278 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
279 ; AVX512VBMI2-NEXT: vzeroupper
280 ; AVX512VBMI2-NEXT: retq
282 ; AVX512VLVBMI2-LABEL: var_funnnel_v4i32:
283 ; AVX512VLVBMI2: # %bb.0:
284 ; AVX512VLVBMI2-NEXT: vprorvd %xmm1, %xmm0, %xmm0
285 ; AVX512VLVBMI2-NEXT: retq
287 ; XOP-LABEL: var_funnnel_v4i32:
289 ; XOP-NEXT: vpxor %xmm2, %xmm2, %xmm2
290 ; XOP-NEXT: vpsubd %xmm1, %xmm2, %xmm1
291 ; XOP-NEXT: vprotd %xmm1, %xmm0, %xmm0
294 ; X86-SSE2-LABEL: var_funnnel_v4i32:
296 ; X86-SSE2-NEXT: pxor %xmm2, %xmm2
297 ; X86-SSE2-NEXT: psubd %xmm1, %xmm2
298 ; X86-SSE2-NEXT: pslld $23, %xmm2
299 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
300 ; X86-SSE2-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
301 ; X86-SSE2-NEXT: cvttps2dq %xmm2, %xmm1
302 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
303 ; X86-SSE2-NEXT: pmuludq %xmm1, %xmm0
304 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,3,2,3]
305 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
306 ; X86-SSE2-NEXT: pmuludq %xmm2, %xmm1
307 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,2,3]
308 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
309 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
310 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
311 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
312 ; X86-SSE2-NEXT: por %xmm3, %xmm0
313 ; X86-SSE2-NEXT: retl
314 %res = call <4 x i32> @llvm.fshr.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> %amt)
318 define <8 x i16> @var_funnnel_v8i16(<8 x i16> %x, <8 x i16> %amt) nounwind {
319 ; SSE2-LABEL: var_funnnel_v8i16:
321 ; SSE2-NEXT: pxor %xmm2, %xmm2
322 ; SSE2-NEXT: psubw %xmm1, %xmm2
323 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
324 ; SSE2-NEXT: movdqa %xmm2, %xmm1
325 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
326 ; SSE2-NEXT: pslld $23, %xmm1
327 ; SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
328 ; SSE2-NEXT: paddd %xmm3, %xmm1
329 ; SSE2-NEXT: cvttps2dq %xmm1, %xmm1
330 ; SSE2-NEXT: pslld $16, %xmm1
331 ; SSE2-NEXT: psrad $16, %xmm1
332 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3]
333 ; SSE2-NEXT: pslld $23, %xmm2
334 ; SSE2-NEXT: paddd %xmm3, %xmm2
335 ; SSE2-NEXT: cvttps2dq %xmm2, %xmm2
336 ; SSE2-NEXT: pslld $16, %xmm2
337 ; SSE2-NEXT: psrad $16, %xmm2
338 ; SSE2-NEXT: packssdw %xmm1, %xmm2
339 ; SSE2-NEXT: movdqa %xmm0, %xmm1
340 ; SSE2-NEXT: pmulhuw %xmm2, %xmm1
341 ; SSE2-NEXT: pmullw %xmm2, %xmm0
342 ; SSE2-NEXT: por %xmm1, %xmm0
345 ; SSE41-LABEL: var_funnnel_v8i16:
347 ; SSE41-NEXT: pxor %xmm2, %xmm2
348 ; SSE41-NEXT: psubw %xmm1, %xmm2
349 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
350 ; SSE41-NEXT: pmovzxwd {{.*#+}} xmm1 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero
351 ; SSE41-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4,4,5,5,6,6,7,7]
352 ; SSE41-NEXT: pslld $23, %xmm2
353 ; SSE41-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
354 ; SSE41-NEXT: paddd %xmm3, %xmm2
355 ; SSE41-NEXT: cvttps2dq %xmm2, %xmm2
356 ; SSE41-NEXT: pslld $23, %xmm1
357 ; SSE41-NEXT: paddd %xmm3, %xmm1
358 ; SSE41-NEXT: cvttps2dq %xmm1, %xmm1
359 ; SSE41-NEXT: packusdw %xmm2, %xmm1
360 ; SSE41-NEXT: movdqa %xmm0, %xmm2
361 ; SSE41-NEXT: pmulhuw %xmm1, %xmm2
362 ; SSE41-NEXT: pmullw %xmm1, %xmm0
363 ; SSE41-NEXT: por %xmm2, %xmm0
366 ; AVX1-LABEL: var_funnnel_v8i16:
368 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
369 ; AVX1-NEXT: vpsubw %xmm1, %xmm2, %xmm1
370 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
371 ; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4,4,5,5,6,6,7,7]
372 ; AVX1-NEXT: vpslld $23, %xmm2, %xmm2
373 ; AVX1-NEXT: vbroadcastss {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
374 ; AVX1-NEXT: vpaddd %xmm3, %xmm2, %xmm2
375 ; AVX1-NEXT: vcvttps2dq %xmm2, %xmm2
376 ; AVX1-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
377 ; AVX1-NEXT: vpslld $23, %xmm1, %xmm1
378 ; AVX1-NEXT: vpaddd %xmm3, %xmm1, %xmm1
379 ; AVX1-NEXT: vcvttps2dq %xmm1, %xmm1
380 ; AVX1-NEXT: vpackusdw %xmm2, %xmm1, %xmm1
381 ; AVX1-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
382 ; AVX1-NEXT: vpmullw %xmm1, %xmm0, %xmm0
383 ; AVX1-NEXT: vpor %xmm2, %xmm0, %xmm0
386 ; AVX2-LABEL: var_funnnel_v8i16:
388 ; AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
389 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
390 ; AVX2-NEXT: vpunpckhwd {{.*#+}} xmm3 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
391 ; AVX2-NEXT: vpunpckhwd {{.*#+}} xmm4 = xmm0[4,4,5,5,6,6,7,7]
392 ; AVX2-NEXT: vpsrlvd %xmm3, %xmm4, %xmm3
393 ; AVX2-NEXT: vpblendw {{.*#+}} xmm3 = xmm3[0],xmm2[1],xmm3[2],xmm2[3],xmm3[4],xmm2[5],xmm3[6],xmm2[7]
394 ; AVX2-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
395 ; AVX2-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
396 ; AVX2-NEXT: vpsrlvd %xmm1, %xmm0, %xmm0
397 ; AVX2-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3],xmm0[4],xmm2[5],xmm0[6],xmm2[7]
398 ; AVX2-NEXT: vpackusdw %xmm3, %xmm0, %xmm0
401 ; AVX512F-LABEL: var_funnnel_v8i16:
403 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
404 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
405 ; AVX512F-NEXT: vpunpckhwd {{.*#+}} xmm3 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
406 ; AVX512F-NEXT: vpunpckhwd {{.*#+}} xmm4 = xmm0[4,4,5,5,6,6,7,7]
407 ; AVX512F-NEXT: vpsrlvd %xmm3, %xmm4, %xmm3
408 ; AVX512F-NEXT: vpblendw {{.*#+}} xmm3 = xmm3[0],xmm2[1],xmm3[2],xmm2[3],xmm3[4],xmm2[5],xmm3[6],xmm2[7]
409 ; AVX512F-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
410 ; AVX512F-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
411 ; AVX512F-NEXT: vpsrlvd %xmm1, %xmm0, %xmm0
412 ; AVX512F-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3],xmm0[4],xmm2[5],xmm0[6],xmm2[7]
413 ; AVX512F-NEXT: vpackusdw %xmm3, %xmm0, %xmm0
416 ; AVX512VL-LABEL: var_funnnel_v8i16:
418 ; AVX512VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
419 ; AVX512VL-NEXT: vpxor %xmm2, %xmm2, %xmm2
420 ; AVX512VL-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
421 ; AVX512VL-NEXT: vpunpckhwd {{.*#+}} xmm3 = xmm0[4,4,5,5,6,6,7,7]
422 ; AVX512VL-NEXT: vpsrlvd %xmm2, %xmm3, %xmm2
423 ; AVX512VL-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
424 ; AVX512VL-NEXT: vpmovzxwd {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
425 ; AVX512VL-NEXT: vpsrlvd %xmm1, %xmm0, %xmm0
426 ; AVX512VL-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0
427 ; AVX512VL-NEXT: vpmovdw %ymm0, %xmm0
428 ; AVX512VL-NEXT: vzeroupper
429 ; AVX512VL-NEXT: retq
431 ; AVX512BW-LABEL: var_funnnel_v8i16:
433 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
434 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
435 ; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm2
436 ; AVX512BW-NEXT: vpbroadcastw {{.*#+}} xmm3 = [16,16,16,16,16,16,16,16]
437 ; AVX512BW-NEXT: vpsubw %xmm1, %xmm3, %xmm1
438 ; AVX512BW-NEXT: vpsllvw %zmm1, %zmm0, %zmm0
439 ; AVX512BW-NEXT: vpor %xmm0, %xmm2, %xmm0
440 ; AVX512BW-NEXT: vzeroupper
441 ; AVX512BW-NEXT: retq
443 ; AVX512VLBW-LABEL: var_funnnel_v8i16:
444 ; AVX512VLBW: # %bb.0:
445 ; AVX512VLBW-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
446 ; AVX512VLBW-NEXT: vpsrlvw %xmm1, %xmm0, %xmm2
447 ; AVX512VLBW-NEXT: vpbroadcastw {{.*#+}} xmm3 = [16,16,16,16,16,16,16,16]
448 ; AVX512VLBW-NEXT: vpsubw %xmm1, %xmm3, %xmm1
449 ; AVX512VLBW-NEXT: vpsllvw %xmm1, %xmm0, %xmm0
450 ; AVX512VLBW-NEXT: vpor %xmm0, %xmm2, %xmm0
451 ; AVX512VLBW-NEXT: retq
453 ; AVX512VBMI2-LABEL: var_funnnel_v8i16:
454 ; AVX512VBMI2: # %bb.0:
455 ; AVX512VBMI2-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
456 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
457 ; AVX512VBMI2-NEXT: vpshrdvw %zmm1, %zmm0, %zmm0
458 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
459 ; AVX512VBMI2-NEXT: vzeroupper
460 ; AVX512VBMI2-NEXT: retq
462 ; AVX512VLVBMI2-LABEL: var_funnnel_v8i16:
463 ; AVX512VLVBMI2: # %bb.0:
464 ; AVX512VLVBMI2-NEXT: vpshrdvw %xmm1, %xmm0, %xmm0
465 ; AVX512VLVBMI2-NEXT: retq
467 ; XOP-LABEL: var_funnnel_v8i16:
469 ; XOP-NEXT: vpxor %xmm2, %xmm2, %xmm2
470 ; XOP-NEXT: vpsubw %xmm1, %xmm2, %xmm1
471 ; XOP-NEXT: vprotw %xmm1, %xmm0, %xmm0
474 ; X86-SSE2-LABEL: var_funnnel_v8i16:
476 ; X86-SSE2-NEXT: pxor %xmm2, %xmm2
477 ; X86-SSE2-NEXT: psubw %xmm1, %xmm2
478 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
479 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm1
480 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
481 ; X86-SSE2-NEXT: pslld $23, %xmm1
482 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216]
483 ; X86-SSE2-NEXT: paddd %xmm3, %xmm1
484 ; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
485 ; X86-SSE2-NEXT: pslld $16, %xmm1
486 ; X86-SSE2-NEXT: psrad $16, %xmm1
487 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3]
488 ; X86-SSE2-NEXT: pslld $23, %xmm2
489 ; X86-SSE2-NEXT: paddd %xmm3, %xmm2
490 ; X86-SSE2-NEXT: cvttps2dq %xmm2, %xmm2
491 ; X86-SSE2-NEXT: pslld $16, %xmm2
492 ; X86-SSE2-NEXT: psrad $16, %xmm2
493 ; X86-SSE2-NEXT: packssdw %xmm1, %xmm2
494 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
495 ; X86-SSE2-NEXT: pmulhuw %xmm2, %xmm1
496 ; X86-SSE2-NEXT: pmullw %xmm2, %xmm0
497 ; X86-SSE2-NEXT: por %xmm1, %xmm0
498 ; X86-SSE2-NEXT: retl
499 %res = call <8 x i16> @llvm.fshr.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> %amt)
503 define <16 x i8> @var_funnnel_v16i8(<16 x i8> %x, <16 x i8> %amt) nounwind {
504 ; SSE2-LABEL: var_funnnel_v16i8:
506 ; SSE2-NEXT: movdqa %xmm0, %xmm2
507 ; SSE2-NEXT: pxor %xmm0, %xmm0
508 ; SSE2-NEXT: pxor %xmm3, %xmm3
509 ; SSE2-NEXT: psubb %xmm1, %xmm3
510 ; SSE2-NEXT: psllw $5, %xmm3
511 ; SSE2-NEXT: pxor %xmm1, %xmm1
512 ; SSE2-NEXT: pcmpgtb %xmm3, %xmm1
513 ; SSE2-NEXT: movdqa %xmm2, %xmm4
514 ; SSE2-NEXT: psrlw $4, %xmm4
515 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm4
516 ; SSE2-NEXT: movdqa %xmm2, %xmm5
517 ; SSE2-NEXT: psllw $4, %xmm5
518 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm5
519 ; SSE2-NEXT: por %xmm4, %xmm5
520 ; SSE2-NEXT: pand %xmm1, %xmm5
521 ; SSE2-NEXT: pandn %xmm2, %xmm1
522 ; SSE2-NEXT: por %xmm5, %xmm1
523 ; SSE2-NEXT: movdqa %xmm1, %xmm2
524 ; SSE2-NEXT: psrlw $6, %xmm2
525 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
526 ; SSE2-NEXT: movdqa %xmm1, %xmm4
527 ; SSE2-NEXT: psllw $2, %xmm4
528 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm4
529 ; SSE2-NEXT: por %xmm2, %xmm4
530 ; SSE2-NEXT: paddb %xmm3, %xmm3
531 ; SSE2-NEXT: pxor %xmm2, %xmm2
532 ; SSE2-NEXT: pcmpgtb %xmm3, %xmm2
533 ; SSE2-NEXT: pand %xmm2, %xmm4
534 ; SSE2-NEXT: pandn %xmm1, %xmm2
535 ; SSE2-NEXT: por %xmm4, %xmm2
536 ; SSE2-NEXT: movdqa %xmm2, %xmm1
537 ; SSE2-NEXT: psrlw $7, %xmm1
538 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
539 ; SSE2-NEXT: movdqa %xmm2, %xmm4
540 ; SSE2-NEXT: paddb %xmm2, %xmm4
541 ; SSE2-NEXT: por %xmm1, %xmm4
542 ; SSE2-NEXT: paddb %xmm3, %xmm3
543 ; SSE2-NEXT: pcmpgtb %xmm3, %xmm0
544 ; SSE2-NEXT: pand %xmm0, %xmm4
545 ; SSE2-NEXT: pandn %xmm2, %xmm0
546 ; SSE2-NEXT: por %xmm4, %xmm0
549 ; SSE41-LABEL: var_funnnel_v16i8:
551 ; SSE41-NEXT: movdqa %xmm0, %xmm2
552 ; SSE41-NEXT: psrlw $4, %xmm0
553 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
554 ; SSE41-NEXT: movdqa %xmm2, %xmm3
555 ; SSE41-NEXT: psllw $4, %xmm3
556 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3
557 ; SSE41-NEXT: por %xmm0, %xmm3
558 ; SSE41-NEXT: pxor %xmm0, %xmm0
559 ; SSE41-NEXT: psubb %xmm1, %xmm0
560 ; SSE41-NEXT: psllw $5, %xmm0
561 ; SSE41-NEXT: pblendvb %xmm0, %xmm3, %xmm2
562 ; SSE41-NEXT: movdqa %xmm2, %xmm1
563 ; SSE41-NEXT: psrlw $6, %xmm1
564 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
565 ; SSE41-NEXT: movdqa %xmm2, %xmm3
566 ; SSE41-NEXT: psllw $2, %xmm3
567 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3
568 ; SSE41-NEXT: por %xmm1, %xmm3
569 ; SSE41-NEXT: paddb %xmm0, %xmm0
570 ; SSE41-NEXT: pblendvb %xmm0, %xmm3, %xmm2
571 ; SSE41-NEXT: movdqa %xmm2, %xmm1
572 ; SSE41-NEXT: psrlw $7, %xmm1
573 ; SSE41-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
574 ; SSE41-NEXT: movdqa %xmm2, %xmm3
575 ; SSE41-NEXT: paddb %xmm2, %xmm3
576 ; SSE41-NEXT: por %xmm1, %xmm3
577 ; SSE41-NEXT: paddb %xmm0, %xmm0
578 ; SSE41-NEXT: pblendvb %xmm0, %xmm3, %xmm2
579 ; SSE41-NEXT: movdqa %xmm2, %xmm0
582 ; AVX-LABEL: var_funnnel_v16i8:
584 ; AVX-NEXT: vpsrlw $4, %xmm0, %xmm2
585 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
586 ; AVX-NEXT: vpsllw $4, %xmm0, %xmm3
587 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3, %xmm3
588 ; AVX-NEXT: vpor %xmm2, %xmm3, %xmm2
589 ; AVX-NEXT: vpxor %xmm3, %xmm3, %xmm3
590 ; AVX-NEXT: vpsubb %xmm1, %xmm3, %xmm1
591 ; AVX-NEXT: vpsllw $5, %xmm1, %xmm1
592 ; AVX-NEXT: vpblendvb %xmm1, %xmm2, %xmm0, %xmm0
593 ; AVX-NEXT: vpsrlw $6, %xmm0, %xmm2
594 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
595 ; AVX-NEXT: vpsllw $2, %xmm0, %xmm3
596 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm3, %xmm3
597 ; AVX-NEXT: vpor %xmm2, %xmm3, %xmm2
598 ; AVX-NEXT: vpaddb %xmm1, %xmm1, %xmm1
599 ; AVX-NEXT: vpblendvb %xmm1, %xmm2, %xmm0, %xmm0
600 ; AVX-NEXT: vpsrlw $7, %xmm0, %xmm2
601 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
602 ; AVX-NEXT: vpaddb %xmm0, %xmm0, %xmm3
603 ; AVX-NEXT: vpor %xmm2, %xmm3, %xmm2
604 ; AVX-NEXT: vpaddb %xmm1, %xmm1, %xmm1
605 ; AVX-NEXT: vpblendvb %xmm1, %xmm2, %xmm0, %xmm0
608 ; AVX512F-LABEL: var_funnnel_v16i8:
610 ; 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
611 ; AVX512F-NEXT: vpslld $8, %zmm0, %zmm2
612 ; AVX512F-NEXT: vpord %zmm2, %zmm0, %zmm0
613 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
614 ; 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
615 ; AVX512F-NEXT: vpsrlvd %zmm1, %zmm0, %zmm0
616 ; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
617 ; AVX512F-NEXT: vzeroupper
620 ; AVX512VL-LABEL: var_funnnel_v16i8:
622 ; 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
623 ; AVX512VL-NEXT: vpslld $8, %zmm0, %zmm2
624 ; AVX512VL-NEXT: vpord %zmm2, %zmm0, %zmm0
625 ; AVX512VL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
626 ; 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
627 ; AVX512VL-NEXT: vpsrlvd %zmm1, %zmm0, %zmm0
628 ; AVX512VL-NEXT: vpmovdb %zmm0, %xmm0
629 ; AVX512VL-NEXT: vzeroupper
630 ; AVX512VL-NEXT: retq
632 ; AVX512BW-LABEL: var_funnnel_v16i8:
634 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
635 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
636 ; AVX512BW-NEXT: vpxor %xmm3, %xmm3, %xmm3
637 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm1[8],xmm3[8],xmm1[9],xmm3[9],xmm1[10],xmm3[10],xmm1[11],xmm3[11],xmm1[12],xmm3[12],xmm1[13],xmm3[13],xmm1[14],xmm3[14],xmm1[15],xmm3[15]
638 ; AVX512BW-NEXT: vpsrlvw %zmm3, %zmm2, %zmm2
639 ; AVX512BW-NEXT: vpbroadcastw {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
640 ; AVX512BW-NEXT: vpand %xmm3, %xmm2, %xmm2
641 ; AVX512BW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
642 ; AVX512BW-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
643 ; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm0
644 ; AVX512BW-NEXT: vpand %xmm3, %xmm0, %xmm0
645 ; AVX512BW-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
646 ; AVX512BW-NEXT: vzeroupper
647 ; AVX512BW-NEXT: retq
649 ; AVX512VLBW-LABEL: var_funnnel_v16i8:
650 ; AVX512VLBW: # %bb.0:
651 ; AVX512VLBW-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
652 ; AVX512VLBW-NEXT: vpxor %xmm2, %xmm2, %xmm2
653 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm1[8],xmm2[8],xmm1[9],xmm2[9],xmm1[10],xmm2[10],xmm1[11],xmm2[11],xmm1[12],xmm2[12],xmm1[13],xmm2[13],xmm1[14],xmm2[14],xmm1[15],xmm2[15]
654 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
655 ; AVX512VLBW-NEXT: vpsrlvw %xmm2, %xmm3, %xmm2
656 ; AVX512VLBW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
657 ; AVX512VLBW-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
658 ; AVX512VLBW-NEXT: vpsrlvw %xmm1, %xmm0, %xmm0
659 ; AVX512VLBW-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0
660 ; AVX512VLBW-NEXT: vpmovwb %ymm0, %xmm0
661 ; AVX512VLBW-NEXT: vzeroupper
662 ; AVX512VLBW-NEXT: retq
664 ; AVX512VBMI2-LABEL: var_funnnel_v16i8:
665 ; AVX512VBMI2: # %bb.0:
666 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
667 ; AVX512VBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
668 ; AVX512VBMI2-NEXT: vpxor %xmm3, %xmm3, %xmm3
669 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm1[8],xmm3[8],xmm1[9],xmm3[9],xmm1[10],xmm3[10],xmm1[11],xmm3[11],xmm1[12],xmm3[12],xmm1[13],xmm3[13],xmm1[14],xmm3[14],xmm1[15],xmm3[15]
670 ; AVX512VBMI2-NEXT: vpsrlvw %zmm3, %zmm2, %zmm2
671 ; AVX512VBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
672 ; AVX512VBMI2-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
673 ; AVX512VBMI2-NEXT: vpsrlvw %zmm1, %zmm0, %zmm1
674 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm0 = [0,2,4,6,8,10,12,14,64,66,68,70,72,74,76,78]
675 ; AVX512VBMI2-NEXT: vpermi2b %zmm2, %zmm1, %zmm0
676 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
677 ; AVX512VBMI2-NEXT: vzeroupper
678 ; AVX512VBMI2-NEXT: retq
680 ; AVX512VLVBMI2-LABEL: var_funnnel_v16i8:
681 ; AVX512VLVBMI2: # %bb.0:
682 ; AVX512VLVBMI2-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm1
683 ; AVX512VLVBMI2-NEXT: vpxor %xmm2, %xmm2, %xmm2
684 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm1[8],xmm2[8],xmm1[9],xmm2[9],xmm1[10],xmm2[10],xmm1[11],xmm2[11],xmm1[12],xmm2[12],xmm1[13],xmm2[13],xmm1[14],xmm2[14],xmm1[15],xmm2[15]
685 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
686 ; AVX512VLVBMI2-NEXT: vpsrlvw %xmm2, %xmm3, %xmm2
687 ; AVX512VLVBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
688 ; AVX512VLVBMI2-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
689 ; AVX512VLVBMI2-NEXT: vpsrlvw %xmm1, %xmm0, %xmm0
690 ; AVX512VLVBMI2-NEXT: vinserti128 $1, %xmm2, %ymm0, %ymm0
691 ; AVX512VLVBMI2-NEXT: vpmovwb %ymm0, %xmm0
692 ; AVX512VLVBMI2-NEXT: vzeroupper
693 ; AVX512VLVBMI2-NEXT: retq
695 ; XOP-LABEL: var_funnnel_v16i8:
697 ; XOP-NEXT: vpxor %xmm2, %xmm2, %xmm2
698 ; XOP-NEXT: vpsubb %xmm1, %xmm2, %xmm1
699 ; XOP-NEXT: vprotb %xmm1, %xmm0, %xmm0
702 ; X86-SSE2-LABEL: var_funnnel_v16i8:
704 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
705 ; X86-SSE2-NEXT: pxor %xmm0, %xmm0
706 ; X86-SSE2-NEXT: pxor %xmm3, %xmm3
707 ; X86-SSE2-NEXT: psubb %xmm1, %xmm3
708 ; X86-SSE2-NEXT: psllw $5, %xmm3
709 ; X86-SSE2-NEXT: pxor %xmm1, %xmm1
710 ; X86-SSE2-NEXT: pcmpgtb %xmm3, %xmm1
711 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm4
712 ; X86-SSE2-NEXT: psrlw $4, %xmm4
713 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm4
714 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm5
715 ; X86-SSE2-NEXT: psllw $4, %xmm5
716 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm5
717 ; X86-SSE2-NEXT: por %xmm4, %xmm5
718 ; X86-SSE2-NEXT: pand %xmm1, %xmm5
719 ; X86-SSE2-NEXT: pandn %xmm2, %xmm1
720 ; X86-SSE2-NEXT: por %xmm5, %xmm1
721 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm2
722 ; X86-SSE2-NEXT: psrlw $6, %xmm2
723 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm2
724 ; X86-SSE2-NEXT: movdqa %xmm1, %xmm4
725 ; X86-SSE2-NEXT: psllw $2, %xmm4
726 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm4
727 ; X86-SSE2-NEXT: por %xmm2, %xmm4
728 ; X86-SSE2-NEXT: paddb %xmm3, %xmm3
729 ; X86-SSE2-NEXT: pxor %xmm2, %xmm2
730 ; X86-SSE2-NEXT: pcmpgtb %xmm3, %xmm2
731 ; X86-SSE2-NEXT: pand %xmm2, %xmm4
732 ; X86-SSE2-NEXT: pandn %xmm1, %xmm2
733 ; X86-SSE2-NEXT: por %xmm4, %xmm2
734 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm1
735 ; X86-SSE2-NEXT: psrlw $7, %xmm1
736 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
737 ; X86-SSE2-NEXT: movdqa %xmm2, %xmm4
738 ; X86-SSE2-NEXT: paddb %xmm2, %xmm4
739 ; X86-SSE2-NEXT: por %xmm1, %xmm4
740 ; X86-SSE2-NEXT: paddb %xmm3, %xmm3
741 ; X86-SSE2-NEXT: pcmpgtb %xmm3, %xmm0
742 ; X86-SSE2-NEXT: pand %xmm0, %xmm4
743 ; X86-SSE2-NEXT: pandn %xmm2, %xmm0
744 ; X86-SSE2-NEXT: por %xmm4, %xmm0
745 ; X86-SSE2-NEXT: retl
746 %res = call <16 x i8> @llvm.fshr.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> %amt)
751 ; Uniform Variable Shifts
754 define <2 x i64> @splatvar_funnnel_v2i64(<2 x i64> %x, <2 x i64> %amt) nounwind {
755 ; SSE-LABEL: splatvar_funnnel_v2i64:
757 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [63,63]
758 ; SSE-NEXT: pxor %xmm3, %xmm3
759 ; SSE-NEXT: psubq %xmm1, %xmm3
760 ; SSE-NEXT: pand %xmm2, %xmm1
761 ; SSE-NEXT: movdqa %xmm0, %xmm4
762 ; SSE-NEXT: psrlq %xmm1, %xmm4
763 ; SSE-NEXT: pand %xmm2, %xmm3
764 ; SSE-NEXT: psllq %xmm3, %xmm0
765 ; SSE-NEXT: por %xmm4, %xmm0
768 ; AVX1-LABEL: splatvar_funnnel_v2i64:
770 ; AVX1-NEXT: vmovddup {{.*#+}} xmm2 = [63,63]
771 ; AVX1-NEXT: # xmm2 = mem[0,0]
772 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm3
773 ; AVX1-NEXT: vpsrlq %xmm3, %xmm0, %xmm3
774 ; AVX1-NEXT: vpxor %xmm4, %xmm4, %xmm4
775 ; AVX1-NEXT: vpsubq %xmm1, %xmm4, %xmm1
776 ; AVX1-NEXT: vpand %xmm2, %xmm1, %xmm1
777 ; AVX1-NEXT: vpsllq %xmm1, %xmm0, %xmm0
778 ; AVX1-NEXT: vpor %xmm0, %xmm3, %xmm0
781 ; AVX2-LABEL: splatvar_funnnel_v2i64:
783 ; AVX2-NEXT: vpbroadcastq {{.*#+}} xmm2 = [63,63]
784 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm3
785 ; AVX2-NEXT: vpsrlq %xmm3, %xmm0, %xmm3
786 ; AVX2-NEXT: vpxor %xmm4, %xmm4, %xmm4
787 ; AVX2-NEXT: vpsubq %xmm1, %xmm4, %xmm1
788 ; AVX2-NEXT: vpand %xmm2, %xmm1, %xmm1
789 ; AVX2-NEXT: vpsllq %xmm1, %xmm0, %xmm0
790 ; AVX2-NEXT: vpor %xmm0, %xmm3, %xmm0
793 ; AVX512F-LABEL: splatvar_funnnel_v2i64:
795 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
796 ; AVX512F-NEXT: vpbroadcastq %xmm1, %xmm1
797 ; AVX512F-NEXT: vprorvq %zmm1, %zmm0, %zmm0
798 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
799 ; AVX512F-NEXT: vzeroupper
802 ; AVX512VL-LABEL: splatvar_funnnel_v2i64:
804 ; AVX512VL-NEXT: vpbroadcastq %xmm1, %xmm1
805 ; AVX512VL-NEXT: vprorvq %xmm1, %xmm0, %xmm0
806 ; AVX512VL-NEXT: retq
808 ; AVX512BW-LABEL: splatvar_funnnel_v2i64:
810 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
811 ; AVX512BW-NEXT: vpbroadcastq %xmm1, %xmm1
812 ; AVX512BW-NEXT: vprorvq %zmm1, %zmm0, %zmm0
813 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
814 ; AVX512BW-NEXT: vzeroupper
815 ; AVX512BW-NEXT: retq
817 ; AVX512VLBW-LABEL: splatvar_funnnel_v2i64:
818 ; AVX512VLBW: # %bb.0:
819 ; AVX512VLBW-NEXT: vpbroadcastq %xmm1, %xmm1
820 ; AVX512VLBW-NEXT: vprorvq %xmm1, %xmm0, %xmm0
821 ; AVX512VLBW-NEXT: retq
823 ; AVX512VBMI2-LABEL: splatvar_funnnel_v2i64:
824 ; AVX512VBMI2: # %bb.0:
825 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
826 ; AVX512VBMI2-NEXT: vpbroadcastq %xmm1, %xmm1
827 ; AVX512VBMI2-NEXT: vprorvq %zmm1, %zmm0, %zmm0
828 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
829 ; AVX512VBMI2-NEXT: vzeroupper
830 ; AVX512VBMI2-NEXT: retq
832 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v2i64:
833 ; AVX512VLVBMI2: # %bb.0:
834 ; AVX512VLVBMI2-NEXT: vpbroadcastq %xmm1, %xmm1
835 ; AVX512VLVBMI2-NEXT: vprorvq %xmm1, %xmm0, %xmm0
836 ; AVX512VLVBMI2-NEXT: retq
838 ; XOPAVX1-LABEL: splatvar_funnnel_v2i64:
840 ; XOPAVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
841 ; XOPAVX1-NEXT: vpsubq %xmm1, %xmm2, %xmm1
842 ; XOPAVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,1,0,1]
843 ; XOPAVX1-NEXT: vprotq %xmm1, %xmm0, %xmm0
846 ; XOPAVX2-LABEL: splatvar_funnnel_v2i64:
848 ; XOPAVX2-NEXT: vpbroadcastq %xmm1, %xmm1
849 ; XOPAVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
850 ; XOPAVX2-NEXT: vpsubq %xmm1, %xmm2, %xmm1
851 ; XOPAVX2-NEXT: vprotq %xmm1, %xmm0, %xmm0
854 ; X86-SSE2-LABEL: splatvar_funnnel_v2i64:
856 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [63,0,63,0]
857 ; X86-SSE2-NEXT: pxor %xmm3, %xmm3
858 ; X86-SSE2-NEXT: psubq %xmm1, %xmm3
859 ; X86-SSE2-NEXT: pand %xmm2, %xmm1
860 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm4
861 ; X86-SSE2-NEXT: psrlq %xmm1, %xmm4
862 ; X86-SSE2-NEXT: pand %xmm2, %xmm3
863 ; X86-SSE2-NEXT: psllq %xmm3, %xmm0
864 ; X86-SSE2-NEXT: por %xmm4, %xmm0
865 ; X86-SSE2-NEXT: retl
866 %splat = shufflevector <2 x i64> %amt, <2 x i64> undef, <2 x i32> zeroinitializer
867 %res = call <2 x i64> @llvm.fshr.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> %splat)
871 define <4 x i32> @splatvar_funnnel_v4i32(<4 x i32> %x, <4 x i32> %amt) nounwind {
872 ; SSE-LABEL: splatvar_funnnel_v4i32:
874 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
875 ; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,2,3,3]
876 ; SSE-NEXT: psrlq %xmm1, %xmm2
877 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
878 ; SSE-NEXT: psrlq %xmm1, %xmm0
879 ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm2[0,2]
882 ; AVX-LABEL: splatvar_funnnel_v4i32:
884 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
885 ; AVX-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[2,2,3,3]
886 ; AVX-NEXT: vpsrlq %xmm1, %xmm2, %xmm2
887 ; AVX-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
888 ; AVX-NEXT: vpsrlq %xmm1, %xmm0, %xmm0
889 ; AVX-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm2[0,2]
892 ; AVX512F-LABEL: splatvar_funnnel_v4i32:
894 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
895 ; AVX512F-NEXT: vpbroadcastd %xmm1, %xmm1
896 ; AVX512F-NEXT: vprorvd %zmm1, %zmm0, %zmm0
897 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
898 ; AVX512F-NEXT: vzeroupper
901 ; AVX512VL-LABEL: splatvar_funnnel_v4i32:
903 ; AVX512VL-NEXT: vpbroadcastd %xmm1, %xmm1
904 ; AVX512VL-NEXT: vprorvd %xmm1, %xmm0, %xmm0
905 ; AVX512VL-NEXT: retq
907 ; AVX512BW-LABEL: splatvar_funnnel_v4i32:
909 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
910 ; AVX512BW-NEXT: vpbroadcastd %xmm1, %xmm1
911 ; AVX512BW-NEXT: vprorvd %zmm1, %zmm0, %zmm0
912 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
913 ; AVX512BW-NEXT: vzeroupper
914 ; AVX512BW-NEXT: retq
916 ; AVX512VLBW-LABEL: splatvar_funnnel_v4i32:
917 ; AVX512VLBW: # %bb.0:
918 ; AVX512VLBW-NEXT: vpbroadcastd %xmm1, %xmm1
919 ; AVX512VLBW-NEXT: vprorvd %xmm1, %xmm0, %xmm0
920 ; AVX512VLBW-NEXT: retq
922 ; AVX512VBMI2-LABEL: splatvar_funnnel_v4i32:
923 ; AVX512VBMI2: # %bb.0:
924 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
925 ; AVX512VBMI2-NEXT: vpbroadcastd %xmm1, %xmm1
926 ; AVX512VBMI2-NEXT: vprorvd %zmm1, %zmm0, %zmm0
927 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
928 ; AVX512VBMI2-NEXT: vzeroupper
929 ; AVX512VBMI2-NEXT: retq
931 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v4i32:
932 ; AVX512VLVBMI2: # %bb.0:
933 ; AVX512VLVBMI2-NEXT: vpbroadcastd %xmm1, %xmm1
934 ; AVX512VLVBMI2-NEXT: vprorvd %xmm1, %xmm0, %xmm0
935 ; AVX512VLVBMI2-NEXT: retq
937 ; XOPAVX1-LABEL: splatvar_funnnel_v4i32:
939 ; XOPAVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,0,0]
940 ; XOPAVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
941 ; XOPAVX1-NEXT: vpsubd %xmm1, %xmm2, %xmm1
942 ; XOPAVX1-NEXT: vprotd %xmm1, %xmm0, %xmm0
945 ; XOPAVX2-LABEL: splatvar_funnnel_v4i32:
947 ; XOPAVX2-NEXT: vpbroadcastd %xmm1, %xmm1
948 ; XOPAVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
949 ; XOPAVX2-NEXT: vpsubd %xmm1, %xmm2, %xmm1
950 ; XOPAVX2-NEXT: vprotd %xmm1, %xmm0, %xmm0
953 ; X86-SSE2-LABEL: splatvar_funnnel_v4i32:
955 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
956 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,2,3,3]
957 ; X86-SSE2-NEXT: psrlq %xmm1, %xmm2
958 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
959 ; X86-SSE2-NEXT: psrlq %xmm1, %xmm0
960 ; X86-SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm2[0,2]
961 ; X86-SSE2-NEXT: retl
962 %splat = shufflevector <4 x i32> %amt, <4 x i32> undef, <4 x i32> zeroinitializer
963 %res = call <4 x i32> @llvm.fshr.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> %splat)
967 define <8 x i16> @splatvar_funnnel_v8i16(<8 x i16> %x, <8 x i16> %amt) nounwind {
968 ; SSE2-LABEL: splatvar_funnnel_v8i16:
970 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
971 ; SSE2-NEXT: movdqa %xmm0, %xmm2
972 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
973 ; SSE2-NEXT: psrld %xmm1, %xmm2
974 ; SSE2-NEXT: pslld $16, %xmm2
975 ; SSE2-NEXT: psrad $16, %xmm2
976 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
977 ; SSE2-NEXT: psrld %xmm1, %xmm0
978 ; SSE2-NEXT: pslld $16, %xmm0
979 ; SSE2-NEXT: psrad $16, %xmm0
980 ; SSE2-NEXT: packssdw %xmm2, %xmm0
983 ; SSE41-LABEL: splatvar_funnnel_v8i16:
985 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [15,0,0,0]
986 ; SSE41-NEXT: movdqa %xmm1, %xmm3
987 ; SSE41-NEXT: pand %xmm2, %xmm3
988 ; SSE41-NEXT: movdqa %xmm0, %xmm4
989 ; SSE41-NEXT: psrlw %xmm3, %xmm4
990 ; SSE41-NEXT: pandn %xmm2, %xmm1
991 ; SSE41-NEXT: paddw %xmm0, %xmm0
992 ; SSE41-NEXT: psllw %xmm1, %xmm0
993 ; SSE41-NEXT: por %xmm4, %xmm0
996 ; AVX-LABEL: splatvar_funnnel_v8i16:
998 ; AVX-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
999 ; AVX-NEXT: vpand %xmm2, %xmm1, %xmm3
1000 ; AVX-NEXT: vpsrlw %xmm3, %xmm0, %xmm3
1001 ; AVX-NEXT: vpandn %xmm2, %xmm1, %xmm1
1002 ; AVX-NEXT: vpaddw %xmm0, %xmm0, %xmm0
1003 ; AVX-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1004 ; AVX-NEXT: vpor %xmm3, %xmm0, %xmm0
1007 ; AVX512F-LABEL: splatvar_funnnel_v8i16:
1009 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
1010 ; AVX512F-NEXT: vpand %xmm2, %xmm1, %xmm3
1011 ; AVX512F-NEXT: vpsrlw %xmm3, %xmm0, %xmm3
1012 ; AVX512F-NEXT: vpandn %xmm2, %xmm1, %xmm1
1013 ; AVX512F-NEXT: vpaddw %xmm0, %xmm0, %xmm0
1014 ; AVX512F-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1015 ; AVX512F-NEXT: vpor %xmm3, %xmm0, %xmm0
1016 ; AVX512F-NEXT: retq
1018 ; AVX512VL-LABEL: splatvar_funnnel_v8i16:
1019 ; AVX512VL: # %bb.0:
1020 ; AVX512VL-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
1021 ; AVX512VL-NEXT: vpand %xmm2, %xmm1, %xmm3
1022 ; AVX512VL-NEXT: vpsrlw %xmm3, %xmm0, %xmm3
1023 ; AVX512VL-NEXT: vpandn %xmm2, %xmm1, %xmm1
1024 ; AVX512VL-NEXT: vpaddw %xmm0, %xmm0, %xmm0
1025 ; AVX512VL-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1026 ; AVX512VL-NEXT: vpor %xmm3, %xmm0, %xmm0
1027 ; AVX512VL-NEXT: retq
1029 ; AVX512BW-LABEL: splatvar_funnnel_v8i16:
1030 ; AVX512BW: # %bb.0:
1031 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
1032 ; AVX512BW-NEXT: vpand %xmm2, %xmm1, %xmm3
1033 ; AVX512BW-NEXT: vpsrlw %xmm3, %xmm0, %xmm3
1034 ; AVX512BW-NEXT: vpandn %xmm2, %xmm1, %xmm1
1035 ; AVX512BW-NEXT: vpaddw %xmm0, %xmm0, %xmm0
1036 ; AVX512BW-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1037 ; AVX512BW-NEXT: vpor %xmm3, %xmm0, %xmm0
1038 ; AVX512BW-NEXT: retq
1040 ; AVX512VLBW-LABEL: splatvar_funnnel_v8i16:
1041 ; AVX512VLBW: # %bb.0:
1042 ; AVX512VLBW-NEXT: vmovdqa {{.*#+}} xmm2 = [15,0,0,0]
1043 ; AVX512VLBW-NEXT: vpand %xmm2, %xmm1, %xmm3
1044 ; AVX512VLBW-NEXT: vpsrlw %xmm3, %xmm0, %xmm3
1045 ; AVX512VLBW-NEXT: vpandn %xmm2, %xmm1, %xmm1
1046 ; AVX512VLBW-NEXT: vpaddw %xmm0, %xmm0, %xmm0
1047 ; AVX512VLBW-NEXT: vpsllw %xmm1, %xmm0, %xmm0
1048 ; AVX512VLBW-NEXT: vpor %xmm3, %xmm0, %xmm0
1049 ; AVX512VLBW-NEXT: retq
1051 ; AVX512VBMI2-LABEL: splatvar_funnnel_v8i16:
1052 ; AVX512VBMI2: # %bb.0:
1053 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1054 ; AVX512VBMI2-NEXT: vpbroadcastw %xmm1, %xmm1
1055 ; AVX512VBMI2-NEXT: vpshrdvw %zmm1, %zmm0, %zmm0
1056 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1057 ; AVX512VBMI2-NEXT: vzeroupper
1058 ; AVX512VBMI2-NEXT: retq
1060 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v8i16:
1061 ; AVX512VLVBMI2: # %bb.0:
1062 ; AVX512VLVBMI2-NEXT: vpbroadcastw %xmm1, %xmm1
1063 ; AVX512VLVBMI2-NEXT: vpshrdvw %xmm1, %xmm0, %xmm0
1064 ; AVX512VLVBMI2-NEXT: retq
1066 ; XOPAVX1-LABEL: splatvar_funnnel_v8i16:
1068 ; XOPAVX1-NEXT: vpshuflw {{.*#+}} xmm1 = xmm1[0,0,0,0,4,5,6,7]
1069 ; XOPAVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1070 ; XOPAVX1-NEXT: vpsubw %xmm1, %xmm2, %xmm1
1071 ; XOPAVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,0,0]
1072 ; XOPAVX1-NEXT: vprotw %xmm1, %xmm0, %xmm0
1073 ; XOPAVX1-NEXT: retq
1075 ; XOPAVX2-LABEL: splatvar_funnnel_v8i16:
1077 ; XOPAVX2-NEXT: vpbroadcastw %xmm1, %xmm1
1078 ; XOPAVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1079 ; XOPAVX2-NEXT: vpsubw %xmm1, %xmm2, %xmm1
1080 ; XOPAVX2-NEXT: vprotw %xmm1, %xmm0, %xmm0
1081 ; XOPAVX2-NEXT: retq
1083 ; X86-SSE2-LABEL: splatvar_funnnel_v8i16:
1084 ; X86-SSE2: # %bb.0:
1085 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1086 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1087 ; X86-SSE2-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
1088 ; X86-SSE2-NEXT: psrld %xmm1, %xmm2
1089 ; X86-SSE2-NEXT: pslld $16, %xmm2
1090 ; X86-SSE2-NEXT: psrad $16, %xmm2
1091 ; X86-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1092 ; X86-SSE2-NEXT: psrld %xmm1, %xmm0
1093 ; X86-SSE2-NEXT: pslld $16, %xmm0
1094 ; X86-SSE2-NEXT: psrad $16, %xmm0
1095 ; X86-SSE2-NEXT: packssdw %xmm2, %xmm0
1096 ; X86-SSE2-NEXT: retl
1097 %splat = shufflevector <8 x i16> %amt, <8 x i16> undef, <8 x i32> zeroinitializer
1098 %res = call <8 x i16> @llvm.fshr.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> %splat)
1102 define <16 x i8> @splatvar_funnnel_v16i8(<16 x i8> %x, <16 x i8> %amt) nounwind {
1103 ; SSE-LABEL: splatvar_funnnel_v16i8:
1105 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1106 ; SSE-NEXT: movdqa %xmm0, %xmm2
1107 ; 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]
1108 ; SSE-NEXT: psrlw %xmm1, %xmm2
1109 ; SSE-NEXT: movdqa {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
1110 ; SSE-NEXT: pand %xmm3, %xmm2
1111 ; SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1112 ; SSE-NEXT: psrlw %xmm1, %xmm0
1113 ; SSE-NEXT: pand %xmm3, %xmm0
1114 ; SSE-NEXT: packuswb %xmm2, %xmm0
1117 ; AVX1-LABEL: splatvar_funnnel_v16i8:
1119 ; AVX1-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1120 ; AVX1-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1121 ; AVX1-NEXT: vpsrlw %xmm1, %xmm2, %xmm2
1122 ; AVX1-NEXT: vbroadcastss {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
1123 ; AVX1-NEXT: vpand %xmm3, %xmm2, %xmm2
1124 ; AVX1-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1125 ; AVX1-NEXT: vpsrlw %xmm1, %xmm0, %xmm0
1126 ; AVX1-NEXT: vpand %xmm3, %xmm0, %xmm0
1127 ; AVX1-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1130 ; AVX2-LABEL: splatvar_funnnel_v16i8:
1132 ; AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1133 ; AVX2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1134 ; AVX2-NEXT: vpsrlw %xmm1, %xmm2, %xmm2
1135 ; AVX2-NEXT: vpbroadcastw {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
1136 ; AVX2-NEXT: vpand %xmm3, %xmm2, %xmm2
1137 ; AVX2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1138 ; AVX2-NEXT: vpsrlw %xmm1, %xmm0, %xmm0
1139 ; AVX2-NEXT: vpand %xmm3, %xmm0, %xmm0
1140 ; AVX2-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1143 ; AVX512F-LABEL: splatvar_funnnel_v16i8:
1145 ; AVX512F-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1146 ; AVX512F-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1147 ; AVX512F-NEXT: vpsrlw %xmm1, %xmm2, %xmm2
1148 ; AVX512F-NEXT: vpbroadcastw {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
1149 ; AVX512F-NEXT: vpand %xmm3, %xmm2, %xmm2
1150 ; AVX512F-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1151 ; AVX512F-NEXT: vpsrlw %xmm1, %xmm0, %xmm0
1152 ; AVX512F-NEXT: vpand %xmm3, %xmm0, %xmm0
1153 ; AVX512F-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1154 ; AVX512F-NEXT: retq
1156 ; AVX512VL-LABEL: splatvar_funnnel_v16i8:
1157 ; AVX512VL: # %bb.0:
1158 ; AVX512VL-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1159 ; AVX512VL-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1160 ; AVX512VL-NEXT: vpsrlw %xmm1, %xmm2, %xmm2
1161 ; AVX512VL-NEXT: vpbroadcastd {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
1162 ; AVX512VL-NEXT: vpand %xmm3, %xmm2, %xmm2
1163 ; AVX512VL-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1164 ; AVX512VL-NEXT: vpsrlw %xmm1, %xmm0, %xmm0
1165 ; AVX512VL-NEXT: vpand %xmm3, %xmm0, %xmm0
1166 ; AVX512VL-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1167 ; AVX512VL-NEXT: retq
1169 ; AVX512BW-LABEL: splatvar_funnnel_v16i8:
1170 ; AVX512BW: # %bb.0:
1171 ; AVX512BW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1172 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1173 ; AVX512BW-NEXT: vpsrlw %xmm1, %xmm2, %xmm2
1174 ; AVX512BW-NEXT: vpbroadcastw {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
1175 ; AVX512BW-NEXT: vpand %xmm3, %xmm2, %xmm2
1176 ; AVX512BW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1177 ; AVX512BW-NEXT: vpsrlw %xmm1, %xmm0, %xmm0
1178 ; AVX512BW-NEXT: vpand %xmm3, %xmm0, %xmm0
1179 ; AVX512BW-NEXT: vpackuswb %xmm2, %xmm0, %xmm0
1180 ; AVX512BW-NEXT: retq
1182 ; AVX512VLBW-LABEL: splatvar_funnnel_v16i8:
1183 ; AVX512VLBW: # %bb.0:
1184 ; AVX512VLBW-NEXT: vpunpcklbw {{.*#+}} xmm2 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1185 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm0 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1186 ; AVX512VLBW-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0
1187 ; AVX512VLBW-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1188 ; AVX512VLBW-NEXT: vpsrlw %xmm1, %ymm0, %ymm0
1189 ; AVX512VLBW-NEXT: vpmovwb %ymm0, %xmm0
1190 ; AVX512VLBW-NEXT: vzeroupper
1191 ; AVX512VLBW-NEXT: retq
1193 ; AVX512VBMI2-LABEL: splatvar_funnnel_v16i8:
1194 ; AVX512VBMI2: # %bb.0:
1195 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm2 = [0,2,4,6,8,10,12,14,64,66,68,70,72,74,76,78]
1196 ; AVX512VBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1197 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm3 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1198 ; AVX512VBMI2-NEXT: vpsrlw %xmm1, %xmm3, %xmm3
1199 ; AVX512VBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1200 ; AVX512VBMI2-NEXT: vpsrlw %xmm1, %xmm0, %xmm0
1201 ; AVX512VBMI2-NEXT: vpermt2b %zmm3, %zmm2, %zmm0
1202 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1203 ; AVX512VBMI2-NEXT: vzeroupper
1204 ; AVX512VBMI2-NEXT: retq
1206 ; AVX512VLVBMI2-LABEL: splatvar_funnnel_v16i8:
1207 ; AVX512VLVBMI2: # %bb.0:
1208 ; AVX512VLVBMI2-NEXT: vpunpcklbw {{.*#+}} xmm2 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1209 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm0 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1210 ; AVX512VLVBMI2-NEXT: vinserti128 $1, %xmm0, %ymm2, %ymm0
1211 ; AVX512VLVBMI2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1212 ; AVX512VLVBMI2-NEXT: vpsrlw %xmm1, %ymm0, %ymm0
1213 ; AVX512VLVBMI2-NEXT: vpmovwb %ymm0, %xmm0
1214 ; AVX512VLVBMI2-NEXT: vzeroupper
1215 ; AVX512VLVBMI2-NEXT: retq
1217 ; XOPAVX1-LABEL: splatvar_funnnel_v16i8:
1219 ; XOPAVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1220 ; XOPAVX1-NEXT: vpshufb %xmm2, %xmm1, %xmm1
1221 ; XOPAVX1-NEXT: vpsubb %xmm1, %xmm2, %xmm1
1222 ; XOPAVX1-NEXT: vprotb %xmm1, %xmm0, %xmm0
1223 ; XOPAVX1-NEXT: retq
1225 ; XOPAVX2-LABEL: splatvar_funnnel_v16i8:
1227 ; XOPAVX2-NEXT: vpbroadcastb %xmm1, %xmm1
1228 ; XOPAVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1229 ; XOPAVX2-NEXT: vpsubb %xmm1, %xmm2, %xmm1
1230 ; XOPAVX2-NEXT: vprotb %xmm1, %xmm0, %xmm0
1231 ; XOPAVX2-NEXT: retq
1233 ; X86-SSE2-LABEL: splatvar_funnnel_v16i8:
1234 ; X86-SSE2: # %bb.0:
1235 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1236 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1237 ; 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]
1238 ; X86-SSE2-NEXT: psrlw %xmm1, %xmm2
1239 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
1240 ; X86-SSE2-NEXT: pand %xmm3, %xmm2
1241 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1242 ; X86-SSE2-NEXT: psrlw %xmm1, %xmm0
1243 ; X86-SSE2-NEXT: pand %xmm3, %xmm0
1244 ; X86-SSE2-NEXT: packuswb %xmm2, %xmm0
1245 ; X86-SSE2-NEXT: retl
1246 %splat = shufflevector <16 x i8> %amt, <16 x i8> undef, <16 x i32> zeroinitializer
1247 %res = call <16 x i8> @llvm.fshr.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> %splat)
1255 define <2 x i64> @constant_funnnel_v2i64(<2 x i64> %x) nounwind {
1256 ; SSE2-LABEL: constant_funnnel_v2i64:
1258 ; SSE2-NEXT: movdqa %xmm0, %xmm1
1259 ; SSE2-NEXT: psllq $60, %xmm1
1260 ; SSE2-NEXT: movdqa %xmm0, %xmm2
1261 ; SSE2-NEXT: psllq $50, %xmm2
1262 ; SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm1[0],xmm2[1]
1263 ; SSE2-NEXT: movdqa %xmm0, %xmm1
1264 ; SSE2-NEXT: psrlq $4, %xmm1
1265 ; SSE2-NEXT: psrlq $14, %xmm0
1266 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
1267 ; SSE2-NEXT: orpd %xmm2, %xmm0
1270 ; SSE41-LABEL: constant_funnnel_v2i64:
1272 ; SSE41-NEXT: movdqa %xmm0, %xmm1
1273 ; SSE41-NEXT: psllq $50, %xmm1
1274 ; SSE41-NEXT: movdqa %xmm0, %xmm2
1275 ; SSE41-NEXT: psllq $60, %xmm2
1276 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1,2,3],xmm1[4,5,6,7]
1277 ; SSE41-NEXT: movdqa %xmm0, %xmm1
1278 ; SSE41-NEXT: psrlq $14, %xmm1
1279 ; SSE41-NEXT: psrlq $4, %xmm0
1280 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]
1281 ; SSE41-NEXT: por %xmm2, %xmm0
1284 ; AVX1-LABEL: constant_funnnel_v2i64:
1286 ; AVX1-NEXT: vpsllq $50, %xmm0, %xmm1
1287 ; AVX1-NEXT: vpsllq $60, %xmm0, %xmm2
1288 ; AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm2[0,1,2,3],xmm1[4,5,6,7]
1289 ; AVX1-NEXT: vpsrlq $14, %xmm0, %xmm2
1290 ; AVX1-NEXT: vpsrlq $4, %xmm0, %xmm0
1291 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm2[4,5,6,7]
1292 ; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
1295 ; AVX2-LABEL: constant_funnnel_v2i64:
1297 ; AVX2-NEXT: vpsllvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1
1298 ; AVX2-NEXT: vpsrlvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1299 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1302 ; AVX512F-LABEL: constant_funnnel_v2i64:
1304 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1305 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm1 = [4,14]
1306 ; AVX512F-NEXT: vprorvq %zmm1, %zmm0, %zmm0
1307 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1308 ; AVX512F-NEXT: vzeroupper
1309 ; AVX512F-NEXT: retq
1311 ; AVX512VL-LABEL: constant_funnnel_v2i64:
1312 ; AVX512VL: # %bb.0:
1313 ; AVX512VL-NEXT: vprorvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1314 ; AVX512VL-NEXT: retq
1316 ; AVX512BW-LABEL: constant_funnnel_v2i64:
1317 ; AVX512BW: # %bb.0:
1318 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1319 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [4,14]
1320 ; AVX512BW-NEXT: vprorvq %zmm1, %zmm0, %zmm0
1321 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1322 ; AVX512BW-NEXT: vzeroupper
1323 ; AVX512BW-NEXT: retq
1325 ; AVX512VLBW-LABEL: constant_funnnel_v2i64:
1326 ; AVX512VLBW: # %bb.0:
1327 ; AVX512VLBW-NEXT: vprorvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1328 ; AVX512VLBW-NEXT: retq
1330 ; AVX512VBMI2-LABEL: constant_funnnel_v2i64:
1331 ; AVX512VBMI2: # %bb.0:
1332 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1333 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [4,14]
1334 ; AVX512VBMI2-NEXT: vprorvq %zmm1, %zmm0, %zmm0
1335 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1336 ; AVX512VBMI2-NEXT: vzeroupper
1337 ; AVX512VBMI2-NEXT: retq
1339 ; AVX512VLVBMI2-LABEL: constant_funnnel_v2i64:
1340 ; AVX512VLVBMI2: # %bb.0:
1341 ; AVX512VLVBMI2-NEXT: vprorvq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1342 ; AVX512VLVBMI2-NEXT: retq
1344 ; XOP-LABEL: constant_funnnel_v2i64:
1346 ; XOP-NEXT: vprotq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1349 ; X86-SSE2-LABEL: constant_funnnel_v2i64:
1350 ; X86-SSE2: # %bb.0:
1351 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1352 ; X86-SSE2-NEXT: psllq $60, %xmm1
1353 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1354 ; X86-SSE2-NEXT: psllq $50, %xmm2
1355 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm1[0],xmm2[1]
1356 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1357 ; X86-SSE2-NEXT: psrlq $4, %xmm1
1358 ; X86-SSE2-NEXT: psrlq $14, %xmm0
1359 ; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
1360 ; X86-SSE2-NEXT: orpd %xmm2, %xmm0
1361 ; X86-SSE2-NEXT: retl
1362 %res = call <2 x i64> @llvm.fshr.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> <i64 4, i64 14>)
1366 define <4 x i32> @constant_funnnel_v4i32(<4 x i32> %x) nounwind {
1367 ; SSE2-LABEL: constant_funnnel_v4i32:
1369 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1370 ; SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1371 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,2,3]
1372 ; SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1373 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,3,2,3]
1374 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
1375 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
1376 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
1377 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1378 ; SSE2-NEXT: por %xmm2, %xmm0
1381 ; SSE41-LABEL: constant_funnnel_v4i32:
1383 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1384 ; SSE41-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1385 ; SSE41-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1386 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
1387 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7]
1388 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,0,2,2]
1389 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3],xmm0[4,5],xmm1[6,7]
1390 ; SSE41-NEXT: por %xmm2, %xmm0
1393 ; AVX1-LABEL: constant_funnnel_v4i32:
1395 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1396 ; AVX1-NEXT: vpmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1397 ; AVX1-NEXT: vpmuludq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1398 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[1,1,3,3]
1399 ; AVX1-NEXT: vpblendw {{.*#+}} xmm2 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7]
1400 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,2,2]
1401 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3],xmm0[4,5],xmm1[6,7]
1402 ; AVX1-NEXT: vpor %xmm2, %xmm0, %xmm0
1405 ; AVX2-LABEL: constant_funnnel_v4i32:
1407 ; AVX2-NEXT: vpsrlvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1
1408 ; AVX2-NEXT: vpsllvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1409 ; AVX2-NEXT: vpor %xmm1, %xmm0, %xmm0
1412 ; AVX512F-LABEL: constant_funnnel_v4i32:
1414 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1415 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm1 = [4,5,6,7]
1416 ; AVX512F-NEXT: vprorvd %zmm1, %zmm0, %zmm0
1417 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1418 ; AVX512F-NEXT: vzeroupper
1419 ; AVX512F-NEXT: retq
1421 ; AVX512VL-LABEL: constant_funnnel_v4i32:
1422 ; AVX512VL: # %bb.0:
1423 ; AVX512VL-NEXT: vprorvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1424 ; AVX512VL-NEXT: retq
1426 ; AVX512BW-LABEL: constant_funnnel_v4i32:
1427 ; AVX512BW: # %bb.0:
1428 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1429 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [4,5,6,7]
1430 ; AVX512BW-NEXT: vprorvd %zmm1, %zmm0, %zmm0
1431 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1432 ; AVX512BW-NEXT: vzeroupper
1433 ; AVX512BW-NEXT: retq
1435 ; AVX512VLBW-LABEL: constant_funnnel_v4i32:
1436 ; AVX512VLBW: # %bb.0:
1437 ; AVX512VLBW-NEXT: vprorvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1438 ; AVX512VLBW-NEXT: retq
1440 ; AVX512VBMI2-LABEL: constant_funnnel_v4i32:
1441 ; AVX512VBMI2: # %bb.0:
1442 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1443 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [4,5,6,7]
1444 ; AVX512VBMI2-NEXT: vprorvd %zmm1, %zmm0, %zmm0
1445 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1446 ; AVX512VBMI2-NEXT: vzeroupper
1447 ; AVX512VBMI2-NEXT: retq
1449 ; AVX512VLVBMI2-LABEL: constant_funnnel_v4i32:
1450 ; AVX512VLVBMI2: # %bb.0:
1451 ; AVX512VLVBMI2-NEXT: vprorvd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1452 ; AVX512VLVBMI2-NEXT: retq
1454 ; XOP-LABEL: constant_funnnel_v4i32:
1456 ; XOP-NEXT: vprotd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1459 ; X86-SSE2-LABEL: constant_funnnel_v4i32:
1460 ; X86-SSE2: # %bb.0:
1461 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
1462 ; X86-SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1463 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,2,3]
1464 ; X86-SSE2-NEXT: pmuludq {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1465 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,3,2,3]
1466 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
1467 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
1468 ; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
1469 ; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1470 ; X86-SSE2-NEXT: por %xmm2, %xmm0
1471 ; X86-SSE2-NEXT: retl
1472 %res = call <4 x i32> @llvm.fshr.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> <i32 4, i32 5, i32 6, i32 7>)
1476 define <8 x i16> @constant_funnnel_v8i16(<8 x i16> %x) nounwind {
1477 ; SSE-LABEL: constant_funnnel_v8i16:
1479 ; SSE-NEXT: movdqa {{.*#+}} xmm1 = [1,32768,16384,8192,4096,2048,1024,512]
1480 ; SSE-NEXT: movdqa %xmm0, %xmm2
1481 ; SSE-NEXT: pmulhuw %xmm1, %xmm2
1482 ; SSE-NEXT: pmullw %xmm1, %xmm0
1483 ; SSE-NEXT: por %xmm2, %xmm0
1486 ; AVX-LABEL: constant_funnnel_v8i16:
1488 ; AVX-NEXT: vmovdqa {{.*#+}} xmm1 = [1,32768,16384,8192,4096,2048,1024,512]
1489 ; AVX-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
1490 ; AVX-NEXT: vpmullw %xmm1, %xmm0, %xmm0
1491 ; AVX-NEXT: vpor %xmm2, %xmm0, %xmm0
1494 ; AVX512F-LABEL: constant_funnnel_v8i16:
1496 ; AVX512F-NEXT: vmovdqa {{.*#+}} xmm1 = [1,32768,16384,8192,4096,2048,1024,512]
1497 ; AVX512F-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
1498 ; AVX512F-NEXT: vpmullw %xmm1, %xmm0, %xmm0
1499 ; AVX512F-NEXT: vpor %xmm2, %xmm0, %xmm0
1500 ; AVX512F-NEXT: retq
1502 ; AVX512VL-LABEL: constant_funnnel_v8i16:
1503 ; AVX512VL: # %bb.0:
1504 ; AVX512VL-NEXT: vmovdqa {{.*#+}} xmm1 = [1,32768,16384,8192,4096,2048,1024,512]
1505 ; AVX512VL-NEXT: vpmulhuw %xmm1, %xmm0, %xmm2
1506 ; AVX512VL-NEXT: vpmullw %xmm1, %xmm0, %xmm0
1507 ; AVX512VL-NEXT: vpor %xmm2, %xmm0, %xmm0
1508 ; AVX512VL-NEXT: retq
1510 ; AVX512BW-LABEL: constant_funnnel_v8i16:
1511 ; AVX512BW: # %bb.0:
1512 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1513 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [16,1,2,3,4,5,6,7]
1514 ; AVX512BW-NEXT: vpsrlvw %zmm1, %zmm0, %zmm1
1515 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [0,15,14,13,12,11,10,9]
1516 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
1517 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1518 ; AVX512BW-NEXT: vzeroupper
1519 ; AVX512BW-NEXT: retq
1521 ; AVX512VLBW-LABEL: constant_funnnel_v8i16:
1522 ; AVX512VLBW: # %bb.0:
1523 ; AVX512VLBW-NEXT: vpsrlvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1
1524 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1525 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1526 ; AVX512VLBW-NEXT: retq
1528 ; AVX512VBMI2-LABEL: constant_funnnel_v8i16:
1529 ; AVX512VBMI2: # %bb.0:
1530 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1531 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [0,1,2,3,4,5,6,7]
1532 ; AVX512VBMI2-NEXT: vpshrdvw %zmm1, %zmm0, %zmm0
1533 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1534 ; AVX512VBMI2-NEXT: vzeroupper
1535 ; AVX512VBMI2-NEXT: retq
1537 ; AVX512VLVBMI2-LABEL: constant_funnnel_v8i16:
1538 ; AVX512VLVBMI2: # %bb.0:
1539 ; AVX512VLVBMI2-NEXT: vpshrdvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1540 ; AVX512VLVBMI2-NEXT: retq
1542 ; XOP-LABEL: constant_funnnel_v8i16:
1544 ; XOP-NEXT: vprotw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1547 ; X86-SSE2-LABEL: constant_funnnel_v8i16:
1548 ; X86-SSE2: # %bb.0:
1549 ; X86-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [1,32768,16384,8192,4096,2048,1024,512]
1550 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm2
1551 ; X86-SSE2-NEXT: pmulhuw %xmm1, %xmm2
1552 ; X86-SSE2-NEXT: pmullw %xmm1, %xmm0
1553 ; X86-SSE2-NEXT: por %xmm2, %xmm0
1554 ; X86-SSE2-NEXT: retl
1555 %res = call <8 x i16> @llvm.fshr.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>)
1559 define <16 x i8> @constant_funnnel_v16i8(<16 x i8> %x) nounwind {
1560 ; SSE-LABEL: constant_funnnel_v16i8:
1562 ; SSE-NEXT: movdqa %xmm0, %xmm1
1563 ; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
1564 ; SSE-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1565 ; SSE-NEXT: psrlw $8, %xmm1
1566 ; SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1567 ; SSE-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1568 ; SSE-NEXT: psrlw $8, %xmm0
1569 ; SSE-NEXT: packuswb %xmm1, %xmm0
1572 ; AVX-LABEL: constant_funnnel_v16i8:
1574 ; AVX-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1575 ; AVX-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1576 ; AVX-NEXT: vpsrlw $8, %xmm1, %xmm1
1577 ; AVX-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1578 ; AVX-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1579 ; AVX-NEXT: vpsrlw $8, %xmm0, %xmm0
1580 ; AVX-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1583 ; AVX512F-LABEL: constant_funnnel_v16i8:
1585 ; AVX512F-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1586 ; AVX512F-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1587 ; AVX512F-NEXT: vpsrlw $8, %xmm1, %xmm1
1588 ; AVX512F-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1589 ; AVX512F-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1590 ; AVX512F-NEXT: vpsrlw $8, %xmm0, %xmm0
1591 ; AVX512F-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1592 ; AVX512F-NEXT: retq
1594 ; AVX512VL-LABEL: constant_funnnel_v16i8:
1595 ; AVX512VL: # %bb.0:
1596 ; AVX512VL-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1597 ; AVX512VL-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1598 ; AVX512VL-NEXT: vpsrlw $8, %xmm1, %xmm1
1599 ; AVX512VL-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1600 ; AVX512VL-NEXT: vpmullw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1601 ; AVX512VL-NEXT: vpsrlw $8, %xmm0, %xmm0
1602 ; AVX512VL-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1603 ; AVX512VL-NEXT: retq
1605 ; AVX512BW-LABEL: constant_funnnel_v16i8:
1606 ; AVX512BW: # %bb.0:
1607 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm1 = [0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0]
1608 ; AVX512BW-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1609 ; AVX512BW-NEXT: vpsllvw %zmm1, %zmm2, %zmm1
1610 ; AVX512BW-NEXT: vpsrlw $8, %xmm1, %xmm1
1611 ; AVX512BW-NEXT: vmovdqa {{.*#+}} xmm2 = [0,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0]
1612 ; AVX512BW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1613 ; AVX512BW-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
1614 ; AVX512BW-NEXT: vpsrlw $8, %xmm0, %xmm0
1615 ; AVX512BW-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1616 ; AVX512BW-NEXT: vzeroupper
1617 ; AVX512BW-NEXT: retq
1619 ; AVX512VLBW-LABEL: constant_funnnel_v16i8:
1620 ; AVX512VLBW: # %bb.0:
1621 ; AVX512VLBW-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1622 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1623 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm1, %xmm1
1624 ; AVX512VLBW-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1625 ; AVX512VLBW-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1626 ; AVX512VLBW-NEXT: vpsrlw $8, %xmm0, %xmm0
1627 ; AVX512VLBW-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1628 ; AVX512VLBW-NEXT: retq
1630 ; AVX512VBMI2-LABEL: constant_funnnel_v16i8:
1631 ; AVX512VBMI2: # %bb.0:
1632 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm1 = [0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0]
1633 ; AVX512VBMI2-NEXT: vpunpckhbw {{.*#+}} xmm2 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1634 ; AVX512VBMI2-NEXT: vpsllvw %zmm1, %zmm2, %zmm1
1635 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm1, %xmm1
1636 ; AVX512VBMI2-NEXT: vmovdqa {{.*#+}} xmm2 = [0,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0]
1637 ; AVX512VBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1638 ; AVX512VBMI2-NEXT: vpsllvw %zmm2, %zmm0, %zmm0
1639 ; AVX512VBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1640 ; AVX512VBMI2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1641 ; AVX512VBMI2-NEXT: vzeroupper
1642 ; AVX512VBMI2-NEXT: retq
1644 ; AVX512VLVBMI2-LABEL: constant_funnnel_v16i8:
1645 ; AVX512VLVBMI2: # %bb.0:
1646 ; AVX512VLVBMI2-NEXT: vpunpckhbw {{.*#+}} xmm1 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
1647 ; AVX512VLVBMI2-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1648 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm1, %xmm1
1649 ; AVX512VLVBMI2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1650 ; AVX512VLVBMI2-NEXT: vpsllvw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1651 ; AVX512VLVBMI2-NEXT: vpsrlw $8, %xmm0, %xmm0
1652 ; AVX512VLVBMI2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
1653 ; AVX512VLVBMI2-NEXT: retq
1655 ; XOP-LABEL: constant_funnnel_v16i8:
1657 ; XOP-NEXT: vprotb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1660 ; X86-SSE2-LABEL: constant_funnnel_v16i8:
1661 ; X86-SSE2: # %bb.0:
1662 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1663 ; X86-SSE2-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
1664 ; X86-SSE2-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1665 ; X86-SSE2-NEXT: psrlw $8, %xmm1
1666 ; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1667 ; X86-SSE2-NEXT: pmullw {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1668 ; X86-SSE2-NEXT: psrlw $8, %xmm0
1669 ; X86-SSE2-NEXT: packuswb %xmm1, %xmm0
1670 ; X86-SSE2-NEXT: retl
1671 %res = call <16 x i8> @llvm.fshr.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1>)
1676 ; Uniform Constant Shifts
1679 define <2 x i64> @splatconstant_funnnel_v2i64(<2 x i64> %x) nounwind {
1680 ; SSE-LABEL: splatconstant_funnnel_v2i64:
1682 ; SSE-NEXT: movdqa %xmm0, %xmm1
1683 ; SSE-NEXT: psllq $50, %xmm1
1684 ; SSE-NEXT: psrlq $14, %xmm0
1685 ; SSE-NEXT: por %xmm1, %xmm0
1688 ; AVX-LABEL: splatconstant_funnnel_v2i64:
1690 ; AVX-NEXT: vpsllq $50, %xmm0, %xmm1
1691 ; AVX-NEXT: vpsrlq $14, %xmm0, %xmm0
1692 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1695 ; AVX512F-LABEL: splatconstant_funnnel_v2i64:
1697 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1698 ; AVX512F-NEXT: vprorq $14, %zmm0, %zmm0
1699 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1700 ; AVX512F-NEXT: vzeroupper
1701 ; AVX512F-NEXT: retq
1703 ; AVX512VL-LABEL: splatconstant_funnnel_v2i64:
1704 ; AVX512VL: # %bb.0:
1705 ; AVX512VL-NEXT: vprorq $14, %xmm0, %xmm0
1706 ; AVX512VL-NEXT: retq
1708 ; AVX512BW-LABEL: splatconstant_funnnel_v2i64:
1709 ; AVX512BW: # %bb.0:
1710 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1711 ; AVX512BW-NEXT: vprorq $14, %zmm0, %zmm0
1712 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1713 ; AVX512BW-NEXT: vzeroupper
1714 ; AVX512BW-NEXT: retq
1716 ; AVX512VLBW-LABEL: splatconstant_funnnel_v2i64:
1717 ; AVX512VLBW: # %bb.0:
1718 ; AVX512VLBW-NEXT: vprorq $14, %xmm0, %xmm0
1719 ; AVX512VLBW-NEXT: retq
1721 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v2i64:
1722 ; AVX512VBMI2: # %bb.0:
1723 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1724 ; AVX512VBMI2-NEXT: vprorq $14, %zmm0, %zmm0
1725 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1726 ; AVX512VBMI2-NEXT: vzeroupper
1727 ; AVX512VBMI2-NEXT: retq
1729 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v2i64:
1730 ; AVX512VLVBMI2: # %bb.0:
1731 ; AVX512VLVBMI2-NEXT: vprorq $14, %xmm0, %xmm0
1732 ; AVX512VLVBMI2-NEXT: retq
1734 ; XOP-LABEL: splatconstant_funnnel_v2i64:
1736 ; XOP-NEXT: vprotq $50, %xmm0, %xmm0
1739 ; X86-SSE2-LABEL: splatconstant_funnnel_v2i64:
1740 ; X86-SSE2: # %bb.0:
1741 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1742 ; X86-SSE2-NEXT: psllq $50, %xmm1
1743 ; X86-SSE2-NEXT: psrlq $14, %xmm0
1744 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1745 ; X86-SSE2-NEXT: retl
1746 %res = call <2 x i64> @llvm.fshr.v2i64(<2 x i64> %x, <2 x i64> %x, <2 x i64> <i64 14, i64 14>)
1750 define <4 x i32> @splatconstant_funnnel_v4i32(<4 x i32> %x) nounwind {
1751 ; SSE-LABEL: splatconstant_funnnel_v4i32:
1753 ; SSE-NEXT: movdqa %xmm0, %xmm1
1754 ; SSE-NEXT: psrld $4, %xmm1
1755 ; SSE-NEXT: pslld $28, %xmm0
1756 ; SSE-NEXT: por %xmm1, %xmm0
1759 ; AVX-LABEL: splatconstant_funnnel_v4i32:
1761 ; AVX-NEXT: vpsrld $4, %xmm0, %xmm1
1762 ; AVX-NEXT: vpslld $28, %xmm0, %xmm0
1763 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1766 ; AVX512F-LABEL: splatconstant_funnnel_v4i32:
1768 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1769 ; AVX512F-NEXT: vprord $4, %zmm0, %zmm0
1770 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1771 ; AVX512F-NEXT: vzeroupper
1772 ; AVX512F-NEXT: retq
1774 ; AVX512VL-LABEL: splatconstant_funnnel_v4i32:
1775 ; AVX512VL: # %bb.0:
1776 ; AVX512VL-NEXT: vprord $4, %xmm0, %xmm0
1777 ; AVX512VL-NEXT: retq
1779 ; AVX512BW-LABEL: splatconstant_funnnel_v4i32:
1780 ; AVX512BW: # %bb.0:
1781 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1782 ; AVX512BW-NEXT: vprord $4, %zmm0, %zmm0
1783 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1784 ; AVX512BW-NEXT: vzeroupper
1785 ; AVX512BW-NEXT: retq
1787 ; AVX512VLBW-LABEL: splatconstant_funnnel_v4i32:
1788 ; AVX512VLBW: # %bb.0:
1789 ; AVX512VLBW-NEXT: vprord $4, %xmm0, %xmm0
1790 ; AVX512VLBW-NEXT: retq
1792 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v4i32:
1793 ; AVX512VBMI2: # %bb.0:
1794 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1795 ; AVX512VBMI2-NEXT: vprord $4, %zmm0, %zmm0
1796 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1797 ; AVX512VBMI2-NEXT: vzeroupper
1798 ; AVX512VBMI2-NEXT: retq
1800 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v4i32:
1801 ; AVX512VLVBMI2: # %bb.0:
1802 ; AVX512VLVBMI2-NEXT: vprord $4, %xmm0, %xmm0
1803 ; AVX512VLVBMI2-NEXT: retq
1805 ; XOP-LABEL: splatconstant_funnnel_v4i32:
1807 ; XOP-NEXT: vprotd $28, %xmm0, %xmm0
1810 ; X86-SSE2-LABEL: splatconstant_funnnel_v4i32:
1811 ; X86-SSE2: # %bb.0:
1812 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1813 ; X86-SSE2-NEXT: psrld $4, %xmm1
1814 ; X86-SSE2-NEXT: pslld $28, %xmm0
1815 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1816 ; X86-SSE2-NEXT: retl
1817 %res = call <4 x i32> @llvm.fshr.v4i32(<4 x i32> %x, <4 x i32> %x, <4 x i32> <i32 4, i32 4, i32 4, i32 4>)
1821 define <8 x i16> @splatconstant_funnnel_v8i16(<8 x i16> %x) nounwind {
1822 ; SSE-LABEL: splatconstant_funnnel_v8i16:
1824 ; SSE-NEXT: movdqa %xmm0, %xmm1
1825 ; SSE-NEXT: psrlw $7, %xmm1
1826 ; SSE-NEXT: psllw $9, %xmm0
1827 ; SSE-NEXT: por %xmm1, %xmm0
1830 ; AVX-LABEL: splatconstant_funnnel_v8i16:
1832 ; AVX-NEXT: vpsrlw $7, %xmm0, %xmm1
1833 ; AVX-NEXT: vpsllw $9, %xmm0, %xmm0
1834 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1837 ; AVX512F-LABEL: splatconstant_funnnel_v8i16:
1839 ; AVX512F-NEXT: vpsrlw $7, %xmm0, %xmm1
1840 ; AVX512F-NEXT: vpsllw $9, %xmm0, %xmm0
1841 ; AVX512F-NEXT: vpor %xmm1, %xmm0, %xmm0
1842 ; AVX512F-NEXT: retq
1844 ; AVX512VL-LABEL: splatconstant_funnnel_v8i16:
1845 ; AVX512VL: # %bb.0:
1846 ; AVX512VL-NEXT: vpsrlw $7, %xmm0, %xmm1
1847 ; AVX512VL-NEXT: vpsllw $9, %xmm0, %xmm0
1848 ; AVX512VL-NEXT: vpor %xmm1, %xmm0, %xmm0
1849 ; AVX512VL-NEXT: retq
1851 ; AVX512BW-LABEL: splatconstant_funnnel_v8i16:
1852 ; AVX512BW: # %bb.0:
1853 ; AVX512BW-NEXT: vpsrlw $7, %xmm0, %xmm1
1854 ; AVX512BW-NEXT: vpsllw $9, %xmm0, %xmm0
1855 ; AVX512BW-NEXT: vpor %xmm1, %xmm0, %xmm0
1856 ; AVX512BW-NEXT: retq
1858 ; AVX512VLBW-LABEL: splatconstant_funnnel_v8i16:
1859 ; AVX512VLBW: # %bb.0:
1860 ; AVX512VLBW-NEXT: vpsrlw $7, %xmm0, %xmm1
1861 ; AVX512VLBW-NEXT: vpsllw $9, %xmm0, %xmm0
1862 ; AVX512VLBW-NEXT: vpor %xmm1, %xmm0, %xmm0
1863 ; AVX512VLBW-NEXT: retq
1865 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v8i16:
1866 ; AVX512VBMI2: # %bb.0:
1867 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1868 ; AVX512VBMI2-NEXT: vpshrdw $7, %zmm0, %zmm0, %zmm0
1869 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1870 ; AVX512VBMI2-NEXT: vzeroupper
1871 ; AVX512VBMI2-NEXT: retq
1873 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v8i16:
1874 ; AVX512VLVBMI2: # %bb.0:
1875 ; AVX512VLVBMI2-NEXT: vpshrdw $7, %xmm0, %xmm0, %xmm0
1876 ; AVX512VLVBMI2-NEXT: retq
1878 ; XOP-LABEL: splatconstant_funnnel_v8i16:
1880 ; XOP-NEXT: vprotw $9, %xmm0, %xmm0
1883 ; X86-SSE2-LABEL: splatconstant_funnnel_v8i16:
1884 ; X86-SSE2: # %bb.0:
1885 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1886 ; X86-SSE2-NEXT: psrlw $7, %xmm1
1887 ; X86-SSE2-NEXT: psllw $9, %xmm0
1888 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1889 ; X86-SSE2-NEXT: retl
1890 %res = call <8 x i16> @llvm.fshr.v8i16(<8 x i16> %x, <8 x i16> %x, <8 x i16> <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>)
1894 define <16 x i8> @splatconstant_funnnel_v16i8(<16 x i8> %x) nounwind {
1895 ; SSE-LABEL: splatconstant_funnnel_v16i8:
1897 ; SSE-NEXT: movdqa %xmm0, %xmm1
1898 ; SSE-NEXT: psrlw $4, %xmm1
1899 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
1900 ; SSE-NEXT: psllw $4, %xmm0
1901 ; SSE-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1902 ; SSE-NEXT: por %xmm1, %xmm0
1905 ; AVX-LABEL: splatconstant_funnnel_v16i8:
1907 ; AVX-NEXT: vpsrlw $4, %xmm0, %xmm1
1908 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
1909 ; AVX-NEXT: vpsllw $4, %xmm0, %xmm0
1910 ; AVX-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
1911 ; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
1914 ; AVX512F-LABEL: splatconstant_funnnel_v16i8:
1916 ; AVX512F-NEXT: vpsllw $4, %xmm0, %xmm1
1917 ; AVX512F-NEXT: vpsrlw $4, %xmm0, %xmm0
1918 ; AVX512F-NEXT: vpternlogd $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm1, %zmm0
1919 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1920 ; AVX512F-NEXT: vzeroupper
1921 ; AVX512F-NEXT: retq
1923 ; AVX512VL-LABEL: splatconstant_funnnel_v16i8:
1924 ; AVX512VL: # %bb.0:
1925 ; AVX512VL-NEXT: vpsllw $4, %xmm0, %xmm1
1926 ; AVX512VL-NEXT: vpsrlw $4, %xmm0, %xmm0
1927 ; AVX512VL-NEXT: vpternlogd $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm0
1928 ; AVX512VL-NEXT: retq
1930 ; AVX512BW-LABEL: splatconstant_funnnel_v16i8:
1931 ; AVX512BW: # %bb.0:
1932 ; AVX512BW-NEXT: vpsllw $4, %xmm0, %xmm1
1933 ; AVX512BW-NEXT: vpsrlw $4, %xmm0, %xmm0
1934 ; AVX512BW-NEXT: vpternlogd $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm1, %zmm0
1935 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1936 ; AVX512BW-NEXT: vzeroupper
1937 ; AVX512BW-NEXT: retq
1939 ; AVX512VLBW-LABEL: splatconstant_funnnel_v16i8:
1940 ; AVX512VLBW: # %bb.0:
1941 ; AVX512VLBW-NEXT: vpsllw $4, %xmm0, %xmm1
1942 ; AVX512VLBW-NEXT: vpsrlw $4, %xmm0, %xmm0
1943 ; AVX512VLBW-NEXT: vpternlogd $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm0
1944 ; AVX512VLBW-NEXT: retq
1946 ; AVX512VBMI2-LABEL: splatconstant_funnnel_v16i8:
1947 ; AVX512VBMI2: # %bb.0:
1948 ; AVX512VBMI2-NEXT: vpsllw $4, %xmm0, %xmm1
1949 ; AVX512VBMI2-NEXT: vpsrlw $4, %xmm0, %xmm0
1950 ; AVX512VBMI2-NEXT: vpternlogd $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm1, %zmm0
1951 ; AVX512VBMI2-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1952 ; AVX512VBMI2-NEXT: vzeroupper
1953 ; AVX512VBMI2-NEXT: retq
1955 ; AVX512VLVBMI2-LABEL: splatconstant_funnnel_v16i8:
1956 ; AVX512VLVBMI2: # %bb.0:
1957 ; AVX512VLVBMI2-NEXT: vpsllw $4, %xmm0, %xmm1
1958 ; AVX512VLVBMI2-NEXT: vpsrlw $4, %xmm0, %xmm0
1959 ; AVX512VLVBMI2-NEXT: vpternlogd $216, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm0
1960 ; AVX512VLVBMI2-NEXT: retq
1962 ; XOP-LABEL: splatconstant_funnnel_v16i8:
1964 ; XOP-NEXT: vprotb $4, %xmm0, %xmm0
1967 ; X86-SSE2-LABEL: splatconstant_funnnel_v16i8:
1968 ; X86-SSE2: # %bb.0:
1969 ; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
1970 ; X86-SSE2-NEXT: psrlw $4, %xmm1
1971 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
1972 ; X86-SSE2-NEXT: psllw $4, %xmm0
1973 ; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
1974 ; X86-SSE2-NEXT: por %xmm1, %xmm0
1975 ; X86-SSE2-NEXT: retl
1976 %res = call <16 x i8> @llvm.fshr.v16i8(<16 x i8> %x, <16 x i8> %x, <16 x i8> <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>)