1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=ALL --check-prefix=AVX1OR2 --check-prefix=AVX1
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=ALL --check-prefix=AVX1OR2 --check-prefix=AVX2OR512VL --check-prefix=AVX2 --check-prefix=AVX2-SLOW
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2,+fast-variable-shuffle | FileCheck %s --check-prefix=ALL --check-prefix=AVX1OR2 --check-prefix=AVX2OR512VL --check-prefix=AVX2 --check-prefix=AVX2-FAST
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl,+avx512dq | FileCheck %s --check-prefix=ALL --check-prefix=AVX2OR512VL --check-prefix=AVX512VL --check-prefix=AVX512VL-SLOW
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl,+avx512dq,+fast-variable-shuffle | FileCheck %s --check-prefix=ALL --check-prefix=AVX2OR512VL --check-prefix=AVX512VL --check-prefix=AVX512VL-FAST
8 define <8 x float> @shuffle_v8f32_00000000(<8 x float> %a, <8 x float> %b) {
9 ; AVX1-LABEL: shuffle_v8f32_00000000:
11 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
12 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
15 ; AVX2OR512VL-LABEL: shuffle_v8f32_00000000:
16 ; AVX2OR512VL: # %bb.0:
17 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
18 ; AVX2OR512VL-NEXT: retq
19 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
20 ret <8 x float> %shuffle
23 define <8 x float> @shuffle_v8f32_00000010(<8 x float> %a, <8 x float> %b) {
24 ; AVX1-LABEL: shuffle_v8f32_00000010:
26 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
27 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
28 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
31 ; AVX2-SLOW-LABEL: shuffle_v8f32_00000010:
33 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
34 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
35 ; AVX2-SLOW-NEXT: retq
37 ; AVX2-FAST-LABEL: shuffle_v8f32_00000010:
39 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,0,1,0]
40 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
41 ; AVX2-FAST-NEXT: retq
43 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_00000010:
44 ; AVX512VL-SLOW: # %bb.0:
45 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
46 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
47 ; AVX512VL-SLOW-NEXT: retq
49 ; AVX512VL-FAST-LABEL: shuffle_v8f32_00000010:
50 ; AVX512VL-FAST: # %bb.0:
51 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,0,1,0]
52 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
53 ; AVX512VL-FAST-NEXT: retq
54 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0>
55 ret <8 x float> %shuffle
58 define <8 x float> @shuffle_v8f32_00000200(<8 x float> %a, <8 x float> %b) {
59 ; AVX1-LABEL: shuffle_v8f32_00000200:
61 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
62 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,0,0]
63 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
66 ; AVX2-SLOW-LABEL: shuffle_v8f32_00000200:
68 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,2]
69 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
70 ; AVX2-SLOW-NEXT: retq
72 ; AVX2-FAST-LABEL: shuffle_v8f32_00000200:
74 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,2,0,0]
75 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
76 ; AVX2-FAST-NEXT: retq
78 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_00000200:
79 ; AVX512VL-SLOW: # %bb.0:
80 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,2]
81 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
82 ; AVX512VL-SLOW-NEXT: retq
84 ; AVX512VL-FAST-LABEL: shuffle_v8f32_00000200:
85 ; AVX512VL-FAST: # %bb.0:
86 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,2,0,0]
87 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
88 ; AVX512VL-FAST-NEXT: retq
89 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0>
90 ret <8 x float> %shuffle
93 define <8 x float> @shuffle_v8f32_00003000(<8 x float> %a, <8 x float> %b) {
94 ; AVX1-LABEL: shuffle_v8f32_00003000:
96 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
97 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,0,0,0]
98 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
101 ; AVX2-SLOW-LABEL: shuffle_v8f32_00003000:
102 ; AVX2-SLOW: # %bb.0:
103 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,3,0]
104 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
105 ; AVX2-SLOW-NEXT: retq
107 ; AVX2-FAST-LABEL: shuffle_v8f32_00003000:
108 ; AVX2-FAST: # %bb.0:
109 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,3,0,0,0]
110 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
111 ; AVX2-FAST-NEXT: retq
113 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_00003000:
114 ; AVX512VL-SLOW: # %bb.0:
115 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,3,0]
116 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
117 ; AVX512VL-SLOW-NEXT: retq
119 ; AVX512VL-FAST-LABEL: shuffle_v8f32_00003000:
120 ; AVX512VL-FAST: # %bb.0:
121 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,3,0,0,0]
122 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
123 ; AVX512VL-FAST-NEXT: retq
124 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 0, i32 0>
125 ret <8 x float> %shuffle
128 define <8 x float> @shuffle_v8f32_00040000(<8 x float> %a, <8 x float> %b) {
129 ; AVX1-LABEL: shuffle_v8f32_00040000:
131 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[0,1,0,1]
132 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
133 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
134 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,0],ymm0[2,0],ymm1[4,4],ymm0[6,4]
137 ; AVX2OR512VL-LABEL: shuffle_v8f32_00040000:
138 ; AVX2OR512VL: # %bb.0:
139 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,4,0,0,0,0]
140 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
141 ; AVX2OR512VL-NEXT: retq
142 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0>
143 ret <8 x float> %shuffle
146 define <8 x float> @shuffle_v8f32_00500000(<8 x float> %a, <8 x float> %b) {
147 ; AVX1-LABEL: shuffle_v8f32_00500000:
149 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
150 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4,5,6,7]
151 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,1,0,4,4,4,4]
154 ; AVX2OR512VL-LABEL: shuffle_v8f32_00500000:
155 ; AVX2OR512VL: # %bb.0:
156 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,5,0,0,0,0,0]
157 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
158 ; AVX2OR512VL-NEXT: retq
159 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0>
160 ret <8 x float> %shuffle
163 define <8 x float> @shuffle_v8f32_06000000(<8 x float> %a, <8 x float> %b) {
164 ; AVX1-LABEL: shuffle_v8f32_06000000:
166 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
167 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
168 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,0,0,4,4,4,4]
171 ; AVX2OR512VL-LABEL: shuffle_v8f32_06000000:
172 ; AVX2OR512VL: # %bb.0:
173 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,6,0,0,0,0,0,0]
174 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
175 ; AVX2OR512VL-NEXT: retq
176 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
177 ret <8 x float> %shuffle
180 define <8 x float> @shuffle_v8f32_70000000(<8 x float> %a, <8 x float> %b) {
181 ; AVX1-LABEL: shuffle_v8f32_70000000:
183 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
184 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
185 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,0,0,0,4,4,4,4]
188 ; AVX2OR512VL-LABEL: shuffle_v8f32_70000000:
189 ; AVX2OR512VL: # %bb.0:
190 ; AVX2OR512VL-NEXT: movl $7, %eax
191 ; AVX2OR512VL-NEXT: vmovd %eax, %xmm1
192 ; AVX2OR512VL-NEXT: vpermd %ymm0, %ymm1, %ymm0
193 ; AVX2OR512VL-NEXT: retq
194 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
195 ret <8 x float> %shuffle
198 define <8 x float> @shuffle_v8f32_01014545(<8 x float> %a, <8 x float> %b) {
199 ; ALL-LABEL: shuffle_v8f32_01014545:
201 ; ALL-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
203 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 4, i32 5, i32 4, i32 5>
204 ret <8 x float> %shuffle
207 define <8 x float> @shuffle_v8f32_00112233(<8 x float> %a, <8 x float> %b) {
208 ; AVX1-LABEL: shuffle_v8f32_00112233:
210 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,1,1]
211 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,3,3]
212 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
215 ; AVX2OR512VL-LABEL: shuffle_v8f32_00112233:
216 ; AVX2OR512VL: # %bb.0:
217 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,1,1,2,2,3,3]
218 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
219 ; AVX2OR512VL-NEXT: retq
220 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
221 ret <8 x float> %shuffle
224 define <8 x float> @shuffle_v8f32_00001111(<8 x float> %a, <8 x float> %b) {
225 ; AVX1-LABEL: shuffle_v8f32_00001111:
227 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
228 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
229 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
232 ; AVX2-SLOW-LABEL: shuffle_v8f32_00001111:
233 ; AVX2-SLOW: # %bb.0:
234 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,1]
235 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
236 ; AVX2-SLOW-NEXT: retq
238 ; AVX2-FAST-LABEL: shuffle_v8f32_00001111:
239 ; AVX2-FAST: # %bb.0:
240 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,1,1,1,1]
241 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
242 ; AVX2-FAST-NEXT: retq
244 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_00001111:
245 ; AVX512VL-SLOW: # %bb.0:
246 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,1]
247 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
248 ; AVX512VL-SLOW-NEXT: retq
250 ; AVX512VL-FAST-LABEL: shuffle_v8f32_00001111:
251 ; AVX512VL-FAST: # %bb.0:
252 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,1,1,1,1]
253 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
254 ; AVX512VL-FAST-NEXT: retq
255 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1>
256 ret <8 x float> %shuffle
259 define <8 x float> @shuffle_v8f32_81a3c5e7(<8 x float> %a, <8 x float> %b) {
260 ; ALL-LABEL: shuffle_v8f32_81a3c5e7:
262 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7]
264 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 5, i32 14, i32 7>
265 ret <8 x float> %shuffle
268 define <8 x float> @shuffle_v8f32_08080808(<8 x float> %a, <8 x float> %b) {
269 ; AVX1-LABEL: shuffle_v8f32_08080808:
271 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,0],xmm1[0,0]
272 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,1,3]
273 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
276 ; AVX2OR512VL-LABEL: shuffle_v8f32_08080808:
277 ; AVX2OR512VL: # %bb.0:
278 ; AVX2OR512VL-NEXT: vunpcklps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
279 ; AVX2OR512VL-NEXT: vbroadcastsd %xmm0, %ymm0
280 ; AVX2OR512VL-NEXT: retq
281 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8>
282 ret <8 x float> %shuffle
285 define <8 x float> @shuffle_v8f32_08084c4c(<8 x float> %a, <8 x float> %b) {
286 ; ALL-LABEL: shuffle_v8f32_08084c4c:
288 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
289 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
291 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 4, i32 12, i32 4, i32 12>
292 ret <8 x float> %shuffle
295 define <8 x float> @shuffle_v8f32_8823cc67(<8 x float> %a, <8 x float> %b) {
296 ; ALL-LABEL: shuffle_v8f32_8823cc67:
298 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,0],ymm0[2,3],ymm1[4,4],ymm0[6,7]
300 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 8, i32 8, i32 2, i32 3, i32 12, i32 12, i32 6, i32 7>
301 ret <8 x float> %shuffle
304 define <8 x float> @shuffle_v8f32_9832dc76(<8 x float> %a, <8 x float> %b) {
305 ; ALL-LABEL: shuffle_v8f32_9832dc76:
307 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[3,2],ymm1[5,4],ymm0[7,6]
309 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 9, i32 8, i32 3, i32 2, i32 13, i32 12, i32 7, i32 6>
310 ret <8 x float> %shuffle
313 define <8 x float> @shuffle_v8f32_9810dc54(<8 x float> %a, <8 x float> %b) {
314 ; ALL-LABEL: shuffle_v8f32_9810dc54:
316 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[1,0],ymm1[5,4],ymm0[5,4]
318 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 9, i32 8, i32 1, i32 0, i32 13, i32 12, i32 5, i32 4>
319 ret <8 x float> %shuffle
322 define <8 x float> @shuffle_v8f32_08194c5d(<8 x float> %a, <8 x float> %b) {
323 ; ALL-LABEL: shuffle_v8f32_08194c5d:
325 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
327 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
328 ret <8 x float> %shuffle
331 define <8 x float> @shuffle_v8f32_2a3b6e7f(<8 x float> %a, <8 x float> %b) {
332 ; ALL-LABEL: shuffle_v8f32_2a3b6e7f:
334 ; ALL-NEXT: vunpckhps {{.*#+}} ymm0 = ymm0[2],ymm1[2],ymm0[3],ymm1[3],ymm0[6],ymm1[6],ymm0[7],ymm1[7]
336 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
337 ret <8 x float> %shuffle
340 define <8 x float> @shuffle_v8f32_08192a3b(<8 x float> %a, <8 x float> %b) {
341 ; AVX1OR2-LABEL: shuffle_v8f32_08192a3b:
343 ; AVX1OR2-NEXT: vunpckhps {{.*#+}} xmm2 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
344 ; AVX1OR2-NEXT: vunpcklps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
345 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
348 ; AVX512VL-LABEL: shuffle_v8f32_08192a3b:
350 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [0,8,1,9,2,10,3,11]
351 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
352 ; AVX512VL-NEXT: retq
353 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
354 ret <8 x float> %shuffle
357 define <8 x float> @shuffle_v8f32_08991abb(<8 x float> %a, <8 x float> %b) {
358 ; AVX1-LABEL: shuffle_v8f32_08991abb:
360 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm0[0,0],xmm1[0,0]
361 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm2[0,2],xmm1[1,1]
362 ; AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3]
363 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,2,3,3]
364 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
367 ; AVX2-SLOW-LABEL: shuffle_v8f32_08991abb:
368 ; AVX2-SLOW: # %bb.0:
369 ; AVX2-SLOW-NEXT: vmovaps {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
370 ; AVX2-SLOW-NEXT: vpermps %ymm1, %ymm2, %ymm1
371 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,1,3]
372 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
373 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
374 ; AVX2-SLOW-NEXT: retq
376 ; AVX2-FAST-LABEL: shuffle_v8f32_08991abb:
377 ; AVX2-FAST: # %bb.0:
378 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <0,1,1,3,1,3,u,u>
379 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
380 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
381 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
382 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
383 ; AVX2-FAST-NEXT: retq
385 ; AVX512VL-LABEL: shuffle_v8f32_08991abb:
387 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [8,0,1,1,9,2,3,3]
388 ; AVX512VL-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
389 ; AVX512VL-NEXT: vmovaps %ymm2, %ymm0
390 ; AVX512VL-NEXT: retq
391 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 8, i32 9, i32 9, i32 1, i32 10, i32 11, i32 11>
392 ret <8 x float> %shuffle
395 define <8 x float> @shuffle_v8f32_091b2d3f(<8 x float> %a, <8 x float> %b) {
396 ; AVX1-LABEL: shuffle_v8f32_091b2d3f:
398 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[0,1,1,3]
399 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,1,3,3]
400 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
401 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
404 ; AVX2-LABEL: shuffle_v8f32_091b2d3f:
406 ; AVX2-NEXT: vmovaps {{.*#+}} ymm2 = <0,u,1,u,2,u,3,u>
407 ; AVX2-NEXT: vpermps %ymm0, %ymm2, %ymm0
408 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
411 ; AVX512VL-LABEL: shuffle_v8f32_091b2d3f:
413 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [0,9,1,11,2,13,3,15]
414 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
415 ; AVX512VL-NEXT: retq
416 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 9, i32 1, i32 11, i32 2, i32 13, i32 3, i32 15>
417 ret <8 x float> %shuffle
420 define <8 x float> @shuffle_v8f32_09ab1def(<8 x float> %a, <8 x float> %b) {
421 ; AVX1-LABEL: shuffle_v8f32_09ab1def:
423 ; AVX1-NEXT: vmovshdup {{.*#+}} xmm2 = xmm0[1,1,3,3]
424 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
425 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
428 ; AVX2-SLOW-LABEL: shuffle_v8f32_09ab1def:
429 ; AVX2-SLOW: # %bb.0:
430 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,1,3]
431 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
432 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
433 ; AVX2-SLOW-NEXT: retq
435 ; AVX2-FAST-LABEL: shuffle_v8f32_09ab1def:
436 ; AVX2-FAST: # %bb.0:
437 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <0,1,1,3,1,3,u,u>
438 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
439 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
440 ; AVX2-FAST-NEXT: retq
442 ; AVX512VL-LABEL: shuffle_v8f32_09ab1def:
444 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [8,1,2,3,9,5,6,7]
445 ; AVX512VL-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
446 ; AVX512VL-NEXT: vmovaps %ymm2, %ymm0
447 ; AVX512VL-NEXT: retq
448 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 1, i32 13, i32 14, i32 15>
449 ret <8 x float> %shuffle
452 define <8 x float> @shuffle_v8f32_00014445(<8 x float> %a, <8 x float> %b) {
453 ; ALL-LABEL: shuffle_v8f32_00014445:
455 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,4,4,4,5]
457 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 4, i32 4, i32 4, i32 5>
458 ret <8 x float> %shuffle
461 define <8 x float> @shuffle_v8f32_00204464(<8 x float> %a, <8 x float> %b) {
462 ; ALL-LABEL: shuffle_v8f32_00204464:
464 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,4,6,4]
466 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 4, i32 6, i32 4>
467 ret <8 x float> %shuffle
470 define <8 x float> @shuffle_v8f32_03004744(<8 x float> %a, <8 x float> %b) {
471 ; ALL-LABEL: shuffle_v8f32_03004744:
473 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,7,4,4]
475 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 7, i32 4, i32 4>
476 ret <8 x float> %shuffle
479 define <8 x float> @shuffle_v8f32_10005444(<8 x float> %a, <8 x float> %b) {
480 ; ALL-LABEL: shuffle_v8f32_10005444:
482 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,5,4,4,4]
484 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 5, i32 4, i32 4, i32 4>
485 ret <8 x float> %shuffle
488 define <8 x float> @shuffle_v8f32_22006644(<8 x float> %a, <8 x float> %b) {
489 ; ALL-LABEL: shuffle_v8f32_22006644:
491 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,6,4,4]
493 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 6, i32 4, i32 4>
494 ret <8 x float> %shuffle
497 define <8 x float> @shuffle_v8f32_33307774(<8 x float> %a, <8 x float> %b) {
498 ; ALL-LABEL: shuffle_v8f32_33307774:
500 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,7,7,4]
502 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 7, i32 7, i32 4>
503 ret <8 x float> %shuffle
506 define <8 x float> @shuffle_v8f32_32107654(<8 x float> %a, <8 x float> %b) {
507 ; ALL-LABEL: shuffle_v8f32_32107654:
509 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
511 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
512 ret <8 x float> %shuffle
515 define <8 x float> @shuffle_v8f32_00234467(<8 x float> %a, <8 x float> %b) {
516 ; ALL-LABEL: shuffle_v8f32_00234467:
518 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,4,4,6,7]
520 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 4, i32 4, i32 6, i32 7>
521 ret <8 x float> %shuffle
524 define <8 x float> @shuffle_v8f32_00224466(<8 x float> %a, <8 x float> %b) {
525 ; ALL-LABEL: shuffle_v8f32_00224466:
527 ; ALL-NEXT: vmovsldup {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
529 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>
530 ret <8 x float> %shuffle
533 define <8 x float> @shuffle_v8f32_10325476(<8 x float> %a, <8 x float> %b) {
534 ; ALL-LABEL: shuffle_v8f32_10325476:
536 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,5,4,7,6]
538 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
539 ret <8 x float> %shuffle
542 define <8 x float> @shuffle_v8f32_11335577(<8 x float> %a, <8 x float> %b) {
543 ; ALL-LABEL: shuffle_v8f32_11335577:
545 ; ALL-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
547 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 5, i32 5, i32 7, i32 7>
548 ret <8 x float> %shuffle
551 define <8 x float> @shuffle_v8f32_10235467(<8 x float> %a, <8 x float> %b) {
552 ; ALL-LABEL: shuffle_v8f32_10235467:
554 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,3,5,4,6,7]
556 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
557 ret <8 x float> %shuffle
560 define <8 x float> @shuffle_v8f32_10225466(<8 x float> %a, <8 x float> %b) {
561 ; ALL-LABEL: shuffle_v8f32_10225466:
563 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,2,5,4,6,6]
565 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 2, i32 5, i32 4, i32 6, i32 6>
566 ret <8 x float> %shuffle
569 define <8 x float> @shuffle_v8f32_00015444(<8 x float> %a, <8 x float> %b) {
570 ; ALL-LABEL: shuffle_v8f32_00015444:
572 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,5,4,4,4]
574 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 5, i32 4, i32 4, i32 4>
575 ret <8 x float> %shuffle
578 define <8 x float> @shuffle_v8f32_00204644(<8 x float> %a, <8 x float> %b) {
579 ; ALL-LABEL: shuffle_v8f32_00204644:
581 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,6,4,4]
583 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 6, i32 4, i32 4>
584 ret <8 x float> %shuffle
587 define <8 x float> @shuffle_v8f32_03004474(<8 x float> %a, <8 x float> %b) {
588 ; ALL-LABEL: shuffle_v8f32_03004474:
590 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,4,7,4]
592 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 4, i32 7, i32 4>
593 ret <8 x float> %shuffle
596 define <8 x float> @shuffle_v8f32_10004444(<8 x float> %a, <8 x float> %b) {
597 ; ALL-LABEL: shuffle_v8f32_10004444:
599 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,4,4,4,4]
601 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4>
602 ret <8 x float> %shuffle
605 define <8 x float> @shuffle_v8f32_22006446(<8 x float> %a, <8 x float> %b) {
606 ; ALL-LABEL: shuffle_v8f32_22006446:
608 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,4,4,6]
610 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 4, i32 4, i32 6>
611 ret <8 x float> %shuffle
614 define <8 x float> @shuffle_v8f32_33307474(<8 x float> %a, <8 x float> %b) {
615 ; ALL-LABEL: shuffle_v8f32_33307474:
617 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,4,7,4]
619 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 4, i32 7, i32 4>
620 ret <8 x float> %shuffle
623 define <8 x float> @shuffle_v8f32_32104567(<8 x float> %a, <8 x float> %b) {
624 ; ALL-LABEL: shuffle_v8f32_32104567:
626 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,4,5,6,7]
628 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 4, i32 5, i32 6, i32 7>
629 ret <8 x float> %shuffle
632 define <8 x float> @shuffle_v8f32_00236744(<8 x float> %a, <8 x float> %b) {
633 ; ALL-LABEL: shuffle_v8f32_00236744:
635 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,6,7,4,4]
637 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 6, i32 7, i32 4, i32 4>
638 ret <8 x float> %shuffle
641 define <8 x float> @shuffle_v8f32_00226644(<8 x float> %a, <8 x float> %b) {
642 ; ALL-LABEL: shuffle_v8f32_00226644:
644 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,6,6,4,4]
646 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 6, i32 6, i32 4, i32 4>
647 ret <8 x float> %shuffle
650 define <8 x float> @shuffle_v8f32_10324567(<8 x float> %a, <8 x float> %b) {
651 ; ALL-LABEL: shuffle_v8f32_10324567:
653 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,6,7]
655 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 6, i32 7>
656 ret <8 x float> %shuffle
659 define <8 x float> @shuffle_v8f32_11334567(<8 x float> %a, <8 x float> %b) {
660 ; ALL-LABEL: shuffle_v8f32_11334567:
662 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,4,5,6,7]
664 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 4, i32 5, i32 6, i32 7>
665 ret <8 x float> %shuffle
668 define <8 x float> @shuffle_v8f32_01235467(<8 x float> %a, <8 x float> %b) {
669 ; ALL-LABEL: shuffle_v8f32_01235467:
671 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,7]
673 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
674 ret <8 x float> %shuffle
677 define <8 x float> @shuffle_v8f32_01235466(<8 x float> %a, <8 x float> %b) {
678 ; ALL-LABEL: shuffle_v8f32_01235466:
680 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,6]
682 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 6>
683 ret <8 x float> %shuffle
686 define <8 x float> @shuffle_v8f32_002u6u44(<8 x float> %a, <8 x float> %b) {
687 ; ALL-LABEL: shuffle_v8f32_002u6u44:
689 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,u,6,u,4,4]
691 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 undef, i32 6, i32 undef, i32 4, i32 4>
692 ret <8 x float> %shuffle
695 define <8 x float> @shuffle_v8f32_00uu66uu(<8 x float> %a, <8 x float> %b) {
696 ; ALL-LABEL: shuffle_v8f32_00uu66uu:
698 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,u,u,6,6,u,u]
700 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 0, i32 undef, i32 undef, i32 6, i32 6, i32 undef, i32 undef>
701 ret <8 x float> %shuffle
704 define <8 x float> @shuffle_v8f32_103245uu(<8 x float> %a, <8 x float> %b) {
705 ; ALL-LABEL: shuffle_v8f32_103245uu:
707 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,u,u]
709 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 undef, i32 undef>
710 ret <8 x float> %shuffle
713 define <8 x float> @shuffle_v8f32_1133uu67(<8 x float> %a, <8 x float> %b) {
714 ; ALL-LABEL: shuffle_v8f32_1133uu67:
716 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,u,u,6,7]
718 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 undef, i32 undef, i32 6, i32 7>
719 ret <8 x float> %shuffle
722 define <8 x float> @shuffle_v8f32_0uu354uu(<8 x float> %a, <8 x float> %b) {
723 ; ALL-LABEL: shuffle_v8f32_0uu354uu:
725 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,u,u,3,5,4,u,u]
727 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 undef, i32 undef, i32 3, i32 5, i32 4, i32 undef, i32 undef>
728 ret <8 x float> %shuffle
731 define <8 x float> @shuffle_v8f32_uuu3uu66(<8 x float> %a, <8 x float> %b) {
732 ; ALL-LABEL: shuffle_v8f32_uuu3uu66:
734 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[u,u,u,3,u,u,6,6]
736 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 3, i32 undef, i32 undef, i32 6, i32 6>
737 ret <8 x float> %shuffle
740 define <8 x float> @shuffle_v8f32_c348cda0(<8 x float> %a, <8 x float> %b) {
741 ; AVX1-LABEL: shuffle_v8f32_c348cda0:
743 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[0,1,0,1]
744 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm1[2,3,2,3]
745 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,1],ymm2[2,0],ymm1[4,5],ymm2[6,4]
746 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
747 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,3],ymm2[0,0],ymm0[4,7],ymm2[4,4]
748 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2],ymm1[3,4,5,6],ymm0[7]
751 ; AVX2-SLOW-LABEL: shuffle_v8f32_c348cda0:
752 ; AVX2-SLOW: # %bb.0:
753 ; AVX2-SLOW-NEXT: vmovaps {{.*#+}} ymm2 = <4,u,u,0,4,5,2,u>
754 ; AVX2-SLOW-NEXT: vpermps %ymm1, %ymm2, %ymm1
755 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,2,0,4,7,6,4]
756 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,2,1]
757 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2],ymm1[3,4,5,6],ymm0[7]
758 ; AVX2-SLOW-NEXT: retq
760 ; AVX2-FAST-LABEL: shuffle_v8f32_c348cda0:
761 ; AVX2-FAST: # %bb.0:
762 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,3,4,7,4,7,2,0]
763 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
764 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <4,u,u,0,4,5,2,u>
765 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
766 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2],ymm1[3,4,5,6],ymm0[7]
767 ; AVX2-FAST-NEXT: retq
769 ; AVX512VL-LABEL: shuffle_v8f32_c348cda0:
771 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [4,11,12,0,4,5,2,8]
772 ; AVX512VL-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
773 ; AVX512VL-NEXT: vmovaps %ymm2, %ymm0
774 ; AVX512VL-NEXT: retq
775 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 12, i32 3, i32 4, i32 8, i32 12, i32 13, i32 10, i32 0>
776 ret <8 x float> %shuffle
779 define <8 x float> @shuffle_v8f32_f511235a(<8 x float> %a, <8 x float> %b) {
780 ; AVX1-LABEL: shuffle_v8f32_f511235a:
782 ; AVX1-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[3,1,2,2,7,5,6,6]
783 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm1[2,3,0,1]
784 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
785 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,1,1,4,5,5,5]
786 ; AVX1-NEXT: vshufpd {{.*#+}} ymm0 = ymm2[0],ymm0[1],ymm2[3],ymm0[3]
787 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5,6],ymm1[7]
790 ; AVX2-SLOW-LABEL: shuffle_v8f32_f511235a:
791 ; AVX2-SLOW: # %bb.0:
792 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[3,2,2,3,7,6,6,7]
793 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,1,2,0]
794 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,2,3,5,5,6,7]
795 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,0,1,2]
796 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5,6],ymm1[7]
797 ; AVX2-SLOW-NEXT: retq
799 ; AVX2-FAST-LABEL: shuffle_v8f32_f511235a:
800 ; AVX2-FAST: # %bb.0:
801 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [7,6,2,3,7,6,3,2]
802 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
803 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [5,5,1,1,2,3,5,5]
804 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
805 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5,6],ymm1[7]
806 ; AVX2-FAST-NEXT: retq
808 ; AVX512VL-LABEL: shuffle_v8f32_f511235a:
810 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [15,5,1,1,2,3,5,10]
811 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
812 ; AVX512VL-NEXT: retq
813 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 15, i32 5, i32 1, i32 1, i32 2, i32 3, i32 5, i32 10>
814 ret <8 x float> %shuffle
817 define <8 x float> @shuffle_v8f32_32103210(<8 x float> %a, <8 x float> %b) {
818 ; AVX1-LABEL: shuffle_v8f32_32103210:
820 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
821 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
824 ; AVX2-SLOW-LABEL: shuffle_v8f32_32103210:
825 ; AVX2-SLOW: # %bb.0:
826 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
827 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
828 ; AVX2-SLOW-NEXT: retq
830 ; AVX2-FAST-LABEL: shuffle_v8f32_32103210:
831 ; AVX2-FAST: # %bb.0:
832 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
833 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
834 ; AVX2-FAST-NEXT: retq
836 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_32103210:
837 ; AVX512VL-SLOW: # %bb.0:
838 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
839 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
840 ; AVX512VL-SLOW-NEXT: retq
842 ; AVX512VL-FAST-LABEL: shuffle_v8f32_32103210:
843 ; AVX512VL-FAST: # %bb.0:
844 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
845 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
846 ; AVX512VL-FAST-NEXT: retq
847 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>
848 ret <8 x float> %shuffle
851 define <8 x float> @shuffle_v8f32_76547654(<8 x float> %a, <8 x float> %b) {
852 ; AVX1-LABEL: shuffle_v8f32_76547654:
854 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
855 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
858 ; AVX2-SLOW-LABEL: shuffle_v8f32_76547654:
859 ; AVX2-SLOW: # %bb.0:
860 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
861 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
862 ; AVX2-SLOW-NEXT: retq
864 ; AVX2-FAST-LABEL: shuffle_v8f32_76547654:
865 ; AVX2-FAST: # %bb.0:
866 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
867 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
868 ; AVX2-FAST-NEXT: retq
870 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_76547654:
871 ; AVX512VL-SLOW: # %bb.0:
872 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
873 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
874 ; AVX512VL-SLOW-NEXT: retq
876 ; AVX512VL-FAST-LABEL: shuffle_v8f32_76547654:
877 ; AVX512VL-FAST: # %bb.0:
878 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
879 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
880 ; AVX512VL-FAST-NEXT: retq
881 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 7, i32 6, i32 5, i32 4>
882 ret <8 x float> %shuffle
885 define <8 x float> @shuffle_v8f32_76543210(<8 x float> %a, <8 x float> %b) {
886 ; AVX1-LABEL: shuffle_v8f32_76543210:
888 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
889 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
892 ; AVX2-SLOW-LABEL: shuffle_v8f32_76543210:
893 ; AVX2-SLOW: # %bb.0:
894 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
895 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
896 ; AVX2-SLOW-NEXT: retq
898 ; AVX2-FAST-LABEL: shuffle_v8f32_76543210:
899 ; AVX2-FAST: # %bb.0:
900 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
901 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
902 ; AVX2-FAST-NEXT: retq
904 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_76543210:
905 ; AVX512VL-SLOW: # %bb.0:
906 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
907 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
908 ; AVX512VL-SLOW-NEXT: retq
910 ; AVX512VL-FAST-LABEL: shuffle_v8f32_76543210:
911 ; AVX512VL-FAST: # %bb.0:
912 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
913 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
914 ; AVX512VL-FAST-NEXT: retq
915 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
916 ret <8 x float> %shuffle
919 define <8 x float> @shuffle_v8f32_3210ba98(<8 x float> %a, <8 x float> %b) {
920 ; ALL-LABEL: shuffle_v8f32_3210ba98:
922 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
923 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
925 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 11, i32 10, i32 9, i32 8>
926 ret <8 x float> %shuffle
929 define <8 x float> @shuffle_v8f32_3210fedc(<8 x float> %a, <8 x float> %b) {
930 ; ALL-LABEL: shuffle_v8f32_3210fedc:
932 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
933 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
935 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 15, i32 14, i32 13, i32 12>
936 ret <8 x float> %shuffle
939 define <8 x float> @shuffle_v8f32_7654fedc(<8 x float> %a, <8 x float> %b) {
940 ; AVX1OR2-LABEL: shuffle_v8f32_7654fedc:
942 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
943 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
946 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_7654fedc:
947 ; AVX512VL-SLOW: # %bb.0:
948 ; AVX512VL-SLOW-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
949 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
950 ; AVX512VL-SLOW-NEXT: retq
952 ; AVX512VL-FAST-LABEL: shuffle_v8f32_7654fedc:
953 ; AVX512VL-FAST: # %bb.0:
954 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
955 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
956 ; AVX512VL-FAST-NEXT: retq
957 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 15, i32 14, i32 13, i32 12>
958 ret <8 x float> %shuffle
961 define <8 x float> @shuffle_v8f32_fedc7654(<8 x float> %a, <8 x float> %b) {
962 ; AVX1OR2-LABEL: shuffle_v8f32_fedc7654:
964 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
965 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
968 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_fedc7654:
969 ; AVX512VL-SLOW: # %bb.0:
970 ; AVX512VL-SLOW-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
971 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
972 ; AVX512VL-SLOW-NEXT: retq
974 ; AVX512VL-FAST-LABEL: shuffle_v8f32_fedc7654:
975 ; AVX512VL-FAST: # %bb.0:
976 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
977 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
978 ; AVX512VL-FAST-NEXT: vmovaps %ymm2, %ymm0
979 ; AVX512VL-FAST-NEXT: retq
980 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 15, i32 14, i32 13, i32 12, i32 7, i32 6, i32 5, i32 4>
981 ret <8 x float> %shuffle
984 define <8 x float> @PR21138(<8 x float> %truc, <8 x float> %tchose) {
985 ; AVX1-LABEL: PR21138:
987 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
988 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
989 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
992 ; AVX2-LABEL: PR21138:
994 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
995 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
998 ; AVX512VL-SLOW-LABEL: PR21138:
999 ; AVX512VL-SLOW: # %bb.0:
1000 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
1001 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1002 ; AVX512VL-SLOW-NEXT: retq
1004 ; AVX512VL-FAST-LABEL: PR21138:
1005 ; AVX512VL-FAST: # %bb.0:
1006 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [1,3,5,7,9,11,13,15]
1007 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
1008 ; AVX512VL-FAST-NEXT: retq
1009 %shuffle = shufflevector <8 x float> %truc, <8 x float> %tchose, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
1010 ret <8 x float> %shuffle
1013 define <8 x float> @shuffle_v8f32_ba987654(<8 x float> %a, <8 x float> %b) {
1014 ; ALL-LABEL: shuffle_v8f32_ba987654:
1016 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
1017 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1019 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4>
1020 ret <8 x float> %shuffle
1023 define <8 x float> @shuffle_v8f32_ba983210(<8 x float> %a, <8 x float> %b) {
1024 ; ALL-LABEL: shuffle_v8f32_ba983210:
1026 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1027 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1029 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 11, i32 10, i32 9, i32 8, i32 3, i32 2, i32 1, i32 0>
1030 ret <8 x float> %shuffle
1033 define <8 x float> @shuffle_v8f32_80u1c4u5(<8 x float> %a, <8 x float> %b) {
1034 ; ALL-LABEL: shuffle_v8f32_80u1c4u5:
1036 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[1],ymm0[1],ymm1[4],ymm0[4],ymm1[5],ymm0[5]
1038 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 8, i32 0, i32 undef, i32 1, i32 12, i32 4, i32 undef, i32 5>
1039 ret <8 x float> %shuffle
1042 define <8 x float> @shuffle_v8f32_a2u3e6f7(<8 x float> %a, <8 x float> %b) {
1043 ; ALL-LABEL: shuffle_v8f32_a2u3e6f7:
1045 ; ALL-NEXT: vunpckhps {{.*#+}} ymm0 = ymm1[2],ymm0[2],ymm1[3],ymm0[3],ymm1[6],ymm0[6],ymm1[7],ymm0[7]
1047 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 10, i32 2, i32 undef, i32 3, i32 14, i32 6, i32 15, i32 7>
1048 ret <8 x float> %shuffle
1051 define <8 x float> @shuffle_v8f32_084c195d(<8 x float> %a, <8 x float> %b) {
1052 ; AVX1-LABEL: shuffle_v8f32_084c195d:
1054 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3,0,1]
1055 ; AVX1-NEXT: vpermilps {{.*#+}} ymm2 = ymm2[0,1,2,0,4,5,6,4]
1056 ; AVX1-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[0,0,2,1,4,4,6,5]
1057 ; AVX1-NEXT: vblendps {{.*#+}} ymm1 = ymm1[0,1],ymm2[2,3,4,5],ymm1[6,7]
1058 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
1059 ; AVX1-NEXT: vpermilps {{.*#+}} ymm2 = ymm2[1,1,0,3,5,5,4,7]
1060 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,1,3,4,5,5,7]
1061 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm2[2,3,4,5],ymm0[6,7]
1062 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1065 ; AVX2-LABEL: shuffle_v8f32_084c195d:
1067 ; AVX2-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1068 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1071 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_084c195d:
1072 ; AVX512VL-SLOW: # %bb.0:
1073 ; AVX512VL-SLOW-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1074 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1075 ; AVX512VL-SLOW-NEXT: retq
1077 ; AVX512VL-FAST-LABEL: shuffle_v8f32_084c195d:
1078 ; AVX512VL-FAST: # %bb.0:
1079 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,8,4,12,1,9,5,13]
1080 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
1081 ; AVX512VL-FAST-NEXT: retq
1082 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 8, i32 4, i32 12, i32 1, i32 9, i32 5, i32 13>
1083 ret <8 x float> %shuffle
1086 define <8 x float> @shuffle_v8f32_01452367d(<8 x float> %a) {
1087 ; AVX1-LABEL: shuffle_v8f32_01452367d:
1089 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1090 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,3,2]
1091 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2],ymm0[3]
1094 ; AVX2OR512VL-LABEL: shuffle_v8f32_01452367d:
1095 ; AVX2OR512VL: # %bb.0:
1096 ; AVX2OR512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1097 ; AVX2OR512VL-NEXT: retq
1098 %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> <i32 0, i32 1, i32 4, i32 5, i32 2, i32 3, i32 6, i32 7>
1099 ret <8 x float> %shuffle
1102 define <8 x float> @shuffle_v8f32_uuuu1111(<8 x float> %a, <8 x float> %b) {
1103 ; ALL-LABEL: shuffle_v8f32_uuuu1111:
1105 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1106 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1108 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 1, i32 1, i32 1, i32 1>
1109 ret <8 x float> %shuffle
1112 define <8 x float> @shuffle_v8f32_44444444(<8 x float> %a, <8 x float> %b) {
1113 ; AVX1-LABEL: shuffle_v8f32_44444444:
1115 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,0,4,4,4,4]
1116 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
1119 ; AVX2OR512VL-LABEL: shuffle_v8f32_44444444:
1120 ; AVX2OR512VL: # %bb.0:
1121 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
1122 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
1123 ; AVX2OR512VL-NEXT: retq
1124 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>
1125 ret <8 x float> %shuffle
1128 define <8 x float> @shuffle_v8f32_1188uuuu(<8 x float> %a, <8 x float> %b) {
1129 ; ALL-LABEL: shuffle_v8f32_1188uuuu:
1131 ; ALL-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,1],xmm1[0,0]
1133 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 1, i32 8, i32 8, i32 undef, i32 undef, i32 undef, i32 undef>
1134 ret <8 x float> %shuffle
1137 define <8 x float> @shuffle_v8f32_uuuu3210(<8 x float> %a, <8 x float> %b) {
1138 ; ALL-LABEL: shuffle_v8f32_uuuu3210:
1140 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
1141 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1143 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 3, i32 2, i32 1, i32 0>
1144 ret <8 x float> %shuffle
1147 define <8 x float> @shuffle_v8f32_uuuu1188(<8 x float> %a, <8 x float> %b) {
1148 ; ALL-LABEL: shuffle_v8f32_uuuu1188:
1150 ; ALL-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,1],xmm1[0,0]
1151 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1153 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 1, i32 1, i32 8, i32 8>
1154 ret <8 x float> %shuffle
1157 define <8 x float> @shuffle_v8f32_1111uuuu(<8 x float> %a, <8 x float> %b) {
1158 ; ALL-LABEL: shuffle_v8f32_1111uuuu:
1160 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1162 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 undef, i32 undef, i32 undef, i32 undef>
1163 ret <8 x float> %shuffle
1166 define <8 x float> @shuffle_v8f32_5555uuuu(<8 x float> %a, <8 x float> %b) {
1167 ; ALL-LABEL: shuffle_v8f32_5555uuuu:
1169 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0
1170 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1172 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 5, i32 5, i32 5, i32 5, i32 undef, i32 undef, i32 undef, i32 undef>
1173 ret <8 x float> %shuffle
1176 define <8 x i32> @shuffle_v8i32_00000000(<8 x i32> %a, <8 x i32> %b) {
1177 ; AVX1-LABEL: shuffle_v8i32_00000000:
1179 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
1180 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1183 ; AVX2OR512VL-LABEL: shuffle_v8i32_00000000:
1184 ; AVX2OR512VL: # %bb.0:
1185 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
1186 ; AVX2OR512VL-NEXT: retq
1187 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1188 ret <8 x i32> %shuffle
1191 define <8 x i32> @shuffle_v8i32_00000010(<8 x i32> %a, <8 x i32> %b) {
1192 ; AVX1-LABEL: shuffle_v8i32_00000010:
1194 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1195 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
1196 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1199 ; AVX2-SLOW-LABEL: shuffle_v8i32_00000010:
1200 ; AVX2-SLOW: # %bb.0:
1201 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
1202 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
1203 ; AVX2-SLOW-NEXT: retq
1205 ; AVX2-FAST-LABEL: shuffle_v8i32_00000010:
1206 ; AVX2-FAST: # %bb.0:
1207 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,0,1,0]
1208 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1209 ; AVX2-FAST-NEXT: retq
1211 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00000010:
1212 ; AVX512VL-SLOW: # %bb.0:
1213 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
1214 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
1215 ; AVX512VL-SLOW-NEXT: retq
1217 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00000010:
1218 ; AVX512VL-FAST: # %bb.0:
1219 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,0,1,0]
1220 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1221 ; AVX512VL-FAST-NEXT: retq
1222 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0>
1223 ret <8 x i32> %shuffle
1226 define <8 x i32> @shuffle_v8i32_00000200(<8 x i32> %a, <8 x i32> %b) {
1227 ; AVX1-LABEL: shuffle_v8i32_00000200:
1229 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1230 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,0,0]
1231 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1234 ; AVX2-SLOW-LABEL: shuffle_v8i32_00000200:
1235 ; AVX2-SLOW: # %bb.0:
1236 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,2]
1237 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1238 ; AVX2-SLOW-NEXT: retq
1240 ; AVX2-FAST-LABEL: shuffle_v8i32_00000200:
1241 ; AVX2-FAST: # %bb.0:
1242 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,2,0,0]
1243 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1244 ; AVX2-FAST-NEXT: retq
1246 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00000200:
1247 ; AVX512VL-SLOW: # %bb.0:
1248 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,2]
1249 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1250 ; AVX512VL-SLOW-NEXT: retq
1252 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00000200:
1253 ; AVX512VL-FAST: # %bb.0:
1254 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,2,0,0]
1255 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1256 ; AVX512VL-FAST-NEXT: retq
1257 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0>
1258 ret <8 x i32> %shuffle
1261 define <8 x i32> @shuffle_v8i32_00003000(<8 x i32> %a, <8 x i32> %b) {
1262 ; AVX1-LABEL: shuffle_v8i32_00003000:
1264 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1265 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,0,0,0]
1266 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1269 ; AVX2-SLOW-LABEL: shuffle_v8i32_00003000:
1270 ; AVX2-SLOW: # %bb.0:
1271 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,3,0]
1272 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1273 ; AVX2-SLOW-NEXT: retq
1275 ; AVX2-FAST-LABEL: shuffle_v8i32_00003000:
1276 ; AVX2-FAST: # %bb.0:
1277 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,3,0,0,0]
1278 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1279 ; AVX2-FAST-NEXT: retq
1281 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00003000:
1282 ; AVX512VL-SLOW: # %bb.0:
1283 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,3,0]
1284 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1285 ; AVX512VL-SLOW-NEXT: retq
1287 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00003000:
1288 ; AVX512VL-FAST: # %bb.0:
1289 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,3,0,0,0]
1290 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1291 ; AVX512VL-FAST-NEXT: retq
1292 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 0, i32 0>
1293 ret <8 x i32> %shuffle
1296 define <8 x i32> @shuffle_v8i32_00040000(<8 x i32> %a, <8 x i32> %b) {
1297 ; AVX1-LABEL: shuffle_v8i32_00040000:
1299 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[0,1,0,1]
1300 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
1301 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
1302 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,0],ymm0[2,0],ymm1[4,4],ymm0[6,4]
1305 ; AVX2OR512VL-LABEL: shuffle_v8i32_00040000:
1306 ; AVX2OR512VL: # %bb.0:
1307 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,4,0,0,0,0]
1308 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1309 ; AVX2OR512VL-NEXT: retq
1310 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0>
1311 ret <8 x i32> %shuffle
1314 define <8 x i32> @shuffle_v8i32_00500000(<8 x i32> %a, <8 x i32> %b) {
1315 ; AVX1-LABEL: shuffle_v8i32_00500000:
1317 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1318 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4,5,6,7]
1319 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,1,0,4,4,4,4]
1322 ; AVX2OR512VL-LABEL: shuffle_v8i32_00500000:
1323 ; AVX2OR512VL: # %bb.0:
1324 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,5,0,0,0,0,0]
1325 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1326 ; AVX2OR512VL-NEXT: retq
1327 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0>
1328 ret <8 x i32> %shuffle
1331 define <8 x i32> @shuffle_v8i32_06000000(<8 x i32> %a, <8 x i32> %b) {
1332 ; AVX1-LABEL: shuffle_v8i32_06000000:
1334 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1335 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
1336 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,0,0,4,4,4,4]
1339 ; AVX2OR512VL-LABEL: shuffle_v8i32_06000000:
1340 ; AVX2OR512VL: # %bb.0:
1341 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,6,0,0,0,0,0,0]
1342 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1343 ; AVX2OR512VL-NEXT: retq
1344 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1345 ret <8 x i32> %shuffle
1348 define <8 x i32> @shuffle_v8i32_70000000(<8 x i32> %a, <8 x i32> %b) {
1349 ; AVX1-LABEL: shuffle_v8i32_70000000:
1351 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1352 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
1353 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,0,0,0,4,4,4,4]
1356 ; AVX2OR512VL-LABEL: shuffle_v8i32_70000000:
1357 ; AVX2OR512VL: # %bb.0:
1358 ; AVX2OR512VL-NEXT: movl $7, %eax
1359 ; AVX2OR512VL-NEXT: vmovd %eax, %xmm1
1360 ; AVX2OR512VL-NEXT: vpermd %ymm0, %ymm1, %ymm0
1361 ; AVX2OR512VL-NEXT: retq
1362 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
1363 ret <8 x i32> %shuffle
1366 define <8 x i32> @shuffle_v8i32_01014545(<8 x i32> %a, <8 x i32> %b) {
1367 ; AVX1-LABEL: shuffle_v8i32_01014545:
1369 ; AVX1-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
1372 ; AVX2OR512VL-LABEL: shuffle_v8i32_01014545:
1373 ; AVX2OR512VL: # %bb.0:
1374 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
1375 ; AVX2OR512VL-NEXT: retq
1376 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 4, i32 5, i32 4, i32 5>
1377 ret <8 x i32> %shuffle
1380 define <8 x i32> @shuffle_v8i32_00112233(<8 x i32> %a, <8 x i32> %b) {
1381 ; AVX1-LABEL: shuffle_v8i32_00112233:
1383 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,1,1]
1384 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,3,3]
1385 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1388 ; AVX2OR512VL-LABEL: shuffle_v8i32_00112233:
1389 ; AVX2OR512VL: # %bb.0:
1390 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,1,1,2,2,3,3]
1391 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1392 ; AVX2OR512VL-NEXT: retq
1393 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
1394 ret <8 x i32> %shuffle
1397 define <8 x i32> @shuffle_v8i32_00001111(<8 x i32> %a, <8 x i32> %b) {
1398 ; AVX1-LABEL: shuffle_v8i32_00001111:
1400 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1401 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1402 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1405 ; AVX2-SLOW-LABEL: shuffle_v8i32_00001111:
1406 ; AVX2-SLOW: # %bb.0:
1407 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,1]
1408 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
1409 ; AVX2-SLOW-NEXT: retq
1411 ; AVX2-FAST-LABEL: shuffle_v8i32_00001111:
1412 ; AVX2-FAST: # %bb.0:
1413 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,1,1,1,1]
1414 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1415 ; AVX2-FAST-NEXT: retq
1417 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00001111:
1418 ; AVX512VL-SLOW: # %bb.0:
1419 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,1]
1420 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
1421 ; AVX512VL-SLOW-NEXT: retq
1423 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00001111:
1424 ; AVX512VL-FAST: # %bb.0:
1425 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,1,1,1,1]
1426 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1427 ; AVX512VL-FAST-NEXT: retq
1428 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1>
1429 ret <8 x i32> %shuffle
1432 define <8 x i32> @shuffle_v8i32_81a3c5e7(<8 x i32> %a, <8 x i32> %b) {
1433 ; ALL-LABEL: shuffle_v8i32_81a3c5e7:
1435 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7]
1437 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 5, i32 14, i32 7>
1438 ret <8 x i32> %shuffle
1441 define <8 x i32> @shuffle_v8i32_08080808(<8 x i32> %a, <8 x i32> %b) {
1442 ; AVX1-LABEL: shuffle_v8i32_08080808:
1444 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,0],xmm1[0,0]
1445 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,1,3]
1446 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1449 ; AVX2OR512VL-LABEL: shuffle_v8i32_08080808:
1450 ; AVX2OR512VL: # %bb.0:
1451 ; AVX2OR512VL-NEXT: vunpcklps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1452 ; AVX2OR512VL-NEXT: vbroadcastsd %xmm0, %ymm0
1453 ; AVX2OR512VL-NEXT: retq
1454 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8>
1455 ret <8 x i32> %shuffle
1458 define <8 x i32> @shuffle_v8i32_08084c4c(<8 x i32> %a, <8 x i32> %b) {
1459 ; AVX1-LABEL: shuffle_v8i32_08084c4c:
1461 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
1462 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
1465 ; AVX2OR512VL-LABEL: shuffle_v8i32_08084c4c:
1466 ; AVX2OR512VL: # %bb.0:
1467 ; AVX2OR512VL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1468 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
1469 ; AVX2OR512VL-NEXT: retq
1470 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 4, i32 12, i32 4, i32 12>
1471 ret <8 x i32> %shuffle
1474 define <8 x i32> @shuffle_v8i32_8823cc67(<8 x i32> %a, <8 x i32> %b) {
1475 ; ALL-LABEL: shuffle_v8i32_8823cc67:
1477 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,0],ymm0[2,3],ymm1[4,4],ymm0[6,7]
1479 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 8, i32 8, i32 2, i32 3, i32 12, i32 12, i32 6, i32 7>
1480 ret <8 x i32> %shuffle
1483 define <8 x i32> @shuffle_v8i32_9832dc76(<8 x i32> %a, <8 x i32> %b) {
1484 ; ALL-LABEL: shuffle_v8i32_9832dc76:
1486 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[3,2],ymm1[5,4],ymm0[7,6]
1488 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 9, i32 8, i32 3, i32 2, i32 13, i32 12, i32 7, i32 6>
1489 ret <8 x i32> %shuffle
1492 define <8 x i32> @shuffle_v8i32_9810dc54(<8 x i32> %a, <8 x i32> %b) {
1493 ; ALL-LABEL: shuffle_v8i32_9810dc54:
1495 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[1,0],ymm1[5,4],ymm0[5,4]
1497 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 9, i32 8, i32 1, i32 0, i32 13, i32 12, i32 5, i32 4>
1498 ret <8 x i32> %shuffle
1501 define <8 x i32> @shuffle_v8i32_08194c5d(<8 x i32> %a, <8 x i32> %b) {
1502 ; ALL-LABEL: shuffle_v8i32_08194c5d:
1504 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1506 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
1507 ret <8 x i32> %shuffle
1510 define <8 x i32> @shuffle_v8i32_2a3b6e7f(<8 x i32> %a, <8 x i32> %b) {
1511 ; ALL-LABEL: shuffle_v8i32_2a3b6e7f:
1513 ; ALL-NEXT: vunpckhps {{.*#+}} ymm0 = ymm0[2],ymm1[2],ymm0[3],ymm1[3],ymm0[6],ymm1[6],ymm0[7],ymm1[7]
1515 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
1516 ret <8 x i32> %shuffle
1519 define <8 x i32> @shuffle_v8i32_08192a3b(<8 x i32> %a, <8 x i32> %b) {
1520 ; AVX1OR2-LABEL: shuffle_v8i32_08192a3b:
1522 ; AVX1OR2-NEXT: vunpckhps {{.*#+}} xmm2 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
1523 ; AVX1OR2-NEXT: vunpcklps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1524 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1525 ; AVX1OR2-NEXT: retq
1527 ; AVX512VL-LABEL: shuffle_v8i32_08192a3b:
1528 ; AVX512VL: # %bb.0:
1529 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [0,8,1,9,2,10,3,11]
1530 ; AVX512VL-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
1531 ; AVX512VL-NEXT: retq
1532 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
1533 ret <8 x i32> %shuffle
1536 define <8 x i32> @shuffle_v8i32_08991abb(<8 x i32> %a, <8 x i32> %b) {
1537 ; AVX1-LABEL: shuffle_v8i32_08991abb:
1539 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm0[0,0],xmm1[0,0]
1540 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm2[0,2],xmm1[1,1]
1541 ; AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3]
1542 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,2,3,3]
1543 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
1546 ; AVX2-LABEL: shuffle_v8i32_08991abb:
1548 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
1549 ; AVX2-NEXT: vpermd %ymm1, %ymm2, %ymm1
1550 ; AVX2-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
1551 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1552 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1555 ; AVX512VL-LABEL: shuffle_v8i32_08991abb:
1556 ; AVX512VL: # %bb.0:
1557 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,0,1,1,9,2,3,3]
1558 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
1559 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
1560 ; AVX512VL-NEXT: retq
1561 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 8, i32 9, i32 9, i32 1, i32 10, i32 11, i32 11>
1562 ret <8 x i32> %shuffle
1565 define <8 x i32> @shuffle_v8i32_091b2d3f(<8 x i32> %a, <8 x i32> %b) {
1566 ; AVX1-LABEL: shuffle_v8i32_091b2d3f:
1568 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[0,1,1,3]
1569 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,1,3,3]
1570 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
1571 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1574 ; AVX2-LABEL: shuffle_v8i32_091b2d3f:
1576 ; AVX2-NEXT: vpmovzxdq {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
1577 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1580 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_091b2d3f:
1581 ; AVX512VL-SLOW: # %bb.0:
1582 ; AVX512VL-SLOW-NEXT: vpmovzxdq {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
1583 ; AVX512VL-SLOW-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1584 ; AVX512VL-SLOW-NEXT: retq
1586 ; AVX512VL-FAST-LABEL: shuffle_v8i32_091b2d3f:
1587 ; AVX512VL-FAST: # %bb.0:
1588 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,9,1,11,2,13,3,15]
1589 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
1590 ; AVX512VL-FAST-NEXT: retq
1591 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 9, i32 1, i32 11, i32 2, i32 13, i32 3, i32 15>
1592 ret <8 x i32> %shuffle
1595 define <8 x i32> @shuffle_v8i32_09ab1def(<8 x i32> %a, <8 x i32> %b) {
1596 ; AVX1-LABEL: shuffle_v8i32_09ab1def:
1598 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[1,1,3,3]
1599 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1600 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1603 ; AVX2-LABEL: shuffle_v8i32_09ab1def:
1605 ; AVX2-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
1606 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1607 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1610 ; AVX512VL-LABEL: shuffle_v8i32_09ab1def:
1611 ; AVX512VL: # %bb.0:
1612 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,1,2,3,9,5,6,7]
1613 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
1614 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
1615 ; AVX512VL-NEXT: retq
1616 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 1, i32 13, i32 14, i32 15>
1617 ret <8 x i32> %shuffle
1620 define <8 x i32> @shuffle_v8i32_00014445(<8 x i32> %a, <8 x i32> %b) {
1621 ; ALL-LABEL: shuffle_v8i32_00014445:
1623 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,4,4,4,5]
1625 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 4, i32 4, i32 4, i32 5>
1626 ret <8 x i32> %shuffle
1629 define <8 x i32> @shuffle_v8i32_00204464(<8 x i32> %a, <8 x i32> %b) {
1630 ; ALL-LABEL: shuffle_v8i32_00204464:
1632 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,4,6,4]
1634 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 4, i32 6, i32 4>
1635 ret <8 x i32> %shuffle
1638 define <8 x i32> @shuffle_v8i32_03004744(<8 x i32> %a, <8 x i32> %b) {
1639 ; ALL-LABEL: shuffle_v8i32_03004744:
1641 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,7,4,4]
1643 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 7, i32 4, i32 4>
1644 ret <8 x i32> %shuffle
1647 define <8 x i32> @shuffle_v8i32_10005444(<8 x i32> %a, <8 x i32> %b) {
1648 ; ALL-LABEL: shuffle_v8i32_10005444:
1650 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,5,4,4,4]
1652 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 5, i32 4, i32 4, i32 4>
1653 ret <8 x i32> %shuffle
1656 define <8 x i32> @shuffle_v8i32_22006644(<8 x i32> %a, <8 x i32> %b) {
1657 ; ALL-LABEL: shuffle_v8i32_22006644:
1659 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,6,4,4]
1661 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 6, i32 4, i32 4>
1662 ret <8 x i32> %shuffle
1665 define <8 x i32> @shuffle_v8i32_33307774(<8 x i32> %a, <8 x i32> %b) {
1666 ; ALL-LABEL: shuffle_v8i32_33307774:
1668 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,7,7,4]
1670 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 7, i32 7, i32 4>
1671 ret <8 x i32> %shuffle
1674 define <8 x i32> @shuffle_v8i32_32107654(<8 x i32> %a, <8 x i32> %b) {
1675 ; ALL-LABEL: shuffle_v8i32_32107654:
1677 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1679 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
1680 ret <8 x i32> %shuffle
1683 define <8 x i32> @shuffle_v8i32_00234467(<8 x i32> %a, <8 x i32> %b) {
1684 ; ALL-LABEL: shuffle_v8i32_00234467:
1686 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,4,4,6,7]
1688 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 4, i32 4, i32 6, i32 7>
1689 ret <8 x i32> %shuffle
1692 define <8 x i32> @shuffle_v8i32_00224466(<8 x i32> %a, <8 x i32> %b) {
1693 ; AVX1-LABEL: shuffle_v8i32_00224466:
1695 ; AVX1-NEXT: vmovsldup {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
1698 ; AVX2OR512VL-LABEL: shuffle_v8i32_00224466:
1699 ; AVX2OR512VL: # %bb.0:
1700 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
1701 ; AVX2OR512VL-NEXT: retq
1702 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>
1703 ret <8 x i32> %shuffle
1706 define <8 x i32> @shuffle_v8i32_10325476(<8 x i32> %a, <8 x i32> %b) {
1707 ; ALL-LABEL: shuffle_v8i32_10325476:
1709 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,5,4,7,6]
1711 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
1712 ret <8 x i32> %shuffle
1715 define <8 x i32> @shuffle_v8i32_11335577(<8 x i32> %a, <8 x i32> %b) {
1716 ; AVX1-LABEL: shuffle_v8i32_11335577:
1718 ; AVX1-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
1721 ; AVX2OR512VL-LABEL: shuffle_v8i32_11335577:
1722 ; AVX2OR512VL: # %bb.0:
1723 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
1724 ; AVX2OR512VL-NEXT: retq
1725 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 5, i32 5, i32 7, i32 7>
1726 ret <8 x i32> %shuffle
1729 define <8 x i32> @shuffle_v8i32_10235467(<8 x i32> %a, <8 x i32> %b) {
1730 ; ALL-LABEL: shuffle_v8i32_10235467:
1732 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,3,5,4,6,7]
1734 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
1735 ret <8 x i32> %shuffle
1738 define <8 x i32> @shuffle_v8i32_10225466(<8 x i32> %a, <8 x i32> %b) {
1739 ; ALL-LABEL: shuffle_v8i32_10225466:
1741 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,2,5,4,6,6]
1743 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 2, i32 5, i32 4, i32 6, i32 6>
1744 ret <8 x i32> %shuffle
1747 define <8 x i32> @shuffle_v8i32_00015444(<8 x i32> %a, <8 x i32> %b) {
1748 ; AVX1-LABEL: shuffle_v8i32_00015444:
1750 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,5,4,4,4]
1753 ; AVX2OR512VL-LABEL: shuffle_v8i32_00015444:
1754 ; AVX2OR512VL: # %bb.0:
1755 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,1,5,4,4,4]
1756 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1757 ; AVX2OR512VL-NEXT: retq
1758 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 5, i32 4, i32 4, i32 4>
1759 ret <8 x i32> %shuffle
1762 define <8 x i32> @shuffle_v8i32_00204644(<8 x i32> %a, <8 x i32> %b) {
1763 ; AVX1-LABEL: shuffle_v8i32_00204644:
1765 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,6,4,4]
1768 ; AVX2OR512VL-LABEL: shuffle_v8i32_00204644:
1769 ; AVX2OR512VL: # %bb.0:
1770 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,0,4,6,4,4]
1771 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1772 ; AVX2OR512VL-NEXT: retq
1773 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 6, i32 4, i32 4>
1774 ret <8 x i32> %shuffle
1777 define <8 x i32> @shuffle_v8i32_03004474(<8 x i32> %a, <8 x i32> %b) {
1778 ; AVX1-LABEL: shuffle_v8i32_03004474:
1780 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,4,7,4]
1783 ; AVX2OR512VL-LABEL: shuffle_v8i32_03004474:
1784 ; AVX2OR512VL: # %bb.0:
1785 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,3,0,0,4,4,7,4]
1786 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1787 ; AVX2OR512VL-NEXT: retq
1788 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 4, i32 7, i32 4>
1789 ret <8 x i32> %shuffle
1792 define <8 x i32> @shuffle_v8i32_10004444(<8 x i32> %a, <8 x i32> %b) {
1793 ; AVX1-LABEL: shuffle_v8i32_10004444:
1795 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,4,4,4,4]
1798 ; AVX2OR512VL-LABEL: shuffle_v8i32_10004444:
1799 ; AVX2OR512VL: # %bb.0:
1800 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,0,0,0,4,4,4,4]
1801 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1802 ; AVX2OR512VL-NEXT: retq
1803 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4>
1804 ret <8 x i32> %shuffle
1807 define <8 x i32> @shuffle_v8i32_22006446(<8 x i32> %a, <8 x i32> %b) {
1808 ; AVX1-LABEL: shuffle_v8i32_22006446:
1810 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,4,4,6]
1813 ; AVX2OR512VL-LABEL: shuffle_v8i32_22006446:
1814 ; AVX2OR512VL: # %bb.0:
1815 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [2,2,0,0,6,4,4,6]
1816 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1817 ; AVX2OR512VL-NEXT: retq
1818 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 4, i32 4, i32 6>
1819 ret <8 x i32> %shuffle
1822 define <8 x i32> @shuffle_v8i32_33307474(<8 x i32> %a, <8 x i32> %b) {
1823 ; AVX1-LABEL: shuffle_v8i32_33307474:
1825 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,4,7,4]
1828 ; AVX2OR512VL-LABEL: shuffle_v8i32_33307474:
1829 ; AVX2OR512VL: # %bb.0:
1830 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [3,3,3,0,7,4,7,4]
1831 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1832 ; AVX2OR512VL-NEXT: retq
1833 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 4, i32 7, i32 4>
1834 ret <8 x i32> %shuffle
1837 define <8 x i32> @shuffle_v8i32_32104567(<8 x i32> %a, <8 x i32> %b) {
1838 ; AVX1-LABEL: shuffle_v8i32_32104567:
1840 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,4,5,6,7]
1843 ; AVX2OR512VL-LABEL: shuffle_v8i32_32104567:
1844 ; AVX2OR512VL: # %bb.0:
1845 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [3,2,1,0,4,5,6,7]
1846 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1847 ; AVX2OR512VL-NEXT: retq
1848 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 4, i32 5, i32 6, i32 7>
1849 ret <8 x i32> %shuffle
1852 define <8 x i32> @shuffle_v8i32_00236744(<8 x i32> %a, <8 x i32> %b) {
1853 ; AVX1-LABEL: shuffle_v8i32_00236744:
1855 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,6,7,4,4]
1858 ; AVX2OR512VL-LABEL: shuffle_v8i32_00236744:
1859 ; AVX2OR512VL: # %bb.0:
1860 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,3,6,7,4,4]
1861 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1862 ; AVX2OR512VL-NEXT: retq
1863 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 6, i32 7, i32 4, i32 4>
1864 ret <8 x i32> %shuffle
1867 define <8 x i32> @shuffle_v8i32_00226644(<8 x i32> %a, <8 x i32> %b) {
1868 ; AVX1-LABEL: shuffle_v8i32_00226644:
1870 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,6,6,4,4]
1873 ; AVX2OR512VL-LABEL: shuffle_v8i32_00226644:
1874 ; AVX2OR512VL: # %bb.0:
1875 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,2,6,6,4,4]
1876 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1877 ; AVX2OR512VL-NEXT: retq
1878 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 6, i32 6, i32 4, i32 4>
1879 ret <8 x i32> %shuffle
1882 define <8 x i32> @shuffle_v8i32_10324567(<8 x i32> %a, <8 x i32> %b) {
1883 ; AVX1-LABEL: shuffle_v8i32_10324567:
1885 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,6,7]
1888 ; AVX2OR512VL-LABEL: shuffle_v8i32_10324567:
1889 ; AVX2OR512VL: # %bb.0:
1890 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,0,3,2,4,5,6,7]
1891 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1892 ; AVX2OR512VL-NEXT: retq
1893 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 6, i32 7>
1894 ret <8 x i32> %shuffle
1897 define <8 x i32> @shuffle_v8i32_11334567(<8 x i32> %a, <8 x i32> %b) {
1898 ; AVX1-LABEL: shuffle_v8i32_11334567:
1900 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,4,5,6,7]
1903 ; AVX2OR512VL-LABEL: shuffle_v8i32_11334567:
1904 ; AVX2OR512VL: # %bb.0:
1905 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,1,3,3,4,5,6,7]
1906 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1907 ; AVX2OR512VL-NEXT: retq
1908 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 4, i32 5, i32 6, i32 7>
1909 ret <8 x i32> %shuffle
1912 define <8 x i32> @shuffle_v8i32_01235467(<8 x i32> %a, <8 x i32> %b) {
1913 ; AVX1-LABEL: shuffle_v8i32_01235467:
1915 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,7]
1918 ; AVX2OR512VL-LABEL: shuffle_v8i32_01235467:
1919 ; AVX2OR512VL: # %bb.0:
1920 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,1,2,3,5,4,6,7]
1921 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1922 ; AVX2OR512VL-NEXT: retq
1923 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
1924 ret <8 x i32> %shuffle
1927 define <8 x i32> @shuffle_v8i32_01235466(<8 x i32> %a, <8 x i32> %b) {
1928 ; AVX1-LABEL: shuffle_v8i32_01235466:
1930 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,6]
1933 ; AVX2OR512VL-LABEL: shuffle_v8i32_01235466:
1934 ; AVX2OR512VL: # %bb.0:
1935 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,1,2,3,5,4,6,6]
1936 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1937 ; AVX2OR512VL-NEXT: retq
1938 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 6>
1939 ret <8 x i32> %shuffle
1942 define <8 x i32> @shuffle_v8i32_002u6u44(<8 x i32> %a, <8 x i32> %b) {
1943 ; AVX1-LABEL: shuffle_v8i32_002u6u44:
1945 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,u,6,u,4,4]
1948 ; AVX2OR512VL-LABEL: shuffle_v8i32_002u6u44:
1949 ; AVX2OR512VL: # %bb.0:
1950 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,0,2,u,6,u,4,4>
1951 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1952 ; AVX2OR512VL-NEXT: retq
1953 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 undef, i32 6, i32 undef, i32 4, i32 4>
1954 ret <8 x i32> %shuffle
1957 define <8 x i32> @shuffle_v8i32_00uu66uu(<8 x i32> %a, <8 x i32> %b) {
1958 ; AVX1-LABEL: shuffle_v8i32_00uu66uu:
1960 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,u,u,6,6,u,u]
1963 ; AVX2OR512VL-LABEL: shuffle_v8i32_00uu66uu:
1964 ; AVX2OR512VL: # %bb.0:
1965 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,0,u,u,6,6,u,u>
1966 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1967 ; AVX2OR512VL-NEXT: retq
1968 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 0, i32 undef, i32 undef, i32 6, i32 6, i32 undef, i32 undef>
1969 ret <8 x i32> %shuffle
1972 define <8 x i32> @shuffle_v8i32_103245uu(<8 x i32> %a, <8 x i32> %b) {
1973 ; AVX1-LABEL: shuffle_v8i32_103245uu:
1975 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,u,u]
1978 ; AVX2OR512VL-LABEL: shuffle_v8i32_103245uu:
1979 ; AVX2OR512VL: # %bb.0:
1980 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <1,0,3,2,4,5,u,u>
1981 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1982 ; AVX2OR512VL-NEXT: retq
1983 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 undef, i32 undef>
1984 ret <8 x i32> %shuffle
1987 define <8 x i32> @shuffle_v8i32_1133uu67(<8 x i32> %a, <8 x i32> %b) {
1988 ; AVX1-LABEL: shuffle_v8i32_1133uu67:
1990 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,u,u,6,7]
1993 ; AVX2OR512VL-LABEL: shuffle_v8i32_1133uu67:
1994 ; AVX2OR512VL: # %bb.0:
1995 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <1,1,3,3,u,u,6,7>
1996 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1997 ; AVX2OR512VL-NEXT: retq
1998 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 undef, i32 undef, i32 6, i32 7>
1999 ret <8 x i32> %shuffle
2002 define <8 x i32> @shuffle_v8i32_0uu354uu(<8 x i32> %a, <8 x i32> %b) {
2003 ; AVX1-LABEL: shuffle_v8i32_0uu354uu:
2005 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,u,u,3,5,4,u,u]
2008 ; AVX2OR512VL-LABEL: shuffle_v8i32_0uu354uu:
2009 ; AVX2OR512VL: # %bb.0:
2010 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,u,u,3,5,4,u,u>
2011 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2012 ; AVX2OR512VL-NEXT: retq
2013 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 undef, i32 undef, i32 3, i32 5, i32 4, i32 undef, i32 undef>
2014 ret <8 x i32> %shuffle
2017 define <8 x i32> @shuffle_v8i32_uuu3uu66(<8 x i32> %a, <8 x i32> %b) {
2018 ; AVX1-LABEL: shuffle_v8i32_uuu3uu66:
2020 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[u,u,u,3,u,u,6,6]
2023 ; AVX2OR512VL-LABEL: shuffle_v8i32_uuu3uu66:
2024 ; AVX2OR512VL: # %bb.0:
2025 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <u,u,u,3,u,u,6,6>
2026 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2027 ; AVX2OR512VL-NEXT: retq
2028 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 3, i32 undef, i32 undef, i32 6, i32 6>
2029 ret <8 x i32> %shuffle
2032 define <8 x i32> @shuffle_v8i32_6caa87e5(<8 x i32> %a, <8 x i32> %b) {
2033 ; AVX1-LABEL: shuffle_v8i32_6caa87e5:
2035 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
2036 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2037 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3,0,1]
2038 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm2[0,0],ymm1[2,2],ymm2[4,4],ymm1[6,6]
2039 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2042 ; AVX2-SLOW-LABEL: shuffle_v8i32_6caa87e5:
2043 ; AVX2-SLOW: # %bb.0:
2044 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,3,2]
2045 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[0,0,2,2,4,4,6,6]
2046 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,1,0,3]
2047 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2048 ; AVX2-SLOW-NEXT: retq
2050 ; AVX2-FAST-LABEL: shuffle_v8i32_6caa87e5:
2051 ; AVX2-FAST: # %bb.0:
2052 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [4,4,2,2,0,0,6,6]
2053 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
2054 ; AVX2-FAST-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,3,2]
2055 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2056 ; AVX2-FAST-NEXT: retq
2058 ; AVX512VL-LABEL: shuffle_v8i32_6caa87e5:
2059 ; AVX512VL: # %bb.0:
2060 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [14,4,2,2,0,15,6,13]
2061 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2062 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
2063 ; AVX512VL-NEXT: retq
2064 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 6, i32 12, i32 10, i32 10, i32 8, i32 7, i32 14, i32 5>
2065 ret <8 x i32> %shuffle
2068 define <8 x i32> @shuffle_v8i32_32103210(<8 x i32> %a, <8 x i32> %b) {
2069 ; AVX1-LABEL: shuffle_v8i32_32103210:
2071 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2072 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2075 ; AVX2-SLOW-LABEL: shuffle_v8i32_32103210:
2076 ; AVX2-SLOW: # %bb.0:
2077 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2078 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
2079 ; AVX2-SLOW-NEXT: retq
2081 ; AVX2-FAST-LABEL: shuffle_v8i32_32103210:
2082 ; AVX2-FAST: # %bb.0:
2083 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
2084 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2085 ; AVX2-FAST-NEXT: retq
2087 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_32103210:
2088 ; AVX512VL-SLOW: # %bb.0:
2089 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2090 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
2091 ; AVX512VL-SLOW-NEXT: retq
2093 ; AVX512VL-FAST-LABEL: shuffle_v8i32_32103210:
2094 ; AVX512VL-FAST: # %bb.0:
2095 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
2096 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2097 ; AVX512VL-FAST-NEXT: retq
2098 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 3, i32 2, i32 1, i32 0>
2099 ret <8 x i32> %shuffle
2102 define <8 x i32> @shuffle_v8i32_76547654(<8 x i32> %a, <8 x i32> %b) {
2103 ; AVX1-LABEL: shuffle_v8i32_76547654:
2105 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2106 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2109 ; AVX2-SLOW-LABEL: shuffle_v8i32_76547654:
2110 ; AVX2-SLOW: # %bb.0:
2111 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2112 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
2113 ; AVX2-SLOW-NEXT: retq
2115 ; AVX2-FAST-LABEL: shuffle_v8i32_76547654:
2116 ; AVX2-FAST: # %bb.0:
2117 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
2118 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2119 ; AVX2-FAST-NEXT: retq
2121 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_76547654:
2122 ; AVX512VL-SLOW: # %bb.0:
2123 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2124 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
2125 ; AVX512VL-SLOW-NEXT: retq
2127 ; AVX512VL-FAST-LABEL: shuffle_v8i32_76547654:
2128 ; AVX512VL-FAST: # %bb.0:
2129 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
2130 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2131 ; AVX512VL-FAST-NEXT: retq
2132 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 7, i32 6, i32 5, i32 4>
2133 ret <8 x i32> %shuffle
2136 define <8 x i32> @shuffle_v8i32_76543210(<8 x i32> %a, <8 x i32> %b) {
2137 ; AVX1-LABEL: shuffle_v8i32_76543210:
2139 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2140 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
2143 ; AVX2-SLOW-LABEL: shuffle_v8i32_76543210:
2144 ; AVX2-SLOW: # %bb.0:
2145 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2146 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
2147 ; AVX2-SLOW-NEXT: retq
2149 ; AVX2-FAST-LABEL: shuffle_v8i32_76543210:
2150 ; AVX2-FAST: # %bb.0:
2151 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
2152 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2153 ; AVX2-FAST-NEXT: retq
2155 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_76543210:
2156 ; AVX512VL-SLOW: # %bb.0:
2157 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2158 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
2159 ; AVX512VL-SLOW-NEXT: retq
2161 ; AVX512VL-FAST-LABEL: shuffle_v8i32_76543210:
2162 ; AVX512VL-FAST: # %bb.0:
2163 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
2164 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2165 ; AVX512VL-FAST-NEXT: retq
2166 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
2167 ret <8 x i32> %shuffle
2170 define <8 x i32> @shuffle_v8i32_3210ba98(<8 x i32> %a, <8 x i32> %b) {
2171 ; ALL-LABEL: shuffle_v8i32_3210ba98:
2173 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2174 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2176 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 11, i32 10, i32 9, i32 8>
2177 ret <8 x i32> %shuffle
2180 define <8 x i32> @shuffle_v8i32_3210fedc(<8 x i32> %a, <8 x i32> %b) {
2181 ; ALL-LABEL: shuffle_v8i32_3210fedc:
2183 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2184 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2186 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 15, i32 14, i32 13, i32 12>
2187 ret <8 x i32> %shuffle
2190 define <8 x i32> @shuffle_v8i32_7654fedc(<8 x i32> %a, <8 x i32> %b) {
2191 ; AVX1OR2-LABEL: shuffle_v8i32_7654fedc:
2193 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2194 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2195 ; AVX1OR2-NEXT: retq
2197 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_7654fedc:
2198 ; AVX512VL-SLOW: # %bb.0:
2199 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2200 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2201 ; AVX512VL-SLOW-NEXT: retq
2203 ; AVX512VL-FAST-LABEL: shuffle_v8i32_7654fedc:
2204 ; AVX512VL-FAST: # %bb.0:
2205 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
2206 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
2207 ; AVX512VL-FAST-NEXT: retq
2208 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 15, i32 14, i32 13, i32 12>
2209 ret <8 x i32> %shuffle
2212 define <8 x i32> @shuffle_v8i32_fedc7654(<8 x i32> %a, <8 x i32> %b) {
2213 ; AVX1OR2-LABEL: shuffle_v8i32_fedc7654:
2215 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
2216 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2217 ; AVX1OR2-NEXT: retq
2219 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_fedc7654:
2220 ; AVX512VL-SLOW: # %bb.0:
2221 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
2222 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2223 ; AVX512VL-SLOW-NEXT: retq
2225 ; AVX512VL-FAST-LABEL: shuffle_v8i32_fedc7654:
2226 ; AVX512VL-FAST: # %bb.0:
2227 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
2228 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2229 ; AVX512VL-FAST-NEXT: vmovdqa %ymm2, %ymm0
2230 ; AVX512VL-FAST-NEXT: retq
2231 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 15, i32 14, i32 13, i32 12, i32 7, i32 6, i32 5, i32 4>
2232 ret <8 x i32> %shuffle
2235 define <8 x i32> @shuffle_v8i32_ba987654(<8 x i32> %a, <8 x i32> %b) {
2236 ; ALL-LABEL: shuffle_v8i32_ba987654:
2238 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2239 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2241 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4>
2242 ret <8 x i32> %shuffle
2245 define <8 x i32> @shuffle_v8i32_ba983210(<8 x i32> %a, <8 x i32> %b) {
2246 ; ALL-LABEL: shuffle_v8i32_ba983210:
2248 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2249 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2251 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4>
2252 ret <8 x i32> %shuffle
2255 define <8 x i32> @shuffle_v8i32_zuu8zuuc(<8 x i32> %a) {
2256 ; AVX1-LABEL: shuffle_v8i32_zuu8zuuc:
2258 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2259 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,0],ymm1[4,5],ymm0[6,4]
2262 ; AVX2OR512VL-LABEL: shuffle_v8i32_zuu8zuuc:
2263 ; AVX2OR512VL: # %bb.0:
2264 ; AVX2OR512VL-NEXT: vpslldq {{.*#+}} ymm0 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19]
2265 ; AVX2OR512VL-NEXT: retq
2266 %shuffle = shufflevector <8 x i32> zeroinitializer, <8 x i32> %a, <8 x i32> <i32 0, i32 undef, i32 undef, i32 8, i32 0, i32 undef, i32 undef, i32 12>
2267 ret <8 x i32> %shuffle
2270 define <8 x i32> @shuffle_v8i32_9ubzdefz(<8 x i32> %a) {
2271 ; AVX1-LABEL: shuffle_v8i32_9ubzdefz:
2273 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2274 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[3,0],ymm0[3,0],ymm1[7,4],ymm0[7,4]
2275 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2278 ; AVX2OR512VL-LABEL: shuffle_v8i32_9ubzdefz:
2279 ; AVX2OR512VL: # %bb.0:
2280 ; AVX2OR512VL-NEXT: vpsrldq {{.*#+}} ymm0 = ymm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero,ymm0[20,21,22,23,24,25,26,27,28,29,30,31],zero,zero,zero,zero
2281 ; AVX2OR512VL-NEXT: retq
2282 %shuffle = shufflevector <8 x i32> zeroinitializer, <8 x i32> %a, <8 x i32> <i32 9, i32 undef, i32 11, i32 0, i32 13, i32 14, i32 15, i32 0>
2283 ret <8 x i32> %shuffle
2286 define <8 x i32> @shuffle_v8i32_80u1b4uu(<8 x i32> %a, <8 x i32> %b) {
2287 ; ALL-LABEL: shuffle_v8i32_80u1b4uu:
2289 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[1],ymm0[1],ymm1[4],ymm0[4],ymm1[5],ymm0[5]
2291 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 8, i32 0, i32 undef, i32 1, i32 12, i32 4, i32 undef, i32 undef>
2292 ret <8 x i32> %shuffle
2295 define <8 x i32> @shuffle_v8i32_uuuu1111(<8 x i32> %a, <8 x i32> %b) {
2296 ; ALL-LABEL: shuffle_v8i32_uuuu1111:
2298 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
2299 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2301 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 1, i32 1, i32 1, i32 1>
2302 ret <8 x i32> %shuffle
2305 define <8 x i32> @shuffle_v8i32_2222uuuu(<8 x i32> %a, <8 x i32> %b) {
2306 ; ALL-LABEL: shuffle_v8i32_2222uuuu:
2308 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,2,2]
2310 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 2, i32 2, i32 2, i32 2, i32 undef, i32 undef, i32 undef, i32 undef>
2311 ret <8 x i32> %shuffle
2314 define <8 x i32> @shuffle_v8i32_2A3Buuuu(<8 x i32> %a, <8 x i32> %b) {
2315 ; ALL-LABEL: shuffle_v8i32_2A3Buuuu:
2317 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2319 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 undef, i32 undef, i32 undef, i32 undef>
2320 ret <8 x i32> %shuffle
2323 define <8 x i32> @shuffle_v8i32_44444444(<8 x i32> %a, <8 x i32> %b) {
2324 ; AVX1-LABEL: shuffle_v8i32_44444444:
2326 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,0,4,4,4,4]
2327 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2330 ; AVX2OR512VL-LABEL: shuffle_v8i32_44444444:
2331 ; AVX2OR512VL: # %bb.0:
2332 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
2333 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2334 ; AVX2OR512VL-NEXT: retq
2335 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>
2336 ret <8 x i32> %shuffle
2339 define <8 x i32> @shuffle_v8i32_44444444_bc(<8 x float> %a, <8 x float> %b) {
2340 ; AVX1-LABEL: shuffle_v8i32_44444444_bc:
2342 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,0,4,4,4,4]
2343 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2346 ; AVX2OR512VL-LABEL: shuffle_v8i32_44444444_bc:
2347 ; AVX2OR512VL: # %bb.0:
2348 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
2349 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2350 ; AVX2OR512VL-NEXT: retq
2351 %tmp0 = bitcast <8 x float> %a to <8 x i32>
2352 %tmp1 = bitcast <8 x float> %b to <8 x i32>
2353 %shuffle = shufflevector <8 x i32> %tmp0, <8 x i32> %tmp1, <8 x i32> <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>
2354 ret <8 x i32> %shuffle
2357 define <8 x i32> @shuffle_v8i32_5555uuuu(<8 x i32> %a, <8 x i32> %b) {
2358 ; ALL-LABEL: shuffle_v8i32_5555uuuu:
2360 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0
2361 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
2363 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 5, i32 5, i32 5, i32 5, i32 undef, i32 undef, i32 undef, i32 undef>
2364 ret <8 x i32> %shuffle
2367 define <8 x i32> @shuffle_v8i32_0dcd3f14(<8 x i32> %a, <8 x i32> %b) {
2368 ; AVX1-LABEL: shuffle_v8i32_0dcd3f14:
2370 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
2371 ; AVX1-NEXT: vblendps {{.*#+}} xmm2 = xmm2[0],xmm0[1,2,3]
2372 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm2[3,1,1,0]
2373 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
2374 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm1[2,3,2,3]
2375 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,3,2]
2376 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5],ymm0[6,7]
2379 ; AVX2-LABEL: shuffle_v8i32_0dcd3f14:
2381 ; AVX2-NEXT: vmovaps {{.*#+}} ymm2 = <0,u,u,u,3,u,1,4>
2382 ; AVX2-NEXT: vpermps %ymm0, %ymm2, %ymm0
2383 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,2,3,3]
2384 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5],ymm0[6,7]
2387 ; AVX512VL-LABEL: shuffle_v8i32_0dcd3f14:
2388 ; AVX512VL: # %bb.0:
2389 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,5,4,5,11,7,9,12]
2390 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2391 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
2392 ; AVX512VL-NEXT: retq
2393 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 13, i32 12, i32 13, i32 3, i32 15, i32 1, i32 4>
2394 ret <8 x i32> %shuffle
2398 define <8 x i32> @shuffle_v8i32_uuuuuu7u(<8 x i32> %a, <8 x i32> %b) nounwind {
2399 ; AVX1-LABEL: shuffle_v8i32_uuuuuu7u:
2401 ; AVX1-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
2404 ; AVX2OR512VL-LABEL: shuffle_v8i32_uuuuuu7u:
2405 ; AVX2OR512VL: # %bb.0:
2406 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,3,3,4,5,7,7]
2407 ; AVX2OR512VL-NEXT: retq
2408 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 7, i32 undef>
2409 ret <8 x i32> %shuffle
2412 define <8 x float> @splat_mem_v8f32_2(float* %p) {
2413 ; ALL-LABEL: splat_mem_v8f32_2:
2415 ; ALL-NEXT: vbroadcastss (%rdi), %ymm0
2417 %1 = load float, float* %p
2418 %2 = insertelement <4 x float> undef, float %1, i32 0
2419 %3 = shufflevector <4 x float> %2, <4 x float> undef, <8 x i32> zeroinitializer
2423 define <8 x float> @splat_v8f32(<4 x float> %r) {
2424 ; AVX1-LABEL: splat_v8f32:
2426 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
2427 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2430 ; AVX2OR512VL-LABEL: splat_v8f32:
2431 ; AVX2OR512VL: # %bb.0:
2432 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2433 ; AVX2OR512VL-NEXT: retq
2434 %1 = shufflevector <4 x float> %r, <4 x float> undef, <8 x i32> zeroinitializer
2439 ; Shuffle to logical bit shifts
2442 define <8 x i32> @shuffle_v8i32_z0U2zUz6(<8 x i32> %a) {
2443 ; AVX1-LABEL: shuffle_v8i32_z0U2zUz6:
2445 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2446 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2447 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,0,3,1,6,4,7,5]
2450 ; AVX2OR512VL-LABEL: shuffle_v8i32_z0U2zUz6:
2451 ; AVX2OR512VL: # %bb.0:
2452 ; AVX2OR512VL-NEXT: vpsllq $32, %ymm0, %ymm0
2453 ; AVX2OR512VL-NEXT: retq
2454 %shuffle = shufflevector <8 x i32> %a, <8 x i32> zeroinitializer, <8 x i32> <i32 8, i32 0, i32 undef, i32 2, i32 8, i32 undef, i32 8, i32 6>
2455 ret <8 x i32> %shuffle
2458 define <8 x i32> @shuffle_v8i32_1U3z5zUU(<8 x i32> %a) {
2459 ; AVX1-LABEL: shuffle_v8i32_1U3z5zUU:
2461 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2462 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2463 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
2466 ; AVX2OR512VL-LABEL: shuffle_v8i32_1U3z5zUU:
2467 ; AVX2OR512VL: # %bb.0:
2468 ; AVX2OR512VL-NEXT: vpsrlq $32, %ymm0, %ymm0
2469 ; AVX2OR512VL-NEXT: retq
2470 %shuffle = shufflevector <8 x i32> %a, <8 x i32> zeroinitializer, <8 x i32> <i32 1, i32 undef, i32 3, i32 8, i32 5, i32 8, i32 undef, i32 undef>
2471 ret <8 x i32> %shuffle
2474 define <8 x i32> @shuffle_v8i32_B012F456(<8 x i32> %a, <8 x i32> %b) {
2475 ; AVX1-LABEL: shuffle_v8i32_B012F456:
2477 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[3,0],ymm0[0,0],ymm1[7,4],ymm0[4,4]
2478 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,2],ymm0[1,2],ymm1[4,6],ymm0[5,6]
2481 ; AVX2OR512VL-LABEL: shuffle_v8i32_B012F456:
2482 ; AVX2OR512VL: # %bb.0:
2483 ; AVX2OR512VL-NEXT: vpalignr {{.*#+}} ymm0 = ymm1[12,13,14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11],ymm1[28,29,30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27]
2484 ; AVX2OR512VL-NEXT: retq
2485 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 11, i32 0, i32 1, i32 2, i32 15, i32 4, i32 5, i32 6>
2486 ret <8 x i32> %shuffle
2489 define <8 x i32> @shuffle_v8i32_1238567C(<8 x i32> %a, <8 x i32> %b) {
2490 ; AVX1-LABEL: shuffle_v8i32_1238567C:
2492 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2493 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2496 ; AVX2OR512VL-LABEL: shuffle_v8i32_1238567C:
2497 ; AVX2OR512VL: # %bb.0:
2498 ; AVX2OR512VL-NEXT: vpalignr {{.*#+}} ymm0 = ymm0[4,5,6,7,8,9,10,11,12,13,14,15],ymm1[0,1,2,3],ymm0[20,21,22,23,24,25,26,27,28,29,30,31],ymm1[16,17,18,19]
2499 ; AVX2OR512VL-NEXT: retq
2500 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 2, i32 3, i32 8, i32 5, i32 6, i32 7, i32 12>
2501 ret <8 x i32> %shuffle
2504 define <8 x i32> @shuffle_v8i32_9AB0DEF4(<8 x i32> %a, <8 x i32> %b) {
2505 ; AVX1-LABEL: shuffle_v8i32_9AB0DEF4:
2507 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[3,0],ymm0[4,4],ymm1[7,4]
2508 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,2],ymm0[2,0],ymm1[5,6],ymm0[6,4]
2511 ; AVX2OR512VL-LABEL: shuffle_v8i32_9AB0DEF4:
2512 ; AVX2OR512VL: # %bb.0:
2513 ; AVX2OR512VL-NEXT: vpalignr {{.*#+}} ymm0 = ymm1[4,5,6,7,8,9,10,11,12,13,14,15],ymm0[0,1,2,3],ymm1[20,21,22,23,24,25,26,27,28,29,30,31],ymm0[16,17,18,19]
2514 ; AVX2OR512VL-NEXT: retq
2515 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 9, i32 10, i32 11, i32 0, i32 13, i32 14, i32 15, i32 4>
2516 ret <8 x i32> %shuffle
2519 define <8 x i32> @shuffle_v8i32_389A7CDE(<8 x i32> %a, <8 x i32> %b) {
2520 ; AVX1-LABEL: shuffle_v8i32_389A7CDE:
2522 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[3,0],ymm1[0,0],ymm0[7,4],ymm1[4,4]
2523 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,2],ymm1[1,2],ymm0[4,6],ymm1[5,6]
2526 ; AVX2OR512VL-LABEL: shuffle_v8i32_389A7CDE:
2527 ; AVX2OR512VL: # %bb.0:
2528 ; AVX2OR512VL-NEXT: vpalignr {{.*#+}} ymm0 = ymm0[12,13,14,15],ymm1[0,1,2,3,4,5,6,7,8,9,10,11],ymm0[28,29,30,31],ymm1[16,17,18,19,20,21,22,23,24,25,26,27]
2529 ; AVX2OR512VL-NEXT: retq
2530 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 8, i32 9, i32 10, i32 7, i32 12, i32 13, i32 14>
2531 ret <8 x i32> %shuffle
2534 define <8 x i32> @shuffle_v8i32_30127456(<8 x i32> %a, <8 x i32> %b) {
2535 ; ALL-LABEL: shuffle_v8i32_30127456:
2537 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,0,1,2,7,4,5,6]
2539 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 3, i32 0, i32 1, i32 2, i32 7, i32 4, i32 5, i32 6>
2540 ret <8 x i32> %shuffle
2543 define <8 x i32> @shuffle_v8i32_12305674(<8 x i32> %a, <8 x i32> %b) {
2544 ; ALL-LABEL: shuffle_v8i32_12305674:
2546 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,2,3,0,5,6,7,4]
2548 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 2, i32 3, i32 0, i32 5, i32 6, i32 7, i32 4>
2549 ret <8 x i32> %shuffle
2552 define <8x float> @concat_v2f32_1(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2553 ; ALL-LABEL: concat_v2f32_1:
2554 ; ALL: # %bb.0: # %entry
2555 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2556 ; ALL-NEXT: vmovhpd {{.*#+}} xmm0 = xmm0[0],mem[0]
2559 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2560 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2561 %tmp73 = shufflevector <2 x float> %tmp72, <2 x float> undef, <8 x i32> <i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
2562 %tmp75 = shufflevector <2 x float> %tmp74, <2 x float> undef, <8 x i32> <i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
2563 %tmp76 = shufflevector <8 x float> %tmp73, <8 x float> %tmp75, <8 x i32> <i32 0, i32 1, i32 8, i32 9, i32 undef, i32 undef, i32 undef, i32 undef>
2564 ret <8 x float> %tmp76
2567 define <8x float> @concat_v2f32_2(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2568 ; ALL-LABEL: concat_v2f32_2:
2569 ; ALL: # %bb.0: # %entry
2570 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2571 ; ALL-NEXT: vmovhpd {{.*#+}} xmm0 = xmm0[0],mem[0]
2574 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2575 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2576 %tmp76 = shufflevector <2 x float> %tmp72, <2 x float> %tmp74, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
2577 ret <8 x float> %tmp76
2580 define <8x float> @concat_v2f32_3(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2581 ; ALL-LABEL: concat_v2f32_3:
2582 ; ALL: # %bb.0: # %entry
2583 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2584 ; ALL-NEXT: vmovhpd {{.*#+}} xmm0 = xmm0[0],mem[0]
2587 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2588 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2589 %tmp76 = shufflevector <2 x float> %tmp72, <2 x float> %tmp74, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2590 %res = shufflevector <4 x float> %tmp76, <4 x float> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
2591 ret <8 x float> %res
2594 define <8 x i32> @insert_mem_and_zero_v8i32(i32* %ptr) {
2595 ; ALL-LABEL: insert_mem_and_zero_v8i32:
2597 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
2599 %a = load i32, i32* %ptr
2600 %v = insertelement <8 x i32> undef, i32 %a, i32 0
2601 %shuffle = shufflevector <8 x i32> %v, <8 x i32> zeroinitializer, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
2602 ret <8 x i32> %shuffle
2605 define <8 x i32> @concat_v8i32_0123CDEF(<8 x i32> %a, <8 x i32> %b) {
2606 ; ALL-LABEL: concat_v8i32_0123CDEF:
2608 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2610 %alo = shufflevector <8 x i32> %a, <8 x i32> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2611 %bhi = shufflevector <8 x i32> %b, <8 x i32> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2612 %shuf = shufflevector <4 x i32> %alo, <4 x i32> %bhi, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
2616 define <8 x i32> @concat_v8i32_4567CDEF_bc(<8 x i32> %a0, <8 x i32> %a1) {
2617 ; AVX1OR2-LABEL: concat_v8i32_4567CDEF_bc:
2619 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2620 ; AVX1OR2-NEXT: retq
2622 ; AVX512VL-LABEL: concat_v8i32_4567CDEF_bc:
2623 ; AVX512VL: # %bb.0:
2624 ; AVX512VL-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2625 ; AVX512VL-NEXT: retq
2626 %a0hi = shufflevector <8 x i32> %a0, <8 x i32> %a1, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2627 %a1hi = shufflevector <8 x i32> %a0, <8 x i32> %a1, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
2628 %bc0hi = bitcast <4 x i32> %a0hi to <2 x i64>
2629 %bc1hi = bitcast <4 x i32> %a1hi to <2 x i64>
2630 %shuffle64 = shufflevector <2 x i64> %bc0hi, <2 x i64> %bc1hi, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2631 %shuffle32 = bitcast <4 x i64> %shuffle64 to <8 x i32>
2632 ret <8 x i32> %shuffle32
2635 define <8 x float> @concat_v8f32_4567CDEF_bc(<8 x float> %f0, <8 x float> %f1) {
2636 ; ALL-LABEL: concat_v8f32_4567CDEF_bc:
2638 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2640 %a0 = bitcast <8 x float> %f0 to <4 x i64>
2641 %a1 = bitcast <8 x float> %f1 to <8 x i32>
2642 %a0hi = shufflevector <4 x i64> %a0, <4 x i64> undef, <2 x i32> <i32 2, i32 3>
2643 %a1hi = shufflevector <8 x i32> %a1, <8 x i32> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2644 %bc0hi = bitcast <2 x i64> %a0hi to <2 x i64>
2645 %bc1hi = bitcast <4 x i32> %a1hi to <2 x i64>
2646 %shuffle64 = shufflevector <2 x i64> %bc0hi, <2 x i64> %bc1hi, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2647 %shuffle32 = bitcast <4 x i64> %shuffle64 to <8 x float>
2648 ret <8 x float> %shuffle32
2651 define <8 x i32> @insert_dup_mem_v8i32(i32* %ptr) {
2652 ; ALL-LABEL: insert_dup_mem_v8i32:
2654 ; ALL-NEXT: vbroadcastss (%rdi), %ymm0
2656 %tmp = load i32, i32* %ptr, align 4
2657 %tmp1 = insertelement <4 x i32> zeroinitializer, i32 %tmp, i32 0
2658 %tmp2 = shufflevector <4 x i32> %tmp1, <4 x i32> undef, <8 x i32> zeroinitializer
2662 define <8 x i32> @shuffle_v8i32_12345678(<8 x i32> %a, <8 x i32> %b) {
2663 ; AVX1-LABEL: shuffle_v8i32_12345678:
2665 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
2666 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2667 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2670 ; AVX2-LABEL: shuffle_v8i32_12345678:
2672 ; AVX2-NEXT: vperm2i128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
2673 ; AVX2-NEXT: vpalignr {{.*#+}} ymm0 = ymm0[4,5,6,7,8,9,10,11,12,13,14,15],ymm1[0,1,2,3],ymm0[20,21,22,23,24,25,26,27,28,29,30,31],ymm1[16,17,18,19]
2676 ; AVX512VL-LABEL: shuffle_v8i32_12345678:
2677 ; AVX512VL: # %bb.0:
2678 ; AVX512VL-NEXT: valignd {{.*#+}} ymm0 = ymm0[1,2,3,4,5,6,7],ymm1[0]
2679 ; AVX512VL-NEXT: retq
2680 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
2681 ret <8 x i32> %shuffle
2684 define <8 x i32> @shuffle_v8i32_12345670(<8 x i32> %a) {
2685 ; AVX1-LABEL: shuffle_v8i32_12345670:
2687 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
2688 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2689 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2692 ; AVX2-LABEL: shuffle_v8i32_12345670:
2694 ; AVX2-NEXT: vmovaps {{.*#+}} ymm1 = [1,2,3,4,5,6,7,0]
2695 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
2698 ; AVX512VL-LABEL: shuffle_v8i32_12345670:
2699 ; AVX512VL: # %bb.0:
2700 ; AVX512VL-NEXT: valignd {{.*#+}} ymm0 = ymm0[1,2,3,4,5,6,7,0]
2701 ; AVX512VL-NEXT: retq
2702 %shuffle = shufflevector <8 x i32> %a, <8 x i32> undef, <8 x i32> <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0>
2703 ret <8 x i32> %shuffle
2706 define <8 x float> @add_v8f32_02468ACE_13579BDF(<8 x float> %a, <8 x float> %b) {
2707 ; AVX1-LABEL: add_v8f32_02468ACE_13579BDF:
2708 ; AVX1: # %bb.0: # %entry
2709 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
2710 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2711 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
2712 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
2713 ; AVX1-NEXT: vaddps %ymm0, %ymm1, %ymm0
2716 ; AVX2-LABEL: add_v8f32_02468ACE_13579BDF:
2717 ; AVX2: # %bb.0: # %entry
2718 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2719 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2720 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2721 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2722 ; AVX2-NEXT: vaddps %ymm0, %ymm2, %ymm0
2725 ; AVX512VL-SLOW-LABEL: add_v8f32_02468ACE_13579BDF:
2726 ; AVX512VL-SLOW: # %bb.0: # %entry
2727 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2728 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2729 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2730 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2731 ; AVX512VL-SLOW-NEXT: vaddps %ymm0, %ymm2, %ymm0
2732 ; AVX512VL-SLOW-NEXT: retq
2734 ; AVX512VL-FAST-LABEL: add_v8f32_02468ACE_13579BDF:
2735 ; AVX512VL-FAST: # %bb.0: # %entry
2736 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2737 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm1, %ymm0, %ymm2
2738 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2739 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm1, %ymm0, %ymm3
2740 ; AVX512VL-FAST-NEXT: vaddps %ymm3, %ymm2, %ymm0
2741 ; AVX512VL-FAST-NEXT: retq
2743 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
2744 %shuffle1 = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
2745 %add = fadd <8 x float> %shuffle, %shuffle1
2746 ret <8 x float> %add
2749 define <8 x float> @add_v8f32_8ACE0246_9BDF1357(<8 x float> %a, <8 x float> %b) {
2750 ; AVX1-LABEL: add_v8f32_8ACE0246_9BDF1357:
2751 ; AVX1: # %bb.0: # %entry
2752 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
2753 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2754 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
2755 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
2756 ; AVX1-NEXT: vaddps %ymm0, %ymm1, %ymm0
2759 ; AVX2-LABEL: add_v8f32_8ACE0246_9BDF1357:
2760 ; AVX2: # %bb.0: # %entry
2761 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2762 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2763 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2764 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2765 ; AVX2-NEXT: vaddps %ymm0, %ymm2, %ymm0
2768 ; AVX512VL-SLOW-LABEL: add_v8f32_8ACE0246_9BDF1357:
2769 ; AVX512VL-SLOW: # %bb.0: # %entry
2770 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2771 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2772 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2773 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2774 ; AVX512VL-SLOW-NEXT: vaddps %ymm0, %ymm2, %ymm0
2775 ; AVX512VL-SLOW-NEXT: retq
2777 ; AVX512VL-FAST-LABEL: add_v8f32_8ACE0246_9BDF1357:
2778 ; AVX512VL-FAST: # %bb.0: # %entry
2779 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2780 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
2781 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2782 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm3
2783 ; AVX512VL-FAST-NEXT: vaddps %ymm3, %ymm2, %ymm0
2784 ; AVX512VL-FAST-NEXT: retq
2786 %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 8, i32 10, i32 12, i32 14, i32 0, i32 2, i32 4, i32 6>
2787 %shuffle1 = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 9, i32 11, i32 13, i32 15, i32 1, i32 3, i32 5, i32 7>
2788 %add = fadd <8 x float> %shuffle, %shuffle1
2789 ret <8 x float> %add
2792 define <8 x i32> @add_v8i32_02468ACE_13579BDF(<8 x i32> %a, <8 x i32> %b) {
2793 ; AVX1-LABEL: add_v8i32_02468ACE_13579BDF:
2794 ; AVX1: # %bb.0: # %entry
2795 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
2796 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2797 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
2798 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
2799 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
2800 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
2801 ; AVX1-NEXT: vpaddd %xmm2, %xmm3, %xmm2
2802 ; AVX1-NEXT: vpaddd %xmm0, %xmm1, %xmm0
2803 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
2806 ; AVX2-LABEL: add_v8i32_02468ACE_13579BDF:
2807 ; AVX2: # %bb.0: # %entry
2808 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2809 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2810 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2811 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2812 ; AVX2-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2815 ; AVX512VL-SLOW-LABEL: add_v8i32_02468ACE_13579BDF:
2816 ; AVX512VL-SLOW: # %bb.0: # %entry
2817 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2818 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2819 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2820 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2821 ; AVX512VL-SLOW-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2822 ; AVX512VL-SLOW-NEXT: retq
2824 ; AVX512VL-FAST-LABEL: add_v8i32_02468ACE_13579BDF:
2825 ; AVX512VL-FAST: # %bb.0: # %entry
2826 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2827 ; AVX512VL-FAST-NEXT: vpermi2d %ymm1, %ymm0, %ymm2
2828 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2829 ; AVX512VL-FAST-NEXT: vpermi2d %ymm1, %ymm0, %ymm3
2830 ; AVX512VL-FAST-NEXT: vpaddd %ymm3, %ymm2, %ymm0
2831 ; AVX512VL-FAST-NEXT: retq
2833 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
2834 %shuffle1 = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
2835 %add = add <8 x i32> %shuffle, %shuffle1
2839 define <8 x i32> @add_v8i32_8ACE0246_9BDF1357(<8 x i32> %a, <8 x i32> %b) {
2840 ; AVX1-LABEL: add_v8i32_8ACE0246_9BDF1357:
2841 ; AVX1: # %bb.0: # %entry
2842 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
2843 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2844 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
2845 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
2846 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
2847 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
2848 ; AVX1-NEXT: vpaddd %xmm2, %xmm3, %xmm2
2849 ; AVX1-NEXT: vpaddd %xmm0, %xmm1, %xmm0
2850 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
2853 ; AVX2-LABEL: add_v8i32_8ACE0246_9BDF1357:
2854 ; AVX2: # %bb.0: # %entry
2855 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2856 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2857 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2858 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2859 ; AVX2-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2862 ; AVX512VL-SLOW-LABEL: add_v8i32_8ACE0246_9BDF1357:
2863 ; AVX512VL-SLOW: # %bb.0: # %entry
2864 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2865 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2866 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2867 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2868 ; AVX512VL-SLOW-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2869 ; AVX512VL-SLOW-NEXT: retq
2871 ; AVX512VL-FAST-LABEL: add_v8i32_8ACE0246_9BDF1357:
2872 ; AVX512VL-FAST: # %bb.0: # %entry
2873 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2874 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2875 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2876 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm3
2877 ; AVX512VL-FAST-NEXT: vpaddd %ymm3, %ymm2, %ymm0
2878 ; AVX512VL-FAST-NEXT: retq
2880 %shuffle = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 8, i32 10, i32 12, i32 14, i32 0, i32 2, i32 4, i32 6>
2881 %shuffle1 = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> <i32 9, i32 11, i32 13, i32 15, i32 1, i32 3, i32 5, i32 7>
2882 %add = add <8 x i32> %shuffle, %shuffle1
2886 ; This test used to crash due to bad handling of concat_vectors after a bitcast
2887 ; in lowerVectorShuffleAsBroadcast.
2888 define <8 x float> @broadcast_concat_crash(<4 x float> %x, <4 x float> %y, float %z) {
2889 ; AVX1-LABEL: broadcast_concat_crash:
2890 ; AVX1: # %bb.0: # %entry
2891 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm1[3,3,1,1]
2892 ; AVX1-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
2893 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2896 ; AVX2OR512VL-LABEL: broadcast_concat_crash:
2897 ; AVX2OR512VL: # %bb.0: # %entry
2898 ; AVX2OR512VL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2899 ; AVX2OR512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,2,3]
2900 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,3,3]
2901 ; AVX2OR512VL-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
2902 ; AVX2OR512VL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2903 ; AVX2OR512VL-NEXT: retq
2905 %tmp = shufflevector <4 x float> %x, <4 x float> %y, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
2906 %bc = bitcast <8 x float> %tmp to <4 x i64>
2907 %tmp1 = extractelement <4 x i64> %bc, i32 3
2908 %tmp2 = bitcast i64 %tmp1 to <2 x float>
2909 %tmp4 = extractelement <2 x float> %tmp2, i32 1
2910 %tmp5 = insertelement <8 x float> undef, float %tmp4, i32 4
2911 %tmp6 = insertelement <8 x float> %tmp5, float %z, i32 5
2912 ret <8 x float> %tmp6
2915 ; PR40434: https://bugs.llvm.org/show_bug.cgi?id=40434
2917 define <8 x i32> @unpckh_v8i32(<8 x i32> %x, <8 x i32> %y) {
2918 ; ALL-LABEL: unpckh_v8i32:
2920 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
2921 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2923 %unpckh = shufflevector <8 x i32> %x, <8 x i32> %y, <8 x i32> <i32 2, i32 14, i32 3, i32 15, i32 undef, i32 undef, i32 undef, i32 undef>
2924 ret <8 x i32> %unpckh
2927 ; Same as above but with floats.
2929 define <8 x float> @unpckh_v8f32(<8 x float> %x, <8 x float> %y) {
2930 ; ALL-LABEL: unpckh_v8f32:
2932 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
2933 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2935 %unpckh = shufflevector <8 x float> %x, <8 x float> %y, <8 x i32> <i32 2, i32 14, i32 3, i32 15, i32 undef, i32 undef, i32 undef, i32 undef>
2936 ret <8 x float> %unpckh
2939 ; Alternate form of the above - make sure we don't have conflicting transforms.
2941 define <8 x i32> @blend_perm_v8i32(<8 x i32> %x, <8 x i32> %y) {
2942 ; ALL-LABEL: blend_perm_v8i32:
2944 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
2945 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2947 %unpckh = shufflevector <8 x i32> %x, <8 x i32> %y, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 14, i32 15>
2948 %r = shufflevector <8 x i32> %unpckh, <8 x i32> undef, <8 x i32> <i32 2, i32 6, i32 3, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
2952 ; Same as above but with floats.
2954 define <8 x float> @blend_perm_v8f32(<8 x float> %x, <8 x float> %y) {
2955 ; ALL-LABEL: blend_perm_v8f32:
2957 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
2958 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2960 %unpckh = shufflevector <8 x float> %x, <8 x float> %y, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 14, i32 15>
2961 %r = shufflevector <8 x float> %unpckh, <8 x float> undef, <8 x i32> <i32 2, i32 6, i32 3, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
2965 ; Another variation of the above - make sure we don't have conflicting transforms.
2967 define <8 x i32> @unpckh_v8i32_unary(<8 x i32> %x) {
2968 ; ALL-LABEL: unpckh_v8i32_unary:
2970 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1
2971 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2973 %r = shufflevector <8 x i32> %x, <8 x i32> undef, <8 x i32> <i32 2, i32 6, i32 3, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
2977 ; Same as above but with floats.
2979 define <8 x float> @unpckh_v8f32_unary(<8 x float> %x) {
2980 ; ALL-LABEL: unpckh_v8f32_unary:
2982 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1
2983 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2985 %r = shufflevector <8 x float> %x, <8 x float> undef, <8 x i32> <i32 2, i32 6, i32 3, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
2989 ; FIXME: Why are integer and FP (below) lowering different for AVX1?
2991 define <8 x i32> @lowhalf_v8i32(<8 x i32> %x, <8 x i32> %y) {
2992 ; AVX1-LABEL: lowhalf_v8i32:
2994 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
2995 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm1[0,2,2,2]
2996 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,3,3]
2997 ; AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3]
3000 ; AVX2-LABEL: lowhalf_v8i32:
3002 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
3003 ; AVX2-NEXT: vmovaps {{.*#+}} ymm1 = <2,6,3,6,u,u,u,u>
3004 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
3007 ; AVX512VL-LABEL: lowhalf_v8i32:
3008 ; AVX512VL: # %bb.0:
3009 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = <2,14,3,14,u,u,u,u>
3010 ; AVX512VL-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
3011 ; AVX512VL-NEXT: retq
3012 %r = shufflevector <8 x i32> %x, <8 x i32> %y, <8 x i32> <i32 2, i32 14, i32 3, i32 14, i32 undef, i32 undef, i32 undef, i32 undef>
3016 ; FIXME: AVX1 lowering is better than AVX2 (and AVX512?)
3018 define <8 x float> @lowhalf_v8f32(<8 x float> %x, <8 x float> %y) {
3019 ; AVX1-LABEL: lowhalf_v8f32:
3021 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
3022 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[2,3],xmm1[2,2]
3023 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,1,3]
3026 ; AVX2-LABEL: lowhalf_v8f32:
3028 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
3029 ; AVX2-NEXT: vmovaps {{.*#+}} ymm1 = <2,6,3,6,u,u,u,u>
3030 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
3033 ; AVX512VL-LABEL: lowhalf_v8f32:
3034 ; AVX512VL: # %bb.0:
3035 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = <2,14,3,14,u,u,u,u>
3036 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
3037 ; AVX512VL-NEXT: retq
3038 %r = shufflevector <8 x float> %x, <8 x float> %y, <8 x i32> <i32 2, i32 14, i32 3, i32 14, i32 undef, i32 undef, i32 undef, i32 undef>