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 ; AVX1OR2-LABEL: shuffle_v8f32_08084c4c:
288 ; AVX1OR2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
289 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
292 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_08084c4c:
293 ; AVX512VL-SLOW: # %bb.0:
294 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
295 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
296 ; AVX512VL-SLOW-NEXT: retq
298 ; AVX512VL-FAST-LABEL: shuffle_v8f32_08084c4c:
299 ; AVX512VL-FAST: # %bb.0:
300 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,8,0,8,4,12,4,12]
301 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
302 ; AVX512VL-FAST-NEXT: retq
303 %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>
304 ret <8 x float> %shuffle
307 define <8 x float> @shuffle_v8f32_8823cc67(<8 x float> %a, <8 x float> %b) {
308 ; ALL-LABEL: shuffle_v8f32_8823cc67:
310 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,0],ymm0[2,3],ymm1[4,4],ymm0[6,7]
312 %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>
313 ret <8 x float> %shuffle
316 define <8 x float> @shuffle_v8f32_9832dc76(<8 x float> %a, <8 x float> %b) {
317 ; ALL-LABEL: shuffle_v8f32_9832dc76:
319 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[3,2],ymm1[5,4],ymm0[7,6]
321 %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>
322 ret <8 x float> %shuffle
325 define <8 x float> @shuffle_v8f32_9810dc54(<8 x float> %a, <8 x float> %b) {
326 ; ALL-LABEL: shuffle_v8f32_9810dc54:
328 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[1,0],ymm1[5,4],ymm0[5,4]
330 %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>
331 ret <8 x float> %shuffle
334 define <8 x float> @shuffle_v8f32_08194c5d(<8 x float> %a, <8 x float> %b) {
335 ; ALL-LABEL: shuffle_v8f32_08194c5d:
337 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
339 %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>
340 ret <8 x float> %shuffle
343 define <8 x float> @shuffle_v8f32_2a3b6e7f(<8 x float> %a, <8 x float> %b) {
344 ; ALL-LABEL: shuffle_v8f32_2a3b6e7f:
346 ; ALL-NEXT: vunpckhps {{.*#+}} ymm0 = ymm0[2],ymm1[2],ymm0[3],ymm1[3],ymm0[6],ymm1[6],ymm0[7],ymm1[7]
348 %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>
349 ret <8 x float> %shuffle
352 define <8 x float> @shuffle_v8f32_08192a3b(<8 x float> %a, <8 x float> %b) {
353 ; AVX1OR2-LABEL: shuffle_v8f32_08192a3b:
355 ; AVX1OR2-NEXT: vunpckhps {{.*#+}} xmm2 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
356 ; AVX1OR2-NEXT: vunpcklps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
357 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
360 ; AVX512VL-LABEL: shuffle_v8f32_08192a3b:
362 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [0,8,1,9,2,10,3,11]
363 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
364 ; AVX512VL-NEXT: retq
365 %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>
366 ret <8 x float> %shuffle
369 define <8 x float> @shuffle_v8f32_08991abb(<8 x float> %a, <8 x float> %b) {
370 ; AVX1-LABEL: shuffle_v8f32_08991abb:
372 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm0[0,0],xmm1[0,0]
373 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm2[0,2],xmm1[1,1]
374 ; AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3]
375 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,2,3,3]
376 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
379 ; AVX2-SLOW-LABEL: shuffle_v8f32_08991abb:
380 ; AVX2-SLOW: # %bb.0:
381 ; AVX2-SLOW-NEXT: vmovaps {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
382 ; AVX2-SLOW-NEXT: vpermps %ymm1, %ymm2, %ymm1
383 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,1,3]
384 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
385 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
386 ; AVX2-SLOW-NEXT: retq
388 ; AVX2-FAST-LABEL: shuffle_v8f32_08991abb:
389 ; AVX2-FAST: # %bb.0:
390 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <0,1,1,3,1,3,u,u>
391 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
392 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
393 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
394 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
395 ; AVX2-FAST-NEXT: retq
397 ; AVX512VL-LABEL: shuffle_v8f32_08991abb:
399 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [8,0,1,1,9,2,3,3]
400 ; AVX512VL-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
401 ; AVX512VL-NEXT: vmovaps %ymm2, %ymm0
402 ; AVX512VL-NEXT: retq
403 %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>
404 ret <8 x float> %shuffle
407 define <8 x float> @shuffle_v8f32_091b2d3f(<8 x float> %a, <8 x float> %b) {
408 ; AVX1-LABEL: shuffle_v8f32_091b2d3f:
410 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[0,1,1,3]
411 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,1,3,3]
412 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
413 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
416 ; AVX2-LABEL: shuffle_v8f32_091b2d3f:
418 ; AVX2-NEXT: vmovaps {{.*#+}} ymm2 = <0,u,1,u,2,u,3,u>
419 ; AVX2-NEXT: vpermps %ymm0, %ymm2, %ymm0
420 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
423 ; AVX512VL-LABEL: shuffle_v8f32_091b2d3f:
425 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [0,9,1,11,2,13,3,15]
426 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
427 ; AVX512VL-NEXT: retq
428 %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>
429 ret <8 x float> %shuffle
432 define <8 x float> @shuffle_v8f32_09ab1def(<8 x float> %a, <8 x float> %b) {
433 ; AVX1-LABEL: shuffle_v8f32_09ab1def:
435 ; AVX1-NEXT: vmovshdup {{.*#+}} xmm2 = xmm0[1,1,3,3]
436 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
437 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
440 ; AVX2-SLOW-LABEL: shuffle_v8f32_09ab1def:
441 ; AVX2-SLOW: # %bb.0:
442 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,1,3]
443 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
444 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
445 ; AVX2-SLOW-NEXT: retq
447 ; AVX2-FAST-LABEL: shuffle_v8f32_09ab1def:
448 ; AVX2-FAST: # %bb.0:
449 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <0,1,1,3,1,3,u,u>
450 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
451 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
452 ; AVX2-FAST-NEXT: retq
454 ; AVX512VL-LABEL: shuffle_v8f32_09ab1def:
456 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [8,1,2,3,9,5,6,7]
457 ; AVX512VL-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
458 ; AVX512VL-NEXT: vmovaps %ymm2, %ymm0
459 ; AVX512VL-NEXT: retq
460 %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>
461 ret <8 x float> %shuffle
464 define <8 x float> @shuffle_v8f32_00014445(<8 x float> %a, <8 x float> %b) {
465 ; ALL-LABEL: shuffle_v8f32_00014445:
467 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,4,4,4,5]
469 %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>
470 ret <8 x float> %shuffle
473 define <8 x float> @shuffle_v8f32_00204464(<8 x float> %a, <8 x float> %b) {
474 ; ALL-LABEL: shuffle_v8f32_00204464:
476 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,4,6,4]
478 %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>
479 ret <8 x float> %shuffle
482 define <8 x float> @shuffle_v8f32_03004744(<8 x float> %a, <8 x float> %b) {
483 ; ALL-LABEL: shuffle_v8f32_03004744:
485 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,7,4,4]
487 %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>
488 ret <8 x float> %shuffle
491 define <8 x float> @shuffle_v8f32_10005444(<8 x float> %a, <8 x float> %b) {
492 ; ALL-LABEL: shuffle_v8f32_10005444:
494 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,5,4,4,4]
496 %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>
497 ret <8 x float> %shuffle
500 define <8 x float> @shuffle_v8f32_22006644(<8 x float> %a, <8 x float> %b) {
501 ; ALL-LABEL: shuffle_v8f32_22006644:
503 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,6,4,4]
505 %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>
506 ret <8 x float> %shuffle
509 define <8 x float> @shuffle_v8f32_33307774(<8 x float> %a, <8 x float> %b) {
510 ; ALL-LABEL: shuffle_v8f32_33307774:
512 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,7,7,4]
514 %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>
515 ret <8 x float> %shuffle
518 define <8 x float> @shuffle_v8f32_32107654(<8 x float> %a, <8 x float> %b) {
519 ; ALL-LABEL: shuffle_v8f32_32107654:
521 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
523 %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>
524 ret <8 x float> %shuffle
527 define <8 x float> @shuffle_v8f32_00234467(<8 x float> %a, <8 x float> %b) {
528 ; ALL-LABEL: shuffle_v8f32_00234467:
530 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,4,4,6,7]
532 %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>
533 ret <8 x float> %shuffle
536 define <8 x float> @shuffle_v8f32_00224466(<8 x float> %a, <8 x float> %b) {
537 ; ALL-LABEL: shuffle_v8f32_00224466:
539 ; ALL-NEXT: vmovsldup {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
541 %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>
542 ret <8 x float> %shuffle
545 define <8 x float> @shuffle_v8f32_10325476(<8 x float> %a, <8 x float> %b) {
546 ; ALL-LABEL: shuffle_v8f32_10325476:
548 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,5,4,7,6]
550 %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>
551 ret <8 x float> %shuffle
554 define <8 x float> @shuffle_v8f32_11335577(<8 x float> %a, <8 x float> %b) {
555 ; ALL-LABEL: shuffle_v8f32_11335577:
557 ; ALL-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
559 %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>
560 ret <8 x float> %shuffle
563 define <8 x float> @shuffle_v8f32_10235467(<8 x float> %a, <8 x float> %b) {
564 ; ALL-LABEL: shuffle_v8f32_10235467:
566 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,3,5,4,6,7]
568 %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>
569 ret <8 x float> %shuffle
572 define <8 x float> @shuffle_v8f32_10225466(<8 x float> %a, <8 x float> %b) {
573 ; ALL-LABEL: shuffle_v8f32_10225466:
575 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,2,5,4,6,6]
577 %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>
578 ret <8 x float> %shuffle
581 define <8 x float> @shuffle_v8f32_00015444(<8 x float> %a, <8 x float> %b) {
582 ; ALL-LABEL: shuffle_v8f32_00015444:
584 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,5,4,4,4]
586 %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>
587 ret <8 x float> %shuffle
590 define <8 x float> @shuffle_v8f32_00204644(<8 x float> %a, <8 x float> %b) {
591 ; ALL-LABEL: shuffle_v8f32_00204644:
593 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,6,4,4]
595 %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>
596 ret <8 x float> %shuffle
599 define <8 x float> @shuffle_v8f32_03004474(<8 x float> %a, <8 x float> %b) {
600 ; ALL-LABEL: shuffle_v8f32_03004474:
602 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,4,7,4]
604 %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>
605 ret <8 x float> %shuffle
608 define <8 x float> @shuffle_v8f32_10004444(<8 x float> %a, <8 x float> %b) {
609 ; ALL-LABEL: shuffle_v8f32_10004444:
611 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,4,4,4,4]
613 %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>
614 ret <8 x float> %shuffle
617 define <8 x float> @shuffle_v8f32_22006446(<8 x float> %a, <8 x float> %b) {
618 ; ALL-LABEL: shuffle_v8f32_22006446:
620 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,4,4,6]
622 %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>
623 ret <8 x float> %shuffle
626 define <8 x float> @shuffle_v8f32_33307474(<8 x float> %a, <8 x float> %b) {
627 ; ALL-LABEL: shuffle_v8f32_33307474:
629 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,4,7,4]
631 %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>
632 ret <8 x float> %shuffle
635 define <8 x float> @shuffle_v8f32_32104567(<8 x float> %a, <8 x float> %b) {
636 ; ALL-LABEL: shuffle_v8f32_32104567:
638 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,4,5,6,7]
640 %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>
641 ret <8 x float> %shuffle
644 define <8 x float> @shuffle_v8f32_00236744(<8 x float> %a, <8 x float> %b) {
645 ; ALL-LABEL: shuffle_v8f32_00236744:
647 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,6,7,4,4]
649 %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>
650 ret <8 x float> %shuffle
653 define <8 x float> @shuffle_v8f32_00226644(<8 x float> %a, <8 x float> %b) {
654 ; ALL-LABEL: shuffle_v8f32_00226644:
656 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,6,6,4,4]
658 %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>
659 ret <8 x float> %shuffle
662 define <8 x float> @shuffle_v8f32_10324567(<8 x float> %a, <8 x float> %b) {
663 ; ALL-LABEL: shuffle_v8f32_10324567:
665 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,6,7]
667 %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>
668 ret <8 x float> %shuffle
671 define <8 x float> @shuffle_v8f32_11334567(<8 x float> %a, <8 x float> %b) {
672 ; ALL-LABEL: shuffle_v8f32_11334567:
674 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,4,5,6,7]
676 %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>
677 ret <8 x float> %shuffle
680 define <8 x float> @shuffle_v8f32_01235467(<8 x float> %a, <8 x float> %b) {
681 ; ALL-LABEL: shuffle_v8f32_01235467:
683 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,7]
685 %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>
686 ret <8 x float> %shuffle
689 define <8 x float> @shuffle_v8f32_01235466(<8 x float> %a, <8 x float> %b) {
690 ; ALL-LABEL: shuffle_v8f32_01235466:
692 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,6]
694 %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>
695 ret <8 x float> %shuffle
698 define <8 x float> @shuffle_v8f32_002u6u44(<8 x float> %a, <8 x float> %b) {
699 ; ALL-LABEL: shuffle_v8f32_002u6u44:
701 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,u,6,u,4,4]
703 %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>
704 ret <8 x float> %shuffle
707 define <8 x float> @shuffle_v8f32_00uu66uu(<8 x float> %a, <8 x float> %b) {
708 ; ALL-LABEL: shuffle_v8f32_00uu66uu:
710 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,u,u,6,6,u,u]
712 %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>
713 ret <8 x float> %shuffle
716 define <8 x float> @shuffle_v8f32_103245uu(<8 x float> %a, <8 x float> %b) {
717 ; ALL-LABEL: shuffle_v8f32_103245uu:
719 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,u,u]
721 %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>
722 ret <8 x float> %shuffle
725 define <8 x float> @shuffle_v8f32_1133uu67(<8 x float> %a, <8 x float> %b) {
726 ; ALL-LABEL: shuffle_v8f32_1133uu67:
728 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,u,u,6,7]
730 %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>
731 ret <8 x float> %shuffle
734 define <8 x float> @shuffle_v8f32_0uu354uu(<8 x float> %a, <8 x float> %b) {
735 ; ALL-LABEL: shuffle_v8f32_0uu354uu:
737 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,u,u,3,5,4,u,u]
739 %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>
740 ret <8 x float> %shuffle
743 define <8 x float> @shuffle_v8f32_uuu3uu66(<8 x float> %a, <8 x float> %b) {
744 ; ALL-LABEL: shuffle_v8f32_uuu3uu66:
746 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[u,u,u,3,u,u,6,6]
748 %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>
749 ret <8 x float> %shuffle
752 define <8 x float> @shuffle_v8f32_c348cda0(<8 x float> %a, <8 x float> %b) {
753 ; AVX1-LABEL: shuffle_v8f32_c348cda0:
755 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[0,1,0,1]
756 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm1[2,3,2,3]
757 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,1],ymm2[2,0],ymm1[4,5],ymm2[6,4]
758 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
759 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,3],ymm2[0,0],ymm0[4,7],ymm2[4,4]
760 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2],ymm1[3,4,5,6],ymm0[7]
763 ; AVX2-SLOW-LABEL: shuffle_v8f32_c348cda0:
764 ; AVX2-SLOW: # %bb.0:
765 ; AVX2-SLOW-NEXT: vbroadcastf128 {{.*#+}} ymm2 = [4,5,2,0,4,5,2,0]
766 ; AVX2-SLOW-NEXT: # ymm2 = mem[0,1,0,1]
767 ; AVX2-SLOW-NEXT: vpermps %ymm1, %ymm2, %ymm1
768 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,2,0,4,7,6,4]
769 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,2,1]
770 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2],ymm1[3,4,5,6],ymm0[7]
771 ; AVX2-SLOW-NEXT: retq
773 ; AVX2-FAST-LABEL: shuffle_v8f32_c348cda0:
774 ; AVX2-FAST: # %bb.0:
775 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,3,4,7,4,7,2,0]
776 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
777 ; AVX2-FAST-NEXT: vbroadcastf128 {{.*#+}} ymm2 = [4,5,2,0,4,5,2,0]
778 ; AVX2-FAST-NEXT: # ymm2 = mem[0,1,0,1]
779 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
780 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2],ymm1[3,4,5,6],ymm0[7]
781 ; AVX2-FAST-NEXT: retq
783 ; AVX512VL-LABEL: shuffle_v8f32_c348cda0:
785 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [4,11,12,0,4,5,2,8]
786 ; AVX512VL-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
787 ; AVX512VL-NEXT: vmovaps %ymm2, %ymm0
788 ; AVX512VL-NEXT: retq
789 %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>
790 ret <8 x float> %shuffle
793 define <8 x float> @shuffle_v8f32_f511235a(<8 x float> %a, <8 x float> %b) {
794 ; AVX1-LABEL: shuffle_v8f32_f511235a:
796 ; AVX1-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[3,1,2,2,7,5,6,6]
797 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm1[2,3,0,1]
798 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
799 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,1,1,4,5,5,5]
800 ; AVX1-NEXT: vshufpd {{.*#+}} ymm0 = ymm2[0],ymm0[1],ymm2[3],ymm0[3]
801 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5,6],ymm1[7]
804 ; AVX2-SLOW-LABEL: shuffle_v8f32_f511235a:
805 ; AVX2-SLOW: # %bb.0:
806 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[3,2,2,3,7,6,6,7]
807 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,1,2,0]
808 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,2,3,5,5,6,7]
809 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,0,1,2]
810 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5,6],ymm1[7]
811 ; AVX2-SLOW-NEXT: retq
813 ; AVX2-FAST-LABEL: shuffle_v8f32_f511235a:
814 ; AVX2-FAST: # %bb.0:
815 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [7,6,2,3,7,6,3,2]
816 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
817 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [5,5,1,1,2,3,5,5]
818 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
819 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5,6],ymm1[7]
820 ; AVX2-FAST-NEXT: retq
822 ; AVX512VL-LABEL: shuffle_v8f32_f511235a:
824 ; AVX512VL-NEXT: vmovaps {{.*#+}} ymm2 = [15,5,1,1,2,3,5,10]
825 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
826 ; AVX512VL-NEXT: retq
827 %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>
828 ret <8 x float> %shuffle
831 define <8 x float> @shuffle_v8f32_32103210(<8 x float> %a, <8 x float> %b) {
832 ; AVX1-LABEL: shuffle_v8f32_32103210:
834 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
835 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
838 ; AVX2-SLOW-LABEL: shuffle_v8f32_32103210:
839 ; AVX2-SLOW: # %bb.0:
840 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
841 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
842 ; AVX2-SLOW-NEXT: retq
844 ; AVX2-FAST-LABEL: shuffle_v8f32_32103210:
845 ; AVX2-FAST: # %bb.0:
846 ; AVX2-FAST-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
847 ; AVX2-FAST-NEXT: # ymm1 = mem[0,1,0,1]
848 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
849 ; AVX2-FAST-NEXT: retq
851 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_32103210:
852 ; AVX512VL-SLOW: # %bb.0:
853 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
854 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
855 ; AVX512VL-SLOW-NEXT: retq
857 ; AVX512VL-FAST-LABEL: shuffle_v8f32_32103210:
858 ; AVX512VL-FAST: # %bb.0:
859 ; AVX512VL-FAST-NEXT: vbroadcasti128 {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
860 ; AVX512VL-FAST-NEXT: # ymm1 = mem[0,1,0,1]
861 ; AVX512VL-FAST-NEXT: vpermd %ymm0, %ymm1, %ymm0
862 ; AVX512VL-FAST-NEXT: retq
863 %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>
864 ret <8 x float> %shuffle
867 define <8 x float> @shuffle_v8f32_76547654(<8 x float> %a, <8 x float> %b) {
868 ; AVX1-LABEL: shuffle_v8f32_76547654:
870 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
871 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
874 ; AVX2-SLOW-LABEL: shuffle_v8f32_76547654:
875 ; AVX2-SLOW: # %bb.0:
876 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
877 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
878 ; AVX2-SLOW-NEXT: retq
880 ; AVX2-FAST-LABEL: shuffle_v8f32_76547654:
881 ; AVX2-FAST: # %bb.0:
882 ; AVX2-FAST-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
883 ; AVX2-FAST-NEXT: # ymm1 = mem[0,1,0,1]
884 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
885 ; AVX2-FAST-NEXT: retq
887 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_76547654:
888 ; AVX512VL-SLOW: # %bb.0:
889 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
890 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
891 ; AVX512VL-SLOW-NEXT: retq
893 ; AVX512VL-FAST-LABEL: shuffle_v8f32_76547654:
894 ; AVX512VL-FAST: # %bb.0:
895 ; AVX512VL-FAST-NEXT: vbroadcasti128 {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
896 ; AVX512VL-FAST-NEXT: # ymm1 = mem[0,1,0,1]
897 ; AVX512VL-FAST-NEXT: vpermd %ymm0, %ymm1, %ymm0
898 ; AVX512VL-FAST-NEXT: retq
899 %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>
900 ret <8 x float> %shuffle
903 define <8 x float> @shuffle_v8f32_76543210(<8 x float> %a, <8 x float> %b) {
904 ; AVX1-LABEL: shuffle_v8f32_76543210:
906 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
907 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
910 ; AVX2-SLOW-LABEL: shuffle_v8f32_76543210:
911 ; AVX2-SLOW: # %bb.0:
912 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
913 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
914 ; AVX2-SLOW-NEXT: retq
916 ; AVX2-FAST-LABEL: shuffle_v8f32_76543210:
917 ; AVX2-FAST: # %bb.0:
918 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
919 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
920 ; AVX2-FAST-NEXT: retq
922 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_76543210:
923 ; AVX512VL-SLOW: # %bb.0:
924 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
925 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
926 ; AVX512VL-SLOW-NEXT: retq
928 ; AVX512VL-FAST-LABEL: shuffle_v8f32_76543210:
929 ; AVX512VL-FAST: # %bb.0:
930 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
931 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
932 ; AVX512VL-FAST-NEXT: retq
933 %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>
934 ret <8 x float> %shuffle
937 define <8 x float> @shuffle_v8f32_3210ba98(<8 x float> %a, <8 x float> %b) {
938 ; AVX1OR2-LABEL: shuffle_v8f32_3210ba98:
940 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
941 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
944 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_3210ba98:
945 ; AVX512VL-SLOW: # %bb.0:
946 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
947 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
948 ; AVX512VL-SLOW-NEXT: retq
950 ; AVX512VL-FAST-LABEL: shuffle_v8f32_3210ba98:
951 ; AVX512VL-FAST: # %bb.0:
952 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [3,2,1,0,11,10,9,8]
953 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
954 ; AVX512VL-FAST-NEXT: retq
955 %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>
956 ret <8 x float> %shuffle
959 define <8 x float> @shuffle_v8f32_3210fedc(<8 x float> %a, <8 x float> %b) {
960 ; AVX1OR2-LABEL: shuffle_v8f32_3210fedc:
962 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
963 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
966 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_3210fedc:
967 ; AVX512VL-SLOW: # %bb.0:
968 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
969 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
970 ; AVX512VL-SLOW-NEXT: retq
972 ; AVX512VL-FAST-LABEL: shuffle_v8f32_3210fedc:
973 ; AVX512VL-FAST: # %bb.0:
974 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
975 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
976 ; AVX512VL-FAST-NEXT: retq
977 %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>
978 ret <8 x float> %shuffle
981 define <8 x float> @shuffle_v8f32_7654fedc(<8 x float> %a, <8 x float> %b) {
982 ; AVX1OR2-LABEL: shuffle_v8f32_7654fedc:
984 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
985 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
988 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_7654fedc:
989 ; AVX512VL-SLOW: # %bb.0:
990 ; AVX512VL-SLOW-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
991 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
992 ; AVX512VL-SLOW-NEXT: retq
994 ; AVX512VL-FAST-LABEL: shuffle_v8f32_7654fedc:
995 ; AVX512VL-FAST: # %bb.0:
996 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
997 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
998 ; AVX512VL-FAST-NEXT: retq
999 %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>
1000 ret <8 x float> %shuffle
1003 define <8 x float> @shuffle_v8f32_fedc7654(<8 x float> %a, <8 x float> %b) {
1004 ; AVX1OR2-LABEL: shuffle_v8f32_fedc7654:
1006 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
1007 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1008 ; AVX1OR2-NEXT: retq
1010 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_fedc7654:
1011 ; AVX512VL-SLOW: # %bb.0:
1012 ; AVX512VL-SLOW-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
1013 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1014 ; AVX512VL-SLOW-NEXT: retq
1016 ; AVX512VL-FAST-LABEL: shuffle_v8f32_fedc7654:
1017 ; AVX512VL-FAST: # %bb.0:
1018 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
1019 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
1020 ; AVX512VL-FAST-NEXT: vmovaps %ymm2, %ymm0
1021 ; AVX512VL-FAST-NEXT: retq
1022 %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>
1023 ret <8 x float> %shuffle
1026 define <8 x float> @PR21138(<8 x float> %truc, <8 x float> %tchose) {
1027 ; AVX1-LABEL: PR21138:
1029 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
1030 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1031 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
1034 ; AVX2-LABEL: PR21138:
1036 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
1037 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1040 ; AVX512VL-SLOW-LABEL: PR21138:
1041 ; AVX512VL-SLOW: # %bb.0:
1042 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
1043 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1044 ; AVX512VL-SLOW-NEXT: retq
1046 ; AVX512VL-FAST-LABEL: PR21138:
1047 ; AVX512VL-FAST: # %bb.0:
1048 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [1,3,5,7,9,11,13,15]
1049 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
1050 ; AVX512VL-FAST-NEXT: retq
1051 %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>
1052 ret <8 x float> %shuffle
1055 define <8 x float> @shuffle_v8f32_ba987654(<8 x float> %a, <8 x float> %b) {
1056 ; AVX1OR2-LABEL: shuffle_v8f32_ba987654:
1058 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
1059 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1060 ; AVX1OR2-NEXT: retq
1062 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_ba987654:
1063 ; AVX512VL-SLOW: # %bb.0:
1064 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
1065 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1066 ; AVX512VL-SLOW-NEXT: retq
1068 ; AVX512VL-FAST-LABEL: shuffle_v8f32_ba987654:
1069 ; AVX512VL-FAST: # %bb.0:
1070 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
1071 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
1072 ; AVX512VL-FAST-NEXT: vmovaps %ymm2, %ymm0
1073 ; AVX512VL-FAST-NEXT: retq
1074 %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>
1075 ret <8 x float> %shuffle
1078 define <8 x float> @shuffle_v8f32_ba983210(<8 x float> %a, <8 x float> %b) {
1079 ; AVX1OR2-LABEL: shuffle_v8f32_ba983210:
1081 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1082 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1083 ; AVX1OR2-NEXT: retq
1085 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_ba983210:
1086 ; AVX512VL-SLOW: # %bb.0:
1087 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1088 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1089 ; AVX512VL-SLOW-NEXT: retq
1091 ; AVX512VL-FAST-LABEL: shuffle_v8f32_ba983210:
1092 ; AVX512VL-FAST: # %bb.0:
1093 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [3,2,1,0,11,10,9,8]
1094 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
1095 ; AVX512VL-FAST-NEXT: vmovaps %ymm2, %ymm0
1096 ; AVX512VL-FAST-NEXT: retq
1097 %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>
1098 ret <8 x float> %shuffle
1101 define <8 x float> @shuffle_v8f32_80u1c4u5(<8 x float> %a, <8 x float> %b) {
1102 ; ALL-LABEL: shuffle_v8f32_80u1c4u5:
1104 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[1],ymm0[1],ymm1[4],ymm0[4],ymm1[5],ymm0[5]
1106 %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>
1107 ret <8 x float> %shuffle
1110 define <8 x float> @shuffle_v8f32_a2u3e6f7(<8 x float> %a, <8 x float> %b) {
1111 ; ALL-LABEL: shuffle_v8f32_a2u3e6f7:
1113 ; ALL-NEXT: vunpckhps {{.*#+}} ymm0 = ymm1[2],ymm0[2],ymm1[3],ymm0[3],ymm1[6],ymm0[6],ymm1[7],ymm0[7]
1115 %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>
1116 ret <8 x float> %shuffle
1119 define <8 x float> @shuffle_v8f32_084c195d(<8 x float> %a, <8 x float> %b) {
1120 ; AVX1-LABEL: shuffle_v8f32_084c195d:
1122 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3,0,1]
1123 ; AVX1-NEXT: vpermilps {{.*#+}} ymm2 = ymm2[0,1,2,0,4,5,6,4]
1124 ; AVX1-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[0,0,2,1,4,4,6,5]
1125 ; AVX1-NEXT: vblendps {{.*#+}} ymm1 = ymm1[0,1],ymm2[2,3,4,5],ymm1[6,7]
1126 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
1127 ; AVX1-NEXT: vpermilps {{.*#+}} ymm2 = ymm2[1,1,0,3,5,5,4,7]
1128 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,1,3,4,5,5,7]
1129 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm2[2,3,4,5],ymm0[6,7]
1130 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1133 ; AVX2-LABEL: shuffle_v8f32_084c195d:
1135 ; AVX2-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1136 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1139 ; AVX512VL-SLOW-LABEL: shuffle_v8f32_084c195d:
1140 ; AVX512VL-SLOW: # %bb.0:
1141 ; AVX512VL-SLOW-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1142 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1143 ; AVX512VL-SLOW-NEXT: retq
1145 ; AVX512VL-FAST-LABEL: shuffle_v8f32_084c195d:
1146 ; AVX512VL-FAST: # %bb.0:
1147 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,8,4,12,1,9,5,13]
1148 ; AVX512VL-FAST-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
1149 ; AVX512VL-FAST-NEXT: retq
1150 %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>
1151 ret <8 x float> %shuffle
1154 define <8 x float> @shuffle_v8f32_01452367d(<8 x float> %a) {
1155 ; AVX1-LABEL: shuffle_v8f32_01452367d:
1157 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1158 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,3,2]
1159 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2],ymm0[3]
1162 ; AVX2OR512VL-LABEL: shuffle_v8f32_01452367d:
1163 ; AVX2OR512VL: # %bb.0:
1164 ; AVX2OR512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1165 ; AVX2OR512VL-NEXT: retq
1166 %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>
1167 ret <8 x float> %shuffle
1170 define <8 x float> @shuffle_v8f32_uuuu1111(<8 x float> %a, <8 x float> %b) {
1171 ; ALL-LABEL: shuffle_v8f32_uuuu1111:
1173 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1174 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1176 %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>
1177 ret <8 x float> %shuffle
1180 define <8 x float> @shuffle_v8f32_44444444(<8 x float> %a, <8 x float> %b) {
1181 ; AVX1-LABEL: shuffle_v8f32_44444444:
1183 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,0,4,4,4,4]
1184 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
1187 ; AVX2OR512VL-LABEL: shuffle_v8f32_44444444:
1188 ; AVX2OR512VL: # %bb.0:
1189 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
1190 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
1191 ; AVX2OR512VL-NEXT: retq
1192 %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>
1193 ret <8 x float> %shuffle
1196 define <8 x float> @shuffle_v8f32_1188uuuu(<8 x float> %a, <8 x float> %b) {
1197 ; ALL-LABEL: shuffle_v8f32_1188uuuu:
1199 ; ALL-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,1],xmm1[0,0]
1201 %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>
1202 ret <8 x float> %shuffle
1205 define <8 x float> @shuffle_v8f32_uuuu3210(<8 x float> %a, <8 x float> %b) {
1206 ; ALL-LABEL: shuffle_v8f32_uuuu3210:
1208 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
1209 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1211 %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>
1212 ret <8 x float> %shuffle
1215 define <8 x float> @shuffle_v8f32_uuuu1188(<8 x float> %a, <8 x float> %b) {
1216 ; ALL-LABEL: shuffle_v8f32_uuuu1188:
1218 ; ALL-NEXT: vshufps {{.*#+}} xmm0 = xmm0[1,1],xmm1[0,0]
1219 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1221 %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>
1222 ret <8 x float> %shuffle
1225 define <8 x float> @shuffle_v8f32_1111uuuu(<8 x float> %a, <8 x float> %b) {
1226 ; ALL-LABEL: shuffle_v8f32_1111uuuu:
1228 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1230 %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>
1231 ret <8 x float> %shuffle
1234 define <8 x float> @shuffle_v8f32_5555uuuu(<8 x float> %a, <8 x float> %b) {
1235 ; ALL-LABEL: shuffle_v8f32_5555uuuu:
1237 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0
1238 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1240 %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>
1241 ret <8 x float> %shuffle
1244 define <8 x float> @shuffle_v8f32_32107654_v4f32(<4 x float> %a, <4 x float> %b) {
1245 ; ALL-LABEL: shuffle_v8f32_32107654_v4f32:
1247 ; ALL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1248 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1249 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1251 %1 = shufflevector <4 x float> %a, <4 x float> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
1252 %2 = shufflevector <4 x float> %b, <4 x float> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
1253 %3 = shufflevector <4 x float> %1, <4 x float> %2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
1257 define <8 x i32> @shuffle_v8i32_00000000(<8 x i32> %a, <8 x i32> %b) {
1258 ; AVX1-LABEL: shuffle_v8i32_00000000:
1260 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
1261 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1264 ; AVX2OR512VL-LABEL: shuffle_v8i32_00000000:
1265 ; AVX2OR512VL: # %bb.0:
1266 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
1267 ; AVX2OR512VL-NEXT: retq
1268 %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>
1269 ret <8 x i32> %shuffle
1272 define <8 x i32> @shuffle_v8i32_00000010(<8 x i32> %a, <8 x i32> %b) {
1273 ; AVX1-LABEL: shuffle_v8i32_00000010:
1275 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1276 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
1277 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1280 ; AVX2-SLOW-LABEL: shuffle_v8i32_00000010:
1281 ; AVX2-SLOW: # %bb.0:
1282 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
1283 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
1284 ; AVX2-SLOW-NEXT: retq
1286 ; AVX2-FAST-LABEL: shuffle_v8i32_00000010:
1287 ; AVX2-FAST: # %bb.0:
1288 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,0,1,0]
1289 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1290 ; AVX2-FAST-NEXT: retq
1292 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00000010:
1293 ; AVX512VL-SLOW: # %bb.0:
1294 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,0]
1295 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
1296 ; AVX512VL-SLOW-NEXT: retq
1298 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00000010:
1299 ; AVX512VL-FAST: # %bb.0:
1300 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,0,1,0]
1301 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1302 ; AVX512VL-FAST-NEXT: retq
1303 %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>
1304 ret <8 x i32> %shuffle
1307 define <8 x i32> @shuffle_v8i32_00000200(<8 x i32> %a, <8 x i32> %b) {
1308 ; AVX1-LABEL: shuffle_v8i32_00000200:
1310 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1311 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,0,0]
1312 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1315 ; AVX2-SLOW-LABEL: shuffle_v8i32_00000200:
1316 ; AVX2-SLOW: # %bb.0:
1317 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,2]
1318 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1319 ; AVX2-SLOW-NEXT: retq
1321 ; AVX2-FAST-LABEL: shuffle_v8i32_00000200:
1322 ; AVX2-FAST: # %bb.0:
1323 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,2,0,0]
1324 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1325 ; AVX2-FAST-NEXT: retq
1327 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00000200:
1328 ; AVX512VL-SLOW: # %bb.0:
1329 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,2]
1330 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1331 ; AVX512VL-SLOW-NEXT: retq
1333 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00000200:
1334 ; AVX512VL-FAST: # %bb.0:
1335 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,0,2,0,0]
1336 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1337 ; AVX512VL-FAST-NEXT: retq
1338 %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>
1339 ret <8 x i32> %shuffle
1342 define <8 x i32> @shuffle_v8i32_00003000(<8 x i32> %a, <8 x i32> %b) {
1343 ; AVX1-LABEL: shuffle_v8i32_00003000:
1345 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1346 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,0,0,0]
1347 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1350 ; AVX2-SLOW-LABEL: shuffle_v8i32_00003000:
1351 ; AVX2-SLOW: # %bb.0:
1352 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,3,0]
1353 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1354 ; AVX2-SLOW-NEXT: retq
1356 ; AVX2-FAST-LABEL: shuffle_v8i32_00003000:
1357 ; AVX2-FAST: # %bb.0:
1358 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,3,0,0,0]
1359 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1360 ; AVX2-FAST-NEXT: retq
1362 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00003000:
1363 ; AVX512VL-SLOW: # %bb.0:
1364 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,3,0]
1365 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
1366 ; AVX512VL-SLOW-NEXT: retq
1368 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00003000:
1369 ; AVX512VL-FAST: # %bb.0:
1370 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,3,0,0,0]
1371 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1372 ; AVX512VL-FAST-NEXT: retq
1373 %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>
1374 ret <8 x i32> %shuffle
1377 define <8 x i32> @shuffle_v8i32_00040000(<8 x i32> %a, <8 x i32> %b) {
1378 ; AVX1-LABEL: shuffle_v8i32_00040000:
1380 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[0,1,0,1]
1381 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
1382 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
1383 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,0],ymm0[2,0],ymm1[4,4],ymm0[6,4]
1386 ; AVX2OR512VL-LABEL: shuffle_v8i32_00040000:
1387 ; AVX2OR512VL: # %bb.0:
1388 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,4,0,0,0,0]
1389 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1390 ; AVX2OR512VL-NEXT: retq
1391 %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>
1392 ret <8 x i32> %shuffle
1395 define <8 x i32> @shuffle_v8i32_00500000(<8 x i32> %a, <8 x i32> %b) {
1396 ; AVX1-LABEL: shuffle_v8i32_00500000:
1398 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1399 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4,5,6,7]
1400 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,1,0,4,4,4,4]
1403 ; AVX2OR512VL-LABEL: shuffle_v8i32_00500000:
1404 ; AVX2OR512VL: # %bb.0:
1405 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,5,0,0,0,0,0]
1406 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1407 ; AVX2OR512VL-NEXT: retq
1408 %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>
1409 ret <8 x i32> %shuffle
1412 define <8 x i32> @shuffle_v8i32_06000000(<8 x i32> %a, <8 x i32> %b) {
1413 ; AVX1-LABEL: shuffle_v8i32_06000000:
1415 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1416 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
1417 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,0,0,4,4,4,4]
1420 ; AVX2OR512VL-LABEL: shuffle_v8i32_06000000:
1421 ; AVX2OR512VL: # %bb.0:
1422 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,6,0,0,0,0,0,0]
1423 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1424 ; AVX2OR512VL-NEXT: retq
1425 %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>
1426 ret <8 x i32> %shuffle
1429 define <8 x i32> @shuffle_v8i32_70000000(<8 x i32> %a, <8 x i32> %b) {
1430 ; AVX1-LABEL: shuffle_v8i32_70000000:
1432 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1433 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
1434 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,0,0,0,4,4,4,4]
1437 ; AVX2OR512VL-LABEL: shuffle_v8i32_70000000:
1438 ; AVX2OR512VL: # %bb.0:
1439 ; AVX2OR512VL-NEXT: movl $7, %eax
1440 ; AVX2OR512VL-NEXT: vmovd %eax, %xmm1
1441 ; AVX2OR512VL-NEXT: vpermd %ymm0, %ymm1, %ymm0
1442 ; AVX2OR512VL-NEXT: retq
1443 %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>
1444 ret <8 x i32> %shuffle
1447 define <8 x i32> @shuffle_v8i32_01014545(<8 x i32> %a, <8 x i32> %b) {
1448 ; AVX1-LABEL: shuffle_v8i32_01014545:
1450 ; AVX1-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
1453 ; AVX2OR512VL-LABEL: shuffle_v8i32_01014545:
1454 ; AVX2OR512VL: # %bb.0:
1455 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
1456 ; AVX2OR512VL-NEXT: retq
1457 %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>
1458 ret <8 x i32> %shuffle
1461 define <8 x i32> @shuffle_v8i32_00112233(<8 x i32> %a, <8 x i32> %b) {
1462 ; AVX1-LABEL: shuffle_v8i32_00112233:
1464 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,1,1]
1465 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,3,3]
1466 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1469 ; AVX2OR512VL-LABEL: shuffle_v8i32_00112233:
1470 ; AVX2OR512VL: # %bb.0:
1471 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,1,1,2,2,3,3]
1472 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1473 ; AVX2OR512VL-NEXT: retq
1474 %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>
1475 ret <8 x i32> %shuffle
1478 define <8 x i32> @shuffle_v8i32_00001111(<8 x i32> %a, <8 x i32> %b) {
1479 ; AVX1-LABEL: shuffle_v8i32_00001111:
1481 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,0,0,0]
1482 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
1483 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1486 ; AVX2-SLOW-LABEL: shuffle_v8i32_00001111:
1487 ; AVX2-SLOW: # %bb.0:
1488 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,1]
1489 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
1490 ; AVX2-SLOW-NEXT: retq
1492 ; AVX2-FAST-LABEL: shuffle_v8i32_00001111:
1493 ; AVX2-FAST: # %bb.0:
1494 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,1,1,1,1]
1495 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1496 ; AVX2-FAST-NEXT: retq
1498 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_00001111:
1499 ; AVX512VL-SLOW: # %bb.0:
1500 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,1,1]
1501 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
1502 ; AVX512VL-SLOW-NEXT: retq
1504 ; AVX512VL-FAST-LABEL: shuffle_v8i32_00001111:
1505 ; AVX512VL-FAST: # %bb.0:
1506 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,0,1,1,1,1]
1507 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
1508 ; AVX512VL-FAST-NEXT: retq
1509 %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>
1510 ret <8 x i32> %shuffle
1513 define <8 x i32> @shuffle_v8i32_81a3c5e7(<8 x i32> %a, <8 x i32> %b) {
1514 ; ALL-LABEL: shuffle_v8i32_81a3c5e7:
1516 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7]
1518 %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>
1519 ret <8 x i32> %shuffle
1522 define <8 x i32> @shuffle_v8i32_08080808(<8 x i32> %a, <8 x i32> %b) {
1523 ; AVX1-LABEL: shuffle_v8i32_08080808:
1525 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,0],xmm1[0,0]
1526 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,1,3]
1527 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1530 ; AVX2OR512VL-LABEL: shuffle_v8i32_08080808:
1531 ; AVX2OR512VL: # %bb.0:
1532 ; AVX2OR512VL-NEXT: vunpcklps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1533 ; AVX2OR512VL-NEXT: vbroadcastsd %xmm0, %ymm0
1534 ; AVX2OR512VL-NEXT: retq
1535 %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>
1536 ret <8 x i32> %shuffle
1539 define <8 x i32> @shuffle_v8i32_08084c4c(<8 x i32> %a, <8 x i32> %b) {
1540 ; AVX1-LABEL: shuffle_v8i32_08084c4c:
1542 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[0,0],ymm0[4,4],ymm1[4,4]
1543 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
1546 ; AVX2-LABEL: shuffle_v8i32_08084c4c:
1548 ; AVX2-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1549 ; AVX2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
1552 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_08084c4c:
1553 ; AVX512VL-SLOW: # %bb.0:
1554 ; AVX512VL-SLOW-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1555 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
1556 ; AVX512VL-SLOW-NEXT: retq
1558 ; AVX512VL-FAST-LABEL: shuffle_v8i32_08084c4c:
1559 ; AVX512VL-FAST: # %bb.0:
1560 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,8,0,8,4,12,4,12]
1561 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
1562 ; AVX512VL-FAST-NEXT: retq
1563 %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>
1564 ret <8 x i32> %shuffle
1567 define <8 x i32> @shuffle_v8i32_8823cc67(<8 x i32> %a, <8 x i32> %b) {
1568 ; ALL-LABEL: shuffle_v8i32_8823cc67:
1570 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,0],ymm0[2,3],ymm1[4,4],ymm0[6,7]
1572 %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>
1573 ret <8 x i32> %shuffle
1576 define <8 x i32> @shuffle_v8i32_9832dc76(<8 x i32> %a, <8 x i32> %b) {
1577 ; ALL-LABEL: shuffle_v8i32_9832dc76:
1579 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[3,2],ymm1[5,4],ymm0[7,6]
1581 %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>
1582 ret <8 x i32> %shuffle
1585 define <8 x i32> @shuffle_v8i32_9810dc54(<8 x i32> %a, <8 x i32> %b) {
1586 ; ALL-LABEL: shuffle_v8i32_9810dc54:
1588 ; ALL-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,0],ymm0[1,0],ymm1[5,4],ymm0[5,4]
1590 %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>
1591 ret <8 x i32> %shuffle
1594 define <8 x i32> @shuffle_v8i32_08194c5d(<8 x i32> %a, <8 x i32> %b) {
1595 ; ALL-LABEL: shuffle_v8i32_08194c5d:
1597 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[4],ymm1[4],ymm0[5],ymm1[5]
1599 %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>
1600 ret <8 x i32> %shuffle
1603 define <8 x i32> @shuffle_v8i32_2a3b6e7f(<8 x i32> %a, <8 x i32> %b) {
1604 ; ALL-LABEL: shuffle_v8i32_2a3b6e7f:
1606 ; ALL-NEXT: vunpckhps {{.*#+}} ymm0 = ymm0[2],ymm1[2],ymm0[3],ymm1[3],ymm0[6],ymm1[6],ymm0[7],ymm1[7]
1608 %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>
1609 ret <8 x i32> %shuffle
1612 define <8 x i32> @shuffle_v8i32_08192a3b(<8 x i32> %a, <8 x i32> %b) {
1613 ; AVX1OR2-LABEL: shuffle_v8i32_08192a3b:
1615 ; AVX1OR2-NEXT: vunpckhps {{.*#+}} xmm2 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
1616 ; AVX1OR2-NEXT: vunpcklps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1617 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1618 ; AVX1OR2-NEXT: retq
1620 ; AVX512VL-LABEL: shuffle_v8i32_08192a3b:
1621 ; AVX512VL: # %bb.0:
1622 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [0,8,1,9,2,10,3,11]
1623 ; AVX512VL-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
1624 ; AVX512VL-NEXT: retq
1625 %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>
1626 ret <8 x i32> %shuffle
1629 define <8 x i32> @shuffle_v8i32_08991abb(<8 x i32> %a, <8 x i32> %b) {
1630 ; AVX1-LABEL: shuffle_v8i32_08991abb:
1632 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm0[0,0],xmm1[0,0]
1633 ; AVX1-NEXT: vshufps {{.*#+}} xmm2 = xmm2[0,2],xmm1[1,1]
1634 ; AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3]
1635 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,2,3,3]
1636 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
1639 ; AVX2-SLOW-LABEL: shuffle_v8i32_08991abb:
1640 ; AVX2-SLOW: # %bb.0:
1641 ; AVX2-SLOW-NEXT: vmovdqa {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
1642 ; AVX2-SLOW-NEXT: vpermd %ymm1, %ymm2, %ymm1
1643 ; AVX2-SLOW-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
1644 ; AVX2-SLOW-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1645 ; AVX2-SLOW-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1646 ; AVX2-SLOW-NEXT: retq
1648 ; AVX2-FAST-LABEL: shuffle_v8i32_08991abb:
1649 ; AVX2-FAST: # %bb.0:
1650 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <0,u,1,u,1,u,u,u>
1651 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
1652 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
1653 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
1654 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1655 ; AVX2-FAST-NEXT: retq
1657 ; AVX512VL-LABEL: shuffle_v8i32_08991abb:
1658 ; AVX512VL: # %bb.0:
1659 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,0,1,1,9,2,3,3]
1660 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
1661 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
1662 ; AVX512VL-NEXT: retq
1663 %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>
1664 ret <8 x i32> %shuffle
1667 define <8 x i32> @shuffle_v8i32_091b2d3f(<8 x i32> %a, <8 x i32> %b) {
1668 ; AVX1-LABEL: shuffle_v8i32_091b2d3f:
1670 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[0,1,1,3]
1671 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,1,3,3]
1672 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
1673 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1676 ; AVX2-LABEL: shuffle_v8i32_091b2d3f:
1678 ; AVX2-NEXT: vpmovzxdq {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
1679 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1682 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_091b2d3f:
1683 ; AVX512VL-SLOW: # %bb.0:
1684 ; AVX512VL-SLOW-NEXT: vpmovzxdq {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
1685 ; AVX512VL-SLOW-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1686 ; AVX512VL-SLOW-NEXT: retq
1688 ; AVX512VL-FAST-LABEL: shuffle_v8i32_091b2d3f:
1689 ; AVX512VL-FAST: # %bb.0:
1690 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,9,1,11,2,13,3,15]
1691 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
1692 ; AVX512VL-FAST-NEXT: retq
1693 %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>
1694 ret <8 x i32> %shuffle
1697 define <8 x i32> @shuffle_v8i32_09ab1def(<8 x i32> %a, <8 x i32> %b) {
1698 ; AVX1-LABEL: shuffle_v8i32_09ab1def:
1700 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[1,1,3,3]
1701 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1702 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1705 ; AVX2-SLOW-LABEL: shuffle_v8i32_09ab1def:
1706 ; AVX2-SLOW: # %bb.0:
1707 ; AVX2-SLOW-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
1708 ; AVX2-SLOW-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1709 ; AVX2-SLOW-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1710 ; AVX2-SLOW-NEXT: retq
1712 ; AVX2-FAST-LABEL: shuffle_v8i32_09ab1def:
1713 ; AVX2-FAST: # %bb.0:
1714 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = <0,u,1,u,1,u,u,u>
1715 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm2, %ymm0
1716 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1717 ; AVX2-FAST-NEXT: retq
1719 ; AVX512VL-LABEL: shuffle_v8i32_09ab1def:
1720 ; AVX512VL: # %bb.0:
1721 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,1,2,3,9,5,6,7]
1722 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
1723 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
1724 ; AVX512VL-NEXT: retq
1725 %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>
1726 ret <8 x i32> %shuffle
1729 define <8 x i32> @shuffle_v8i32_00014445(<8 x i32> %a, <8 x i32> %b) {
1730 ; ALL-LABEL: shuffle_v8i32_00014445:
1732 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,4,4,4,5]
1734 %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>
1735 ret <8 x i32> %shuffle
1738 define <8 x i32> @shuffle_v8i32_00204464(<8 x i32> %a, <8 x i32> %b) {
1739 ; ALL-LABEL: shuffle_v8i32_00204464:
1741 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,4,6,4]
1743 %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>
1744 ret <8 x i32> %shuffle
1747 define <8 x i32> @shuffle_v8i32_03004744(<8 x i32> %a, <8 x i32> %b) {
1748 ; ALL-LABEL: shuffle_v8i32_03004744:
1750 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,7,4,4]
1752 %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>
1753 ret <8 x i32> %shuffle
1756 define <8 x i32> @shuffle_v8i32_10005444(<8 x i32> %a, <8 x i32> %b) {
1757 ; ALL-LABEL: shuffle_v8i32_10005444:
1759 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,5,4,4,4]
1761 %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>
1762 ret <8 x i32> %shuffle
1765 define <8 x i32> @shuffle_v8i32_22006644(<8 x i32> %a, <8 x i32> %b) {
1766 ; ALL-LABEL: shuffle_v8i32_22006644:
1768 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,6,4,4]
1770 %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>
1771 ret <8 x i32> %shuffle
1774 define <8 x i32> @shuffle_v8i32_33307774(<8 x i32> %a, <8 x i32> %b) {
1775 ; ALL-LABEL: shuffle_v8i32_33307774:
1777 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,7,7,4]
1779 %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>
1780 ret <8 x i32> %shuffle
1783 define <8 x i32> @shuffle_v8i32_32107654(<8 x i32> %a, <8 x i32> %b) {
1784 ; ALL-LABEL: shuffle_v8i32_32107654:
1786 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1788 %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>
1789 ret <8 x i32> %shuffle
1792 define <8 x i32> @shuffle_v8i32_00234467(<8 x i32> %a, <8 x i32> %b) {
1793 ; ALL-LABEL: shuffle_v8i32_00234467:
1795 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,4,4,6,7]
1797 %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>
1798 ret <8 x i32> %shuffle
1801 define <8 x i32> @shuffle_v8i32_00224466(<8 x i32> %a, <8 x i32> %b) {
1802 ; AVX1-LABEL: shuffle_v8i32_00224466:
1804 ; AVX1-NEXT: vmovsldup {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
1807 ; AVX2OR512VL-LABEL: shuffle_v8i32_00224466:
1808 ; AVX2OR512VL: # %bb.0:
1809 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
1810 ; AVX2OR512VL-NEXT: retq
1811 %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>
1812 ret <8 x i32> %shuffle
1815 define <8 x i32> @shuffle_v8i32_10325476(<8 x i32> %a, <8 x i32> %b) {
1816 ; ALL-LABEL: shuffle_v8i32_10325476:
1818 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,5,4,7,6]
1820 %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>
1821 ret <8 x i32> %shuffle
1824 define <8 x i32> @shuffle_v8i32_11335577(<8 x i32> %a, <8 x i32> %b) {
1825 ; AVX1-LABEL: shuffle_v8i32_11335577:
1827 ; AVX1-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
1830 ; AVX2OR512VL-LABEL: shuffle_v8i32_11335577:
1831 ; AVX2OR512VL: # %bb.0:
1832 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
1833 ; AVX2OR512VL-NEXT: retq
1834 %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>
1835 ret <8 x i32> %shuffle
1838 define <8 x i32> @shuffle_v8i32_10235467(<8 x i32> %a, <8 x i32> %b) {
1839 ; ALL-LABEL: shuffle_v8i32_10235467:
1841 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,3,5,4,6,7]
1843 %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>
1844 ret <8 x i32> %shuffle
1847 define <8 x i32> @shuffle_v8i32_10225466(<8 x i32> %a, <8 x i32> %b) {
1848 ; ALL-LABEL: shuffle_v8i32_10225466:
1850 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,2,5,4,6,6]
1852 %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>
1853 ret <8 x i32> %shuffle
1856 define <8 x i32> @shuffle_v8i32_00015444(<8 x i32> %a, <8 x i32> %b) {
1857 ; AVX1-LABEL: shuffle_v8i32_00015444:
1859 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,5,4,4,4]
1862 ; AVX2OR512VL-LABEL: shuffle_v8i32_00015444:
1863 ; AVX2OR512VL: # %bb.0:
1864 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,1,5,4,4,4]
1865 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1866 ; AVX2OR512VL-NEXT: retq
1867 %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>
1868 ret <8 x i32> %shuffle
1871 define <8 x i32> @shuffle_v8i32_00204644(<8 x i32> %a, <8 x i32> %b) {
1872 ; AVX1-LABEL: shuffle_v8i32_00204644:
1874 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,6,4,4]
1877 ; AVX2OR512VL-LABEL: shuffle_v8i32_00204644:
1878 ; AVX2OR512VL: # %bb.0:
1879 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,0,4,6,4,4]
1880 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1881 ; AVX2OR512VL-NEXT: retq
1882 %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>
1883 ret <8 x i32> %shuffle
1886 define <8 x i32> @shuffle_v8i32_03004474(<8 x i32> %a, <8 x i32> %b) {
1887 ; AVX1-LABEL: shuffle_v8i32_03004474:
1889 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,4,7,4]
1892 ; AVX2OR512VL-LABEL: shuffle_v8i32_03004474:
1893 ; AVX2OR512VL: # %bb.0:
1894 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,3,0,0,4,4,7,4]
1895 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1896 ; AVX2OR512VL-NEXT: retq
1897 %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>
1898 ret <8 x i32> %shuffle
1901 define <8 x i32> @shuffle_v8i32_10004444(<8 x i32> %a, <8 x i32> %b) {
1902 ; AVX1-LABEL: shuffle_v8i32_10004444:
1904 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,4,4,4,4]
1907 ; AVX2OR512VL-LABEL: shuffle_v8i32_10004444:
1908 ; AVX2OR512VL: # %bb.0:
1909 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,0,0,0,4,4,4,4]
1910 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1911 ; AVX2OR512VL-NEXT: retq
1912 %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>
1913 ret <8 x i32> %shuffle
1916 define <8 x i32> @shuffle_v8i32_22006446(<8 x i32> %a, <8 x i32> %b) {
1917 ; AVX1-LABEL: shuffle_v8i32_22006446:
1919 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,4,4,6]
1922 ; AVX2OR512VL-LABEL: shuffle_v8i32_22006446:
1923 ; AVX2OR512VL: # %bb.0:
1924 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [2,2,0,0,6,4,4,6]
1925 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1926 ; AVX2OR512VL-NEXT: retq
1927 %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>
1928 ret <8 x i32> %shuffle
1931 define <8 x i32> @shuffle_v8i32_33307474(<8 x i32> %a, <8 x i32> %b) {
1932 ; AVX1-LABEL: shuffle_v8i32_33307474:
1934 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,4,7,4]
1937 ; AVX2OR512VL-LABEL: shuffle_v8i32_33307474:
1938 ; AVX2OR512VL: # %bb.0:
1939 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [3,3,3,0,7,4,7,4]
1940 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1941 ; AVX2OR512VL-NEXT: retq
1942 %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>
1943 ret <8 x i32> %shuffle
1946 define <8 x i32> @shuffle_v8i32_32104567(<8 x i32> %a, <8 x i32> %b) {
1947 ; AVX1-LABEL: shuffle_v8i32_32104567:
1949 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,4,5,6,7]
1952 ; AVX2OR512VL-LABEL: shuffle_v8i32_32104567:
1953 ; AVX2OR512VL: # %bb.0:
1954 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [3,2,1,0,4,5,6,7]
1955 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1956 ; AVX2OR512VL-NEXT: retq
1957 %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>
1958 ret <8 x i32> %shuffle
1961 define <8 x i32> @shuffle_v8i32_00236744(<8 x i32> %a, <8 x i32> %b) {
1962 ; AVX1-LABEL: shuffle_v8i32_00236744:
1964 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,6,7,4,4]
1967 ; AVX2OR512VL-LABEL: shuffle_v8i32_00236744:
1968 ; AVX2OR512VL: # %bb.0:
1969 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,3,6,7,4,4]
1970 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1971 ; AVX2OR512VL-NEXT: retq
1972 %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>
1973 ret <8 x i32> %shuffle
1976 define <8 x i32> @shuffle_v8i32_00226644(<8 x i32> %a, <8 x i32> %b) {
1977 ; AVX1-LABEL: shuffle_v8i32_00226644:
1979 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,6,6,4,4]
1982 ; AVX2OR512VL-LABEL: shuffle_v8i32_00226644:
1983 ; AVX2OR512VL: # %bb.0:
1984 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,2,6,6,4,4]
1985 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1986 ; AVX2OR512VL-NEXT: retq
1987 %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>
1988 ret <8 x i32> %shuffle
1991 define <8 x i32> @shuffle_v8i32_10324567(<8 x i32> %a, <8 x i32> %b) {
1992 ; AVX1-LABEL: shuffle_v8i32_10324567:
1994 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,6,7]
1997 ; AVX2OR512VL-LABEL: shuffle_v8i32_10324567:
1998 ; AVX2OR512VL: # %bb.0:
1999 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,0,3,2,4,5,6,7]
2000 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2001 ; AVX2OR512VL-NEXT: retq
2002 %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>
2003 ret <8 x i32> %shuffle
2006 define <8 x i32> @shuffle_v8i32_11334567(<8 x i32> %a, <8 x i32> %b) {
2007 ; AVX1-LABEL: shuffle_v8i32_11334567:
2009 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,4,5,6,7]
2012 ; AVX2OR512VL-LABEL: shuffle_v8i32_11334567:
2013 ; AVX2OR512VL: # %bb.0:
2014 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,1,3,3,4,5,6,7]
2015 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2016 ; AVX2OR512VL-NEXT: retq
2017 %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>
2018 ret <8 x i32> %shuffle
2021 define <8 x i32> @shuffle_v8i32_01235467(<8 x i32> %a, <8 x i32> %b) {
2022 ; AVX1-LABEL: shuffle_v8i32_01235467:
2024 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,7]
2027 ; AVX2OR512VL-LABEL: shuffle_v8i32_01235467:
2028 ; AVX2OR512VL: # %bb.0:
2029 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,1,2,3,5,4,6,7]
2030 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2031 ; AVX2OR512VL-NEXT: retq
2032 %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>
2033 ret <8 x i32> %shuffle
2036 define <8 x i32> @shuffle_v8i32_01235466(<8 x i32> %a, <8 x i32> %b) {
2037 ; AVX1-LABEL: shuffle_v8i32_01235466:
2039 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,6]
2042 ; AVX2OR512VL-LABEL: shuffle_v8i32_01235466:
2043 ; AVX2OR512VL: # %bb.0:
2044 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,1,2,3,5,4,6,6]
2045 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2046 ; AVX2OR512VL-NEXT: retq
2047 %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>
2048 ret <8 x i32> %shuffle
2051 define <8 x i32> @shuffle_v8i32_002u6u44(<8 x i32> %a, <8 x i32> %b) {
2052 ; AVX1-LABEL: shuffle_v8i32_002u6u44:
2054 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,u,6,u,4,4]
2057 ; AVX2OR512VL-LABEL: shuffle_v8i32_002u6u44:
2058 ; AVX2OR512VL: # %bb.0:
2059 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,0,2,u,6,u,4,4>
2060 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2061 ; AVX2OR512VL-NEXT: retq
2062 %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>
2063 ret <8 x i32> %shuffle
2066 define <8 x i32> @shuffle_v8i32_00uu66uu(<8 x i32> %a, <8 x i32> %b) {
2067 ; AVX1-LABEL: shuffle_v8i32_00uu66uu:
2069 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,u,u,6,6,u,u]
2072 ; AVX2OR512VL-LABEL: shuffle_v8i32_00uu66uu:
2073 ; AVX2OR512VL: # %bb.0:
2074 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,0,u,u,6,6,u,u>
2075 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2076 ; AVX2OR512VL-NEXT: retq
2077 %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>
2078 ret <8 x i32> %shuffle
2081 define <8 x i32> @shuffle_v8i32_103245uu(<8 x i32> %a, <8 x i32> %b) {
2082 ; AVX1-LABEL: shuffle_v8i32_103245uu:
2084 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,u,u]
2087 ; AVX2OR512VL-LABEL: shuffle_v8i32_103245uu:
2088 ; AVX2OR512VL: # %bb.0:
2089 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <1,0,3,2,4,5,u,u>
2090 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2091 ; AVX2OR512VL-NEXT: retq
2092 %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>
2093 ret <8 x i32> %shuffle
2096 define <8 x i32> @shuffle_v8i32_1133uu67(<8 x i32> %a, <8 x i32> %b) {
2097 ; AVX1-LABEL: shuffle_v8i32_1133uu67:
2099 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,u,u,6,7]
2102 ; AVX2OR512VL-LABEL: shuffle_v8i32_1133uu67:
2103 ; AVX2OR512VL: # %bb.0:
2104 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <1,1,3,3,u,u,6,7>
2105 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2106 ; AVX2OR512VL-NEXT: retq
2107 %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>
2108 ret <8 x i32> %shuffle
2111 define <8 x i32> @shuffle_v8i32_0uu354uu(<8 x i32> %a, <8 x i32> %b) {
2112 ; AVX1-LABEL: shuffle_v8i32_0uu354uu:
2114 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,u,u,3,5,4,u,u]
2117 ; AVX2OR512VL-LABEL: shuffle_v8i32_0uu354uu:
2118 ; AVX2OR512VL: # %bb.0:
2119 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,u,u,3,5,4,u,u>
2120 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2121 ; AVX2OR512VL-NEXT: retq
2122 %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>
2123 ret <8 x i32> %shuffle
2126 define <8 x i32> @shuffle_v8i32_uuu3uu66(<8 x i32> %a, <8 x i32> %b) {
2127 ; AVX1-LABEL: shuffle_v8i32_uuu3uu66:
2129 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[u,u,u,3,u,u,6,6]
2132 ; AVX2OR512VL-LABEL: shuffle_v8i32_uuu3uu66:
2133 ; AVX2OR512VL: # %bb.0:
2134 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <u,u,u,3,u,u,6,6>
2135 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2136 ; AVX2OR512VL-NEXT: retq
2137 %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>
2138 ret <8 x i32> %shuffle
2141 define <8 x i32> @shuffle_v8i32_6caa87e5(<8 x i32> %a, <8 x i32> %b) {
2142 ; AVX1-LABEL: shuffle_v8i32_6caa87e5:
2144 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
2145 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2146 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3,0,1]
2147 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm2[0,0],ymm1[2,2],ymm2[4,4],ymm1[6,6]
2148 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2151 ; AVX2-SLOW-LABEL: shuffle_v8i32_6caa87e5:
2152 ; AVX2-SLOW: # %bb.0:
2153 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,3,2]
2154 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[0,0,2,2,4,4,6,6]
2155 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,1,0,3]
2156 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2157 ; AVX2-SLOW-NEXT: retq
2159 ; AVX2-FAST-LABEL: shuffle_v8i32_6caa87e5:
2160 ; AVX2-FAST: # %bb.0:
2161 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [4,4,2,2,0,0,6,6]
2162 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
2163 ; AVX2-FAST-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,3,2]
2164 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2165 ; AVX2-FAST-NEXT: retq
2167 ; AVX512VL-LABEL: shuffle_v8i32_6caa87e5:
2168 ; AVX512VL: # %bb.0:
2169 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [14,4,2,2,0,15,6,13]
2170 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2171 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
2172 ; AVX512VL-NEXT: retq
2173 %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>
2174 ret <8 x i32> %shuffle
2177 define <8 x i32> @shuffle_v8i32_32103210(<8 x i32> %a, <8 x i32> %b) {
2178 ; AVX1-LABEL: shuffle_v8i32_32103210:
2180 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2181 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2184 ; AVX2-SLOW-LABEL: shuffle_v8i32_32103210:
2185 ; AVX2-SLOW: # %bb.0:
2186 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2187 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
2188 ; AVX2-SLOW-NEXT: retq
2190 ; AVX2-FAST-LABEL: shuffle_v8i32_32103210:
2191 ; AVX2-FAST: # %bb.0:
2192 ; AVX2-FAST-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
2193 ; AVX2-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2194 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2195 ; AVX2-FAST-NEXT: retq
2197 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_32103210:
2198 ; AVX512VL-SLOW: # %bb.0:
2199 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2200 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
2201 ; AVX512VL-SLOW-NEXT: retq
2203 ; AVX512VL-FAST-LABEL: shuffle_v8i32_32103210:
2204 ; AVX512VL-FAST: # %bb.0:
2205 ; AVX512VL-FAST-NEXT: vbroadcasti128 {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
2206 ; AVX512VL-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2207 ; AVX512VL-FAST-NEXT: vpermd %ymm0, %ymm1, %ymm0
2208 ; AVX512VL-FAST-NEXT: retq
2209 %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>
2210 ret <8 x i32> %shuffle
2213 define <8 x i32> @shuffle_v8i32_76547654(<8 x i32> %a, <8 x i32> %b) {
2214 ; AVX1-LABEL: shuffle_v8i32_76547654:
2216 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2217 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2220 ; AVX2-SLOW-LABEL: shuffle_v8i32_76547654:
2221 ; AVX2-SLOW: # %bb.0:
2222 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2223 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
2224 ; AVX2-SLOW-NEXT: retq
2226 ; AVX2-FAST-LABEL: shuffle_v8i32_76547654:
2227 ; AVX2-FAST: # %bb.0:
2228 ; AVX2-FAST-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
2229 ; AVX2-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2230 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2231 ; AVX2-FAST-NEXT: retq
2233 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_76547654:
2234 ; AVX512VL-SLOW: # %bb.0:
2235 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2236 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
2237 ; AVX512VL-SLOW-NEXT: retq
2239 ; AVX512VL-FAST-LABEL: shuffle_v8i32_76547654:
2240 ; AVX512VL-FAST: # %bb.0:
2241 ; AVX512VL-FAST-NEXT: vbroadcasti128 {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
2242 ; AVX512VL-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2243 ; AVX512VL-FAST-NEXT: vpermd %ymm0, %ymm1, %ymm0
2244 ; AVX512VL-FAST-NEXT: retq
2245 %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>
2246 ret <8 x i32> %shuffle
2249 define <8 x i32> @shuffle_v8i32_76543210(<8 x i32> %a, <8 x i32> %b) {
2250 ; AVX1-LABEL: shuffle_v8i32_76543210:
2252 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2253 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
2256 ; AVX2-SLOW-LABEL: shuffle_v8i32_76543210:
2257 ; AVX2-SLOW: # %bb.0:
2258 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2259 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
2260 ; AVX2-SLOW-NEXT: retq
2262 ; AVX2-FAST-LABEL: shuffle_v8i32_76543210:
2263 ; AVX2-FAST: # %bb.0:
2264 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
2265 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2266 ; AVX2-FAST-NEXT: retq
2268 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_76543210:
2269 ; AVX512VL-SLOW: # %bb.0:
2270 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2271 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
2272 ; AVX512VL-SLOW-NEXT: retq
2274 ; AVX512VL-FAST-LABEL: shuffle_v8i32_76543210:
2275 ; AVX512VL-FAST: # %bb.0:
2276 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
2277 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2278 ; AVX512VL-FAST-NEXT: retq
2279 %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>
2280 ret <8 x i32> %shuffle
2283 define <8 x i32> @shuffle_v8i32_3210ba98(<8 x i32> %a, <8 x i32> %b) {
2284 ; AVX1OR2-LABEL: shuffle_v8i32_3210ba98:
2286 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2287 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2288 ; AVX1OR2-NEXT: retq
2290 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_3210ba98:
2291 ; AVX512VL-SLOW: # %bb.0:
2292 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2293 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2294 ; AVX512VL-SLOW-NEXT: retq
2296 ; AVX512VL-FAST-LABEL: shuffle_v8i32_3210ba98:
2297 ; AVX512VL-FAST: # %bb.0:
2298 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,11,10,9,8]
2299 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
2300 ; AVX512VL-FAST-NEXT: retq
2301 %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>
2302 ret <8 x i32> %shuffle
2305 define <8 x i32> @shuffle_v8i32_3210fedc(<8 x i32> %a, <8 x i32> %b) {
2306 ; AVX1OR2-LABEL: shuffle_v8i32_3210fedc:
2308 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2309 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2310 ; AVX1OR2-NEXT: retq
2312 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_3210fedc:
2313 ; AVX512VL-SLOW: # %bb.0:
2314 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2315 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2316 ; AVX512VL-SLOW-NEXT: retq
2318 ; AVX512VL-FAST-LABEL: shuffle_v8i32_3210fedc:
2319 ; AVX512VL-FAST: # %bb.0:
2320 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
2321 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
2322 ; AVX512VL-FAST-NEXT: retq
2323 %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>
2324 ret <8 x i32> %shuffle
2327 define <8 x i32> @shuffle_v8i32_7654fedc(<8 x i32> %a, <8 x i32> %b) {
2328 ; AVX1OR2-LABEL: shuffle_v8i32_7654fedc:
2330 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2331 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2332 ; AVX1OR2-NEXT: retq
2334 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_7654fedc:
2335 ; AVX512VL-SLOW: # %bb.0:
2336 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2337 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2338 ; AVX512VL-SLOW-NEXT: retq
2340 ; AVX512VL-FAST-LABEL: shuffle_v8i32_7654fedc:
2341 ; AVX512VL-FAST: # %bb.0:
2342 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
2343 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
2344 ; AVX512VL-FAST-NEXT: retq
2345 %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>
2346 ret <8 x i32> %shuffle
2349 define <8 x i32> @shuffle_v8i32_fedc7654(<8 x i32> %a, <8 x i32> %b) {
2350 ; AVX1OR2-LABEL: shuffle_v8i32_fedc7654:
2352 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
2353 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2354 ; AVX1OR2-NEXT: retq
2356 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_fedc7654:
2357 ; AVX512VL-SLOW: # %bb.0:
2358 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
2359 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2360 ; AVX512VL-SLOW-NEXT: retq
2362 ; AVX512VL-FAST-LABEL: shuffle_v8i32_fedc7654:
2363 ; AVX512VL-FAST: # %bb.0:
2364 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
2365 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2366 ; AVX512VL-FAST-NEXT: vmovdqa %ymm2, %ymm0
2367 ; AVX512VL-FAST-NEXT: retq
2368 %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>
2369 ret <8 x i32> %shuffle
2372 define <8 x i32> @shuffle_v8i32_ba987654(<8 x i32> %a, <8 x i32> %b) {
2373 ; AVX1OR2-LABEL: shuffle_v8i32_ba987654:
2375 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2376 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2377 ; AVX1OR2-NEXT: retq
2379 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_ba987654:
2380 ; AVX512VL-SLOW: # %bb.0:
2381 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2382 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2383 ; AVX512VL-SLOW-NEXT: retq
2385 ; AVX512VL-FAST-LABEL: shuffle_v8i32_ba987654:
2386 ; AVX512VL-FAST: # %bb.0:
2387 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
2388 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2389 ; AVX512VL-FAST-NEXT: vmovdqa %ymm2, %ymm0
2390 ; AVX512VL-FAST-NEXT: retq
2391 %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>
2392 ret <8 x i32> %shuffle
2395 define <8 x i32> @shuffle_v8i32_ba983210(<8 x i32> %a, <8 x i32> %b) {
2396 ; AVX1OR2-LABEL: shuffle_v8i32_ba983210:
2398 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2399 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2400 ; AVX1OR2-NEXT: retq
2402 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_ba983210:
2403 ; AVX512VL-SLOW: # %bb.0:
2404 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2405 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2406 ; AVX512VL-SLOW-NEXT: retq
2408 ; AVX512VL-FAST-LABEL: shuffle_v8i32_ba983210:
2409 ; AVX512VL-FAST: # %bb.0:
2410 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
2411 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2412 ; AVX512VL-FAST-NEXT: vmovdqa %ymm2, %ymm0
2413 ; AVX512VL-FAST-NEXT: retq
2414 %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>
2415 ret <8 x i32> %shuffle
2418 define <8 x i32> @shuffle_v8i32_zuu8zuuc(<8 x i32> %a) {
2419 ; AVX1-LABEL: shuffle_v8i32_zuu8zuuc:
2421 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2422 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,0],ymm1[4,5],ymm0[6,4]
2425 ; AVX2OR512VL-LABEL: shuffle_v8i32_zuu8zuuc:
2426 ; AVX2OR512VL: # %bb.0:
2427 ; 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]
2428 ; AVX2OR512VL-NEXT: retq
2429 %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>
2430 ret <8 x i32> %shuffle
2433 define <8 x i32> @shuffle_v8i32_9ubzdefz(<8 x i32> %a) {
2434 ; AVX1-LABEL: shuffle_v8i32_9ubzdefz:
2436 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2437 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[3,0],ymm0[3,0],ymm1[7,4],ymm0[7,4]
2438 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2441 ; AVX2OR512VL-LABEL: shuffle_v8i32_9ubzdefz:
2442 ; AVX2OR512VL: # %bb.0:
2443 ; 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
2444 ; AVX2OR512VL-NEXT: retq
2445 %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>
2446 ret <8 x i32> %shuffle
2449 define <8 x i32> @shuffle_v8i32_80u1b4uu(<8 x i32> %a, <8 x i32> %b) {
2450 ; ALL-LABEL: shuffle_v8i32_80u1b4uu:
2452 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[1],ymm0[1],ymm1[4],ymm0[4],ymm1[5],ymm0[5]
2454 %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>
2455 ret <8 x i32> %shuffle
2458 define <8 x i32> @shuffle_v8i32_uuuu1111(<8 x i32> %a, <8 x i32> %b) {
2459 ; ALL-LABEL: shuffle_v8i32_uuuu1111:
2461 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
2462 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2464 %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>
2465 ret <8 x i32> %shuffle
2468 define <8 x i32> @shuffle_v8i32_2222uuuu(<8 x i32> %a, <8 x i32> %b) {
2469 ; ALL-LABEL: shuffle_v8i32_2222uuuu:
2471 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,2,2]
2473 %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>
2474 ret <8 x i32> %shuffle
2477 define <8 x i32> @shuffle_v8i32_2A3Buuuu(<8 x i32> %a, <8 x i32> %b) {
2478 ; ALL-LABEL: shuffle_v8i32_2A3Buuuu:
2480 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2482 %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>
2483 ret <8 x i32> %shuffle
2486 define <8 x i32> @shuffle_v8i32_44444444(<8 x i32> %a, <8 x i32> %b) {
2487 ; AVX1-LABEL: shuffle_v8i32_44444444:
2489 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,0,4,4,4,4]
2490 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2493 ; AVX2OR512VL-LABEL: shuffle_v8i32_44444444:
2494 ; AVX2OR512VL: # %bb.0:
2495 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
2496 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2497 ; AVX2OR512VL-NEXT: retq
2498 %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>
2499 ret <8 x i32> %shuffle
2502 define <8 x i32> @shuffle_v8i32_44444444_bc(<8 x float> %a, <8 x float> %b) {
2503 ; AVX1-LABEL: shuffle_v8i32_44444444_bc:
2505 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,0,4,4,4,4]
2506 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2509 ; AVX2OR512VL-LABEL: shuffle_v8i32_44444444_bc:
2510 ; AVX2OR512VL: # %bb.0:
2511 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
2512 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2513 ; AVX2OR512VL-NEXT: retq
2514 %tmp0 = bitcast <8 x float> %a to <8 x i32>
2515 %tmp1 = bitcast <8 x float> %b to <8 x i32>
2516 %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>
2517 ret <8 x i32> %shuffle
2520 define <8 x i32> @shuffle_v8i32_5555uuuu(<8 x i32> %a, <8 x i32> %b) {
2521 ; ALL-LABEL: shuffle_v8i32_5555uuuu:
2523 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0
2524 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
2526 %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>
2527 ret <8 x i32> %shuffle
2530 define <8 x i32> @shuffle_v8i32_0dcd3f14(<8 x i32> %a, <8 x i32> %b) {
2531 ; AVX1-LABEL: shuffle_v8i32_0dcd3f14:
2533 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
2534 ; AVX1-NEXT: vblendps {{.*#+}} xmm2 = xmm2[0],xmm0[1,2,3]
2535 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm2[3,1,1,0]
2536 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
2537 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm1[2,3,2,3]
2538 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,3,2]
2539 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5],ymm0[6,7]
2542 ; AVX2-LABEL: shuffle_v8i32_0dcd3f14:
2544 ; AVX2-NEXT: vmovaps {{.*#+}} ymm2 = <0,u,u,u,3,u,1,4>
2545 ; AVX2-NEXT: vpermps %ymm0, %ymm2, %ymm0
2546 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,2,3,3]
2547 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5],ymm0[6,7]
2550 ; AVX512VL-LABEL: shuffle_v8i32_0dcd3f14:
2551 ; AVX512VL: # %bb.0:
2552 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,5,4,5,11,7,9,12]
2553 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2554 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
2555 ; AVX512VL-NEXT: retq
2556 %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>
2557 ret <8 x i32> %shuffle
2561 define <8 x i32> @shuffle_v8i32_uuuuuu7u(<8 x i32> %a, <8 x i32> %b) nounwind {
2562 ; AVX1-LABEL: shuffle_v8i32_uuuuuu7u:
2564 ; AVX1-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
2567 ; AVX2OR512VL-LABEL: shuffle_v8i32_uuuuuu7u:
2568 ; AVX2OR512VL: # %bb.0:
2569 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,3,3,4,5,7,7]
2570 ; AVX2OR512VL-NEXT: retq
2571 %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>
2572 ret <8 x i32> %shuffle
2575 define <8 x i32> @shuffle_v8i32_32107654_v4i32(<4 x i32> %a, <4 x i32> %b) {
2576 ; ALL-LABEL: shuffle_v8i32_32107654_v4i32:
2578 ; ALL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
2579 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2580 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2582 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
2583 %2 = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
2584 %3 = shufflevector <4 x i32> %1, <4 x i32> %2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
2588 define <8 x float> @splat_mem_v8f32_2(float* %p) {
2589 ; ALL-LABEL: splat_mem_v8f32_2:
2591 ; ALL-NEXT: vbroadcastss (%rdi), %ymm0
2593 %1 = load float, float* %p
2594 %2 = insertelement <4 x float> undef, float %1, i32 0
2595 %3 = shufflevector <4 x float> %2, <4 x float> undef, <8 x i32> zeroinitializer
2599 define <8 x float> @splat_v8f32(<4 x float> %r) {
2600 ; AVX1-LABEL: splat_v8f32:
2602 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
2603 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2606 ; AVX2OR512VL-LABEL: splat_v8f32:
2607 ; AVX2OR512VL: # %bb.0:
2608 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2609 ; AVX2OR512VL-NEXT: retq
2610 %1 = shufflevector <4 x float> %r, <4 x float> undef, <8 x i32> zeroinitializer
2615 ; Shuffle to logical bit shifts
2618 define <8 x i32> @shuffle_v8i32_z0U2zUz6(<8 x i32> %a) {
2619 ; AVX1-LABEL: shuffle_v8i32_z0U2zUz6:
2621 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2622 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2623 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,0,3,1,6,4,7,5]
2626 ; AVX2OR512VL-LABEL: shuffle_v8i32_z0U2zUz6:
2627 ; AVX2OR512VL: # %bb.0:
2628 ; AVX2OR512VL-NEXT: vpsllq $32, %ymm0, %ymm0
2629 ; AVX2OR512VL-NEXT: retq
2630 %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>
2631 ret <8 x i32> %shuffle
2634 define <8 x i32> @shuffle_v8i32_1U3z5zUU(<8 x i32> %a) {
2635 ; AVX1-LABEL: shuffle_v8i32_1U3z5zUU:
2637 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2638 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2639 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
2642 ; AVX2OR512VL-LABEL: shuffle_v8i32_1U3z5zUU:
2643 ; AVX2OR512VL: # %bb.0:
2644 ; AVX2OR512VL-NEXT: vpsrlq $32, %ymm0, %ymm0
2645 ; AVX2OR512VL-NEXT: retq
2646 %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>
2647 ret <8 x i32> %shuffle
2650 define <8 x i32> @shuffle_v8i32_B012F456(<8 x i32> %a, <8 x i32> %b) {
2651 ; AVX1-LABEL: shuffle_v8i32_B012F456:
2653 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[3,0],ymm0[0,0],ymm1[7,4],ymm0[4,4]
2654 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,2],ymm0[1,2],ymm1[4,6],ymm0[5,6]
2657 ; AVX2OR512VL-LABEL: shuffle_v8i32_B012F456:
2658 ; AVX2OR512VL: # %bb.0:
2659 ; 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]
2660 ; AVX2OR512VL-NEXT: retq
2661 %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>
2662 ret <8 x i32> %shuffle
2665 define <8 x i32> @shuffle_v8i32_1238567C(<8 x i32> %a, <8 x i32> %b) {
2666 ; AVX1-LABEL: shuffle_v8i32_1238567C:
2668 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2669 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2672 ; AVX2OR512VL-LABEL: shuffle_v8i32_1238567C:
2673 ; AVX2OR512VL: # %bb.0:
2674 ; 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]
2675 ; AVX2OR512VL-NEXT: retq
2676 %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>
2677 ret <8 x i32> %shuffle
2680 define <8 x i32> @shuffle_v8i32_9AB0DEF4(<8 x i32> %a, <8 x i32> %b) {
2681 ; AVX1-LABEL: shuffle_v8i32_9AB0DEF4:
2683 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[3,0],ymm0[4,4],ymm1[7,4]
2684 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,2],ymm0[2,0],ymm1[5,6],ymm0[6,4]
2687 ; AVX2OR512VL-LABEL: shuffle_v8i32_9AB0DEF4:
2688 ; AVX2OR512VL: # %bb.0:
2689 ; 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]
2690 ; AVX2OR512VL-NEXT: retq
2691 %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>
2692 ret <8 x i32> %shuffle
2695 define <8 x i32> @shuffle_v8i32_389A7CDE(<8 x i32> %a, <8 x i32> %b) {
2696 ; AVX1-LABEL: shuffle_v8i32_389A7CDE:
2698 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[3,0],ymm1[0,0],ymm0[7,4],ymm1[4,4]
2699 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,2],ymm1[1,2],ymm0[4,6],ymm1[5,6]
2702 ; AVX2OR512VL-LABEL: shuffle_v8i32_389A7CDE:
2703 ; AVX2OR512VL: # %bb.0:
2704 ; 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]
2705 ; AVX2OR512VL-NEXT: retq
2706 %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>
2707 ret <8 x i32> %shuffle
2710 define <8 x i32> @shuffle_v8i32_30127456(<8 x i32> %a, <8 x i32> %b) {
2711 ; ALL-LABEL: shuffle_v8i32_30127456:
2713 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,0,1,2,7,4,5,6]
2715 %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>
2716 ret <8 x i32> %shuffle
2719 define <8 x i32> @shuffle_v8i32_12305674(<8 x i32> %a, <8 x i32> %b) {
2720 ; ALL-LABEL: shuffle_v8i32_12305674:
2722 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,2,3,0,5,6,7,4]
2724 %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>
2725 ret <8 x i32> %shuffle
2728 define <8x float> @concat_v2f32_1(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2729 ; ALL-LABEL: concat_v2f32_1:
2730 ; ALL: # %bb.0: # %entry
2731 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2732 ; ALL-NEXT: vmovhps {{.*#+}} xmm0 = xmm0[0,1],mem[0,1]
2735 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2736 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2737 %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>
2738 %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>
2739 %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>
2740 ret <8 x float> %tmp76
2743 define <8x float> @concat_v2f32_2(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2744 ; ALL-LABEL: concat_v2f32_2:
2745 ; ALL: # %bb.0: # %entry
2746 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2747 ; ALL-NEXT: vmovhps {{.*#+}} xmm0 = xmm0[0,1],mem[0,1]
2750 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2751 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2752 %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>
2753 ret <8 x float> %tmp76
2756 define <8x float> @concat_v2f32_3(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2757 ; ALL-LABEL: concat_v2f32_3:
2758 ; ALL: # %bb.0: # %entry
2759 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2760 ; ALL-NEXT: vmovhps {{.*#+}} xmm0 = xmm0[0,1],mem[0,1]
2763 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2764 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2765 %tmp76 = shufflevector <2 x float> %tmp72, <2 x float> %tmp74, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2766 %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>
2767 ret <8 x float> %res
2770 define <8 x i32> @insert_mem_and_zero_v8i32(i32* %ptr) {
2771 ; ALL-LABEL: insert_mem_and_zero_v8i32:
2773 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
2775 %a = load i32, i32* %ptr
2776 %v = insertelement <8 x i32> undef, i32 %a, i32 0
2777 %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>
2778 ret <8 x i32> %shuffle
2781 define <8 x i32> @concat_v8i32_0123CDEF(<8 x i32> %a, <8 x i32> %b) {
2782 ; ALL-LABEL: concat_v8i32_0123CDEF:
2784 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2786 %alo = shufflevector <8 x i32> %a, <8 x i32> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2787 %bhi = shufflevector <8 x i32> %b, <8 x i32> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2788 %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>
2792 define <8 x i32> @concat_v8i32_4567CDEF_bc(<8 x i32> %a0, <8 x i32> %a1) {
2793 ; AVX1OR2-LABEL: concat_v8i32_4567CDEF_bc:
2795 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2796 ; AVX1OR2-NEXT: retq
2798 ; AVX512VL-LABEL: concat_v8i32_4567CDEF_bc:
2799 ; AVX512VL: # %bb.0:
2800 ; AVX512VL-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2801 ; AVX512VL-NEXT: retq
2802 %a0hi = shufflevector <8 x i32> %a0, <8 x i32> %a1, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2803 %a1hi = shufflevector <8 x i32> %a0, <8 x i32> %a1, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
2804 %bc0hi = bitcast <4 x i32> %a0hi to <2 x i64>
2805 %bc1hi = bitcast <4 x i32> %a1hi to <2 x i64>
2806 %shuffle64 = shufflevector <2 x i64> %bc0hi, <2 x i64> %bc1hi, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2807 %shuffle32 = bitcast <4 x i64> %shuffle64 to <8 x i32>
2808 ret <8 x i32> %shuffle32
2811 define <8 x float> @concat_v8f32_4567CDEF_bc(<8 x float> %f0, <8 x float> %f1) {
2812 ; ALL-LABEL: concat_v8f32_4567CDEF_bc:
2814 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2816 %a0 = bitcast <8 x float> %f0 to <4 x i64>
2817 %a1 = bitcast <8 x float> %f1 to <8 x i32>
2818 %a0hi = shufflevector <4 x i64> %a0, <4 x i64> undef, <2 x i32> <i32 2, i32 3>
2819 %a1hi = shufflevector <8 x i32> %a1, <8 x i32> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2820 %bc0hi = bitcast <2 x i64> %a0hi to <2 x i64>
2821 %bc1hi = bitcast <4 x i32> %a1hi to <2 x i64>
2822 %shuffle64 = shufflevector <2 x i64> %bc0hi, <2 x i64> %bc1hi, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2823 %shuffle32 = bitcast <4 x i64> %shuffle64 to <8 x float>
2824 ret <8 x float> %shuffle32
2827 define <8 x i32> @insert_dup_mem_v8i32(i32* %ptr) {
2828 ; ALL-LABEL: insert_dup_mem_v8i32:
2830 ; ALL-NEXT: vbroadcastss (%rdi), %ymm0
2832 %tmp = load i32, i32* %ptr, align 4
2833 %tmp1 = insertelement <4 x i32> zeroinitializer, i32 %tmp, i32 0
2834 %tmp2 = shufflevector <4 x i32> %tmp1, <4 x i32> undef, <8 x i32> zeroinitializer
2838 define <8 x i32> @shuffle_v8i32_12345678(<8 x i32> %a, <8 x i32> %b) {
2839 ; AVX1-LABEL: shuffle_v8i32_12345678:
2841 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
2842 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2843 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2846 ; AVX2-LABEL: shuffle_v8i32_12345678:
2848 ; AVX2-NEXT: vperm2i128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
2849 ; 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]
2852 ; AVX512VL-LABEL: shuffle_v8i32_12345678:
2853 ; AVX512VL: # %bb.0:
2854 ; AVX512VL-NEXT: valignd {{.*#+}} ymm0 = ymm0[1,2,3,4,5,6,7],ymm1[0]
2855 ; AVX512VL-NEXT: retq
2856 %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>
2857 ret <8 x i32> %shuffle
2860 define <8 x i32> @shuffle_v8i32_12345670(<8 x i32> %a) {
2861 ; AVX1-LABEL: shuffle_v8i32_12345670:
2863 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
2864 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2865 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2868 ; AVX2-LABEL: shuffle_v8i32_12345670:
2870 ; AVX2-NEXT: vmovaps {{.*#+}} ymm1 = [1,2,3,4,5,6,7,0]
2871 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
2874 ; AVX512VL-LABEL: shuffle_v8i32_12345670:
2875 ; AVX512VL: # %bb.0:
2876 ; AVX512VL-NEXT: valignd {{.*#+}} ymm0 = ymm0[1,2,3,4,5,6,7,0]
2877 ; AVX512VL-NEXT: retq
2878 %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>
2879 ret <8 x i32> %shuffle
2882 define <8 x float> @add_v8f32_02468ACE_13579BDF(<8 x float> %a, <8 x float> %b) {
2883 ; AVX1-LABEL: add_v8f32_02468ACE_13579BDF:
2884 ; AVX1: # %bb.0: # %entry
2885 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
2886 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2887 ; AVX1-NEXT: vhaddps %ymm2, %ymm0, %ymm0
2890 ; AVX2-LABEL: add_v8f32_02468ACE_13579BDF:
2891 ; AVX2: # %bb.0: # %entry
2892 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2893 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2894 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2895 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2896 ; AVX2-NEXT: vaddps %ymm0, %ymm2, %ymm0
2899 ; AVX512VL-SLOW-LABEL: add_v8f32_02468ACE_13579BDF:
2900 ; AVX512VL-SLOW: # %bb.0: # %entry
2901 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2902 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2903 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2904 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2905 ; AVX512VL-SLOW-NEXT: vaddps %ymm0, %ymm2, %ymm0
2906 ; AVX512VL-SLOW-NEXT: retq
2908 ; AVX512VL-FAST-LABEL: add_v8f32_02468ACE_13579BDF:
2909 ; AVX512VL-FAST: # %bb.0: # %entry
2910 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2911 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm1, %ymm0, %ymm2
2912 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2913 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm1, %ymm0, %ymm3
2914 ; AVX512VL-FAST-NEXT: vaddps %ymm3, %ymm2, %ymm0
2915 ; AVX512VL-FAST-NEXT: retq
2917 %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>
2918 %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>
2919 %add = fadd <8 x float> %shuffle, %shuffle1
2920 ret <8 x float> %add
2923 define <8 x float> @add_v8f32_8ACE0246_9BDF1357(<8 x float> %a, <8 x float> %b) {
2924 ; AVX1-LABEL: add_v8f32_8ACE0246_9BDF1357:
2925 ; AVX1: # %bb.0: # %entry
2926 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
2927 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2928 ; AVX1-NEXT: vhaddps %ymm2, %ymm0, %ymm0
2931 ; AVX2-LABEL: add_v8f32_8ACE0246_9BDF1357:
2932 ; AVX2: # %bb.0: # %entry
2933 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2934 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2935 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2936 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2937 ; AVX2-NEXT: vaddps %ymm0, %ymm2, %ymm0
2940 ; AVX512VL-SLOW-LABEL: add_v8f32_8ACE0246_9BDF1357:
2941 ; AVX512VL-SLOW: # %bb.0: # %entry
2942 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2943 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2944 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2945 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2946 ; AVX512VL-SLOW-NEXT: vaddps %ymm0, %ymm2, %ymm0
2947 ; AVX512VL-SLOW-NEXT: retq
2949 ; AVX512VL-FAST-LABEL: add_v8f32_8ACE0246_9BDF1357:
2950 ; AVX512VL-FAST: # %bb.0: # %entry
2951 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2952 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
2953 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2954 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm3
2955 ; AVX512VL-FAST-NEXT: vaddps %ymm3, %ymm2, %ymm0
2956 ; AVX512VL-FAST-NEXT: retq
2958 %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>
2959 %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>
2960 %add = fadd <8 x float> %shuffle, %shuffle1
2961 ret <8 x float> %add
2964 define <8 x i32> @add_v8i32_02468ACE_13579BDF(<8 x i32> %a, <8 x i32> %b) {
2965 ; AVX1-LABEL: add_v8i32_02468ACE_13579BDF:
2966 ; AVX1: # %bb.0: # %entry
2967 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
2968 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2969 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
2970 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
2971 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
2972 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
2973 ; AVX1-NEXT: vpaddd %xmm2, %xmm3, %xmm2
2974 ; AVX1-NEXT: vpaddd %xmm0, %xmm1, %xmm0
2975 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
2978 ; AVX2-LABEL: add_v8i32_02468ACE_13579BDF:
2979 ; AVX2: # %bb.0: # %entry
2980 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2981 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2982 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2983 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2984 ; AVX2-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2987 ; AVX512VL-SLOW-LABEL: add_v8i32_02468ACE_13579BDF:
2988 ; AVX512VL-SLOW: # %bb.0: # %entry
2989 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2990 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2991 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2992 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2993 ; AVX512VL-SLOW-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2994 ; AVX512VL-SLOW-NEXT: retq
2996 ; AVX512VL-FAST-LABEL: add_v8i32_02468ACE_13579BDF:
2997 ; AVX512VL-FAST: # %bb.0: # %entry
2998 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2999 ; AVX512VL-FAST-NEXT: vpermi2d %ymm1, %ymm0, %ymm2
3000 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
3001 ; AVX512VL-FAST-NEXT: vpermi2d %ymm1, %ymm0, %ymm3
3002 ; AVX512VL-FAST-NEXT: vpaddd %ymm3, %ymm2, %ymm0
3003 ; AVX512VL-FAST-NEXT: retq
3005 %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>
3006 %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>
3007 %add = add <8 x i32> %shuffle, %shuffle1
3011 define <8 x i32> @add_v8i32_8ACE0246_9BDF1357(<8 x i32> %a, <8 x i32> %b) {
3012 ; AVX1-LABEL: add_v8i32_8ACE0246_9BDF1357:
3013 ; AVX1: # %bb.0: # %entry
3014 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
3015 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
3016 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
3017 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
3018 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
3019 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
3020 ; AVX1-NEXT: vpaddd %xmm2, %xmm3, %xmm2
3021 ; AVX1-NEXT: vpaddd %xmm0, %xmm1, %xmm0
3022 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
3025 ; AVX2-LABEL: add_v8i32_8ACE0246_9BDF1357:
3026 ; AVX2: # %bb.0: # %entry
3027 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
3028 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
3029 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
3030 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
3031 ; AVX2-NEXT: vpaddd %ymm0, %ymm2, %ymm0
3034 ; AVX512VL-SLOW-LABEL: add_v8i32_8ACE0246_9BDF1357:
3035 ; AVX512VL-SLOW: # %bb.0: # %entry
3036 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
3037 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
3038 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
3039 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
3040 ; AVX512VL-SLOW-NEXT: vpaddd %ymm0, %ymm2, %ymm0
3041 ; AVX512VL-SLOW-NEXT: retq
3043 ; AVX512VL-FAST-LABEL: add_v8i32_8ACE0246_9BDF1357:
3044 ; AVX512VL-FAST: # %bb.0: # %entry
3045 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
3046 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
3047 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
3048 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm3
3049 ; AVX512VL-FAST-NEXT: vpaddd %ymm3, %ymm2, %ymm0
3050 ; AVX512VL-FAST-NEXT: retq
3052 %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>
3053 %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>
3054 %add = add <8 x i32> %shuffle, %shuffle1
3058 ; This test used to crash due to bad handling of concat_vectors after a bitcast
3059 ; in lowerVectorShuffleAsBroadcast.
3060 define <8 x float> @broadcast_concat_crash(<4 x float> %x, <4 x float> %y, float %z) {
3061 ; AVX1-LABEL: broadcast_concat_crash:
3062 ; AVX1: # %bb.0: # %entry
3063 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm1[3,3,1,1]
3064 ; AVX1-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
3065 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
3068 ; AVX2-LABEL: broadcast_concat_crash:
3069 ; AVX2: # %bb.0: # %entry
3070 ; AVX2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3071 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,2,3]
3072 ; AVX2-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,3,3]
3073 ; AVX2-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
3074 ; AVX2-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
3077 ; AVX512VL-SLOW-LABEL: broadcast_concat_crash:
3078 ; AVX512VL-SLOW: # %bb.0: # %entry
3079 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3080 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,2,3]
3081 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,3,3]
3082 ; AVX512VL-SLOW-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
3083 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
3084 ; AVX512VL-SLOW-NEXT: retq
3086 ; AVX512VL-FAST-LABEL: broadcast_concat_crash:
3087 ; AVX512VL-FAST: # %bb.0: # %entry
3088 ; AVX512VL-FAST-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3089 ; AVX512VL-FAST-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,2,3]
3090 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} xmm1 = [1,4,3,3]
3091 ; AVX512VL-FAST-NEXT: vpermi2ps %xmm2, %xmm0, %xmm1
3092 ; AVX512VL-FAST-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3093 ; AVX512VL-FAST-NEXT: retq
3095 %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>
3096 %bc = bitcast <8 x float> %tmp to <4 x i64>
3097 %tmp1 = extractelement <4 x i64> %bc, i32 3
3098 %tmp2 = bitcast i64 %tmp1 to <2 x float>
3099 %tmp4 = extractelement <2 x float> %tmp2, i32 1
3100 %tmp5 = insertelement <8 x float> undef, float %tmp4, i32 4
3101 %tmp6 = insertelement <8 x float> %tmp5, float %z, i32 5
3102 ret <8 x float> %tmp6
3105 ; PR40434: https://bugs.llvm.org/show_bug.cgi?id=40434
3107 define <8 x i32> @unpckh_v8i32(<8 x i32> %x, <8 x i32> %y) {
3108 ; ALL-LABEL: unpckh_v8i32:
3110 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3111 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3113 %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>
3114 ret <8 x i32> %unpckh
3117 ; Same as above but with floats.
3119 define <8 x float> @unpckh_v8f32(<8 x float> %x, <8 x float> %y) {
3120 ; ALL-LABEL: unpckh_v8f32:
3122 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3123 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3125 %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>
3126 ret <8 x float> %unpckh
3129 ; Alternate form of the above - make sure we don't have conflicting transforms.
3131 define <8 x i32> @blend_perm_v8i32(<8 x i32> %x, <8 x i32> %y) {
3132 ; ALL-LABEL: blend_perm_v8i32:
3134 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3135 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3137 %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>
3138 %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>
3142 ; Same as above but with floats.
3144 define <8 x float> @blend_perm_v8f32(<8 x float> %x, <8 x float> %y) {
3145 ; ALL-LABEL: blend_perm_v8f32:
3147 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3148 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3150 %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>
3151 %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>
3155 ; Another variation of the above - make sure we don't have conflicting transforms.
3157 define <8 x i32> @unpckh_v8i32_unary(<8 x i32> %x) {
3158 ; ALL-LABEL: unpckh_v8i32_unary:
3160 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1
3161 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3163 %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>
3167 ; Same as above but with floats.
3169 define <8 x float> @unpckh_v8f32_unary(<8 x float> %x) {
3170 ; ALL-LABEL: unpckh_v8f32_unary:
3172 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1
3173 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3175 %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>
3179 ; FIXME: Why are integer and FP (below) lowering different for AVX1?
3181 define <8 x i32> @lowhalf_v8i32(<8 x i32> %x, <8 x i32> %y) {
3182 ; AVX1-LABEL: lowhalf_v8i32:
3184 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
3185 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm1[0,2,2,2]
3186 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,3,3]
3187 ; AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3]
3190 ; AVX2-LABEL: lowhalf_v8i32:
3192 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
3193 ; AVX2-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [2,6,3,6,2,6,3,6]
3194 ; AVX2-NEXT: # ymm1 = mem[0,1,0,1]
3195 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
3198 ; AVX512VL-LABEL: lowhalf_v8i32:
3199 ; AVX512VL: # %bb.0:
3200 ; AVX512VL-NEXT: vbroadcasti128 {{.*#+}} ymm2 = [2,14,3,14,2,14,3,14]
3201 ; AVX512VL-NEXT: # ymm2 = mem[0,1,0,1]
3202 ; AVX512VL-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
3203 ; AVX512VL-NEXT: retq
3204 %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>
3208 ; FIXME: AVX1 lowering is better than AVX2 (and AVX512?)
3210 define <8 x float> @lowhalf_v8f32(<8 x float> %x, <8 x float> %y) {
3211 ; AVX1-LABEL: lowhalf_v8f32:
3213 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
3214 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[2,3],xmm1[2,2]
3215 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,1,3]
3218 ; AVX2-LABEL: lowhalf_v8f32:
3220 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
3221 ; AVX2-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [2,6,3,6,2,6,3,6]
3222 ; AVX2-NEXT: # ymm1 = mem[0,1,0,1]
3223 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
3226 ; AVX512VL-LABEL: lowhalf_v8f32:
3227 ; AVX512VL: # %bb.0:
3228 ; AVX512VL-NEXT: vbroadcasti128 {{.*#+}} ymm2 = [2,14,3,14,2,14,3,14]
3229 ; AVX512VL-NEXT: # ymm2 = mem[0,1,0,1]
3230 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
3231 ; AVX512VL-NEXT: retq
3232 %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>