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-LABEL: shuffle_v8i32_08991abb:
1641 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = <u,0,1,1,u,2,3,3>
1642 ; AVX2-NEXT: vpermd %ymm1, %ymm2, %ymm1
1643 ; AVX2-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
1644 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1645 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1648 ; AVX512VL-LABEL: shuffle_v8i32_08991abb:
1649 ; AVX512VL: # %bb.0:
1650 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,0,1,1,9,2,3,3]
1651 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
1652 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
1653 ; AVX512VL-NEXT: retq
1654 %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>
1655 ret <8 x i32> %shuffle
1658 define <8 x i32> @shuffle_v8i32_091b2d3f(<8 x i32> %a, <8 x i32> %b) {
1659 ; AVX1-LABEL: shuffle_v8i32_091b2d3f:
1661 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[0,1,1,3]
1662 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,1,3,3]
1663 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm2, %ymm0
1664 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1667 ; AVX2-LABEL: shuffle_v8i32_091b2d3f:
1669 ; AVX2-NEXT: vpmovzxdq {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
1670 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1673 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_091b2d3f:
1674 ; AVX512VL-SLOW: # %bb.0:
1675 ; AVX512VL-SLOW-NEXT: vpmovzxdq {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
1676 ; AVX512VL-SLOW-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3],ymm0[4],ymm1[5],ymm0[6],ymm1[7]
1677 ; AVX512VL-SLOW-NEXT: retq
1679 ; AVX512VL-FAST-LABEL: shuffle_v8i32_091b2d3f:
1680 ; AVX512VL-FAST: # %bb.0:
1681 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,9,1,11,2,13,3,15]
1682 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
1683 ; AVX512VL-FAST-NEXT: retq
1684 %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>
1685 ret <8 x i32> %shuffle
1688 define <8 x i32> @shuffle_v8i32_09ab1def(<8 x i32> %a, <8 x i32> %b) {
1689 ; AVX1-LABEL: shuffle_v8i32_09ab1def:
1691 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm0[1,1,3,3]
1692 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1693 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1696 ; AVX2-LABEL: shuffle_v8i32_09ab1def:
1698 ; AVX2-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
1699 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1700 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5,6,7]
1703 ; AVX512VL-LABEL: shuffle_v8i32_09ab1def:
1704 ; AVX512VL: # %bb.0:
1705 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,1,2,3,9,5,6,7]
1706 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
1707 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
1708 ; AVX512VL-NEXT: retq
1709 %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>
1710 ret <8 x i32> %shuffle
1713 define <8 x i32> @shuffle_v8i32_00014445(<8 x i32> %a, <8 x i32> %b) {
1714 ; ALL-LABEL: shuffle_v8i32_00014445:
1716 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,4,4,4,5]
1718 %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>
1719 ret <8 x i32> %shuffle
1722 define <8 x i32> @shuffle_v8i32_00204464(<8 x i32> %a, <8 x i32> %b) {
1723 ; ALL-LABEL: shuffle_v8i32_00204464:
1725 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,4,6,4]
1727 %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>
1728 ret <8 x i32> %shuffle
1731 define <8 x i32> @shuffle_v8i32_03004744(<8 x i32> %a, <8 x i32> %b) {
1732 ; ALL-LABEL: shuffle_v8i32_03004744:
1734 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,7,4,4]
1736 %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>
1737 ret <8 x i32> %shuffle
1740 define <8 x i32> @shuffle_v8i32_10005444(<8 x i32> %a, <8 x i32> %b) {
1741 ; ALL-LABEL: shuffle_v8i32_10005444:
1743 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,5,4,4,4]
1745 %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>
1746 ret <8 x i32> %shuffle
1749 define <8 x i32> @shuffle_v8i32_22006644(<8 x i32> %a, <8 x i32> %b) {
1750 ; ALL-LABEL: shuffle_v8i32_22006644:
1752 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,6,4,4]
1754 %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>
1755 ret <8 x i32> %shuffle
1758 define <8 x i32> @shuffle_v8i32_33307774(<8 x i32> %a, <8 x i32> %b) {
1759 ; ALL-LABEL: shuffle_v8i32_33307774:
1761 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,7,7,4]
1763 %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>
1764 ret <8 x i32> %shuffle
1767 define <8 x i32> @shuffle_v8i32_32107654(<8 x i32> %a, <8 x i32> %b) {
1768 ; ALL-LABEL: shuffle_v8i32_32107654:
1770 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
1772 %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>
1773 ret <8 x i32> %shuffle
1776 define <8 x i32> @shuffle_v8i32_00234467(<8 x i32> %a, <8 x i32> %b) {
1777 ; ALL-LABEL: shuffle_v8i32_00234467:
1779 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,4,4,6,7]
1781 %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>
1782 ret <8 x i32> %shuffle
1785 define <8 x i32> @shuffle_v8i32_00224466(<8 x i32> %a, <8 x i32> %b) {
1786 ; AVX1-LABEL: shuffle_v8i32_00224466:
1788 ; AVX1-NEXT: vmovsldup {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
1791 ; AVX2OR512VL-LABEL: shuffle_v8i32_00224466:
1792 ; AVX2OR512VL: # %bb.0:
1793 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,4,4,6,6]
1794 ; AVX2OR512VL-NEXT: retq
1795 %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>
1796 ret <8 x i32> %shuffle
1799 define <8 x i32> @shuffle_v8i32_10325476(<8 x i32> %a, <8 x i32> %b) {
1800 ; ALL-LABEL: shuffle_v8i32_10325476:
1802 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,5,4,7,6]
1804 %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>
1805 ret <8 x i32> %shuffle
1808 define <8 x i32> @shuffle_v8i32_11335577(<8 x i32> %a, <8 x i32> %b) {
1809 ; AVX1-LABEL: shuffle_v8i32_11335577:
1811 ; AVX1-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
1814 ; AVX2OR512VL-LABEL: shuffle_v8i32_11335577:
1815 ; AVX2OR512VL: # %bb.0:
1816 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
1817 ; AVX2OR512VL-NEXT: retq
1818 %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>
1819 ret <8 x i32> %shuffle
1822 define <8 x i32> @shuffle_v8i32_10235467(<8 x i32> %a, <8 x i32> %b) {
1823 ; ALL-LABEL: shuffle_v8i32_10235467:
1825 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,3,5,4,6,7]
1827 %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>
1828 ret <8 x i32> %shuffle
1831 define <8 x i32> @shuffle_v8i32_10225466(<8 x i32> %a, <8 x i32> %b) {
1832 ; ALL-LABEL: shuffle_v8i32_10225466:
1834 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,2,2,5,4,6,6]
1836 %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>
1837 ret <8 x i32> %shuffle
1840 define <8 x i32> @shuffle_v8i32_00015444(<8 x i32> %a, <8 x i32> %b) {
1841 ; AVX1-LABEL: shuffle_v8i32_00015444:
1843 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,1,5,4,4,4]
1846 ; AVX2OR512VL-LABEL: shuffle_v8i32_00015444:
1847 ; AVX2OR512VL: # %bb.0:
1848 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,0,1,5,4,4,4]
1849 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1850 ; AVX2OR512VL-NEXT: retq
1851 %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>
1852 ret <8 x i32> %shuffle
1855 define <8 x i32> @shuffle_v8i32_00204644(<8 x i32> %a, <8 x i32> %b) {
1856 ; AVX1-LABEL: shuffle_v8i32_00204644:
1858 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,0,4,6,4,4]
1861 ; AVX2OR512VL-LABEL: shuffle_v8i32_00204644:
1862 ; AVX2OR512VL: # %bb.0:
1863 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,0,4,6,4,4]
1864 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1865 ; AVX2OR512VL-NEXT: retq
1866 %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>
1867 ret <8 x i32> %shuffle
1870 define <8 x i32> @shuffle_v8i32_03004474(<8 x i32> %a, <8 x i32> %b) {
1871 ; AVX1-LABEL: shuffle_v8i32_03004474:
1873 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,0,0,4,4,7,4]
1876 ; AVX2OR512VL-LABEL: shuffle_v8i32_03004474:
1877 ; AVX2OR512VL: # %bb.0:
1878 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,3,0,0,4,4,7,4]
1879 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1880 ; AVX2OR512VL-NEXT: retq
1881 %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>
1882 ret <8 x i32> %shuffle
1885 define <8 x i32> @shuffle_v8i32_10004444(<8 x i32> %a, <8 x i32> %b) {
1886 ; AVX1-LABEL: shuffle_v8i32_10004444:
1888 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,0,0,4,4,4,4]
1891 ; AVX2OR512VL-LABEL: shuffle_v8i32_10004444:
1892 ; AVX2OR512VL: # %bb.0:
1893 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,0,0,0,4,4,4,4]
1894 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1895 ; AVX2OR512VL-NEXT: retq
1896 %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>
1897 ret <8 x i32> %shuffle
1900 define <8 x i32> @shuffle_v8i32_22006446(<8 x i32> %a, <8 x i32> %b) {
1901 ; AVX1-LABEL: shuffle_v8i32_22006446:
1903 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,2,0,0,6,4,4,6]
1906 ; AVX2OR512VL-LABEL: shuffle_v8i32_22006446:
1907 ; AVX2OR512VL: # %bb.0:
1908 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [2,2,0,0,6,4,4,6]
1909 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1910 ; AVX2OR512VL-NEXT: retq
1911 %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>
1912 ret <8 x i32> %shuffle
1915 define <8 x i32> @shuffle_v8i32_33307474(<8 x i32> %a, <8 x i32> %b) {
1916 ; AVX1-LABEL: shuffle_v8i32_33307474:
1918 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,3,3,0,7,4,7,4]
1921 ; AVX2OR512VL-LABEL: shuffle_v8i32_33307474:
1922 ; AVX2OR512VL: # %bb.0:
1923 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [3,3,3,0,7,4,7,4]
1924 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1925 ; AVX2OR512VL-NEXT: retq
1926 %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>
1927 ret <8 x i32> %shuffle
1930 define <8 x i32> @shuffle_v8i32_32104567(<8 x i32> %a, <8 x i32> %b) {
1931 ; AVX1-LABEL: shuffle_v8i32_32104567:
1933 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,4,5,6,7]
1936 ; AVX2OR512VL-LABEL: shuffle_v8i32_32104567:
1937 ; AVX2OR512VL: # %bb.0:
1938 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [3,2,1,0,4,5,6,7]
1939 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1940 ; AVX2OR512VL-NEXT: retq
1941 %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>
1942 ret <8 x i32> %shuffle
1945 define <8 x i32> @shuffle_v8i32_00236744(<8 x i32> %a, <8 x i32> %b) {
1946 ; AVX1-LABEL: shuffle_v8i32_00236744:
1948 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,3,6,7,4,4]
1951 ; AVX2OR512VL-LABEL: shuffle_v8i32_00236744:
1952 ; AVX2OR512VL: # %bb.0:
1953 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,3,6,7,4,4]
1954 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1955 ; AVX2OR512VL-NEXT: retq
1956 %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>
1957 ret <8 x i32> %shuffle
1960 define <8 x i32> @shuffle_v8i32_00226644(<8 x i32> %a, <8 x i32> %b) {
1961 ; AVX1-LABEL: shuffle_v8i32_00226644:
1963 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,2,6,6,4,4]
1966 ; AVX2OR512VL-LABEL: shuffle_v8i32_00226644:
1967 ; AVX2OR512VL: # %bb.0:
1968 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,0,2,2,6,6,4,4]
1969 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1970 ; AVX2OR512VL-NEXT: retq
1971 %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>
1972 ret <8 x i32> %shuffle
1975 define <8 x i32> @shuffle_v8i32_10324567(<8 x i32> %a, <8 x i32> %b) {
1976 ; AVX1-LABEL: shuffle_v8i32_10324567:
1978 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,6,7]
1981 ; AVX2OR512VL-LABEL: shuffle_v8i32_10324567:
1982 ; AVX2OR512VL: # %bb.0:
1983 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,0,3,2,4,5,6,7]
1984 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
1985 ; AVX2OR512VL-NEXT: retq
1986 %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>
1987 ret <8 x i32> %shuffle
1990 define <8 x i32> @shuffle_v8i32_11334567(<8 x i32> %a, <8 x i32> %b) {
1991 ; AVX1-LABEL: shuffle_v8i32_11334567:
1993 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,4,5,6,7]
1996 ; AVX2OR512VL-LABEL: shuffle_v8i32_11334567:
1997 ; AVX2OR512VL: # %bb.0:
1998 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [1,1,3,3,4,5,6,7]
1999 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2000 ; AVX2OR512VL-NEXT: retq
2001 %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>
2002 ret <8 x i32> %shuffle
2005 define <8 x i32> @shuffle_v8i32_01235467(<8 x i32> %a, <8 x i32> %b) {
2006 ; AVX1-LABEL: shuffle_v8i32_01235467:
2008 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,7]
2011 ; AVX2OR512VL-LABEL: shuffle_v8i32_01235467:
2012 ; AVX2OR512VL: # %bb.0:
2013 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,1,2,3,5,4,6,7]
2014 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2015 ; AVX2OR512VL-NEXT: retq
2016 %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>
2017 ret <8 x i32> %shuffle
2020 define <8 x i32> @shuffle_v8i32_01235466(<8 x i32> %a, <8 x i32> %b) {
2021 ; AVX1-LABEL: shuffle_v8i32_01235466:
2023 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,2,3,5,4,6,6]
2026 ; AVX2OR512VL-LABEL: shuffle_v8i32_01235466:
2027 ; AVX2OR512VL: # %bb.0:
2028 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = [0,1,2,3,5,4,6,6]
2029 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2030 ; AVX2OR512VL-NEXT: retq
2031 %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>
2032 ret <8 x i32> %shuffle
2035 define <8 x i32> @shuffle_v8i32_002u6u44(<8 x i32> %a, <8 x i32> %b) {
2036 ; AVX1-LABEL: shuffle_v8i32_002u6u44:
2038 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,2,u,6,u,4,4]
2041 ; AVX2OR512VL-LABEL: shuffle_v8i32_002u6u44:
2042 ; AVX2OR512VL: # %bb.0:
2043 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,0,2,u,6,u,4,4>
2044 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2045 ; AVX2OR512VL-NEXT: retq
2046 %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>
2047 ret <8 x i32> %shuffle
2050 define <8 x i32> @shuffle_v8i32_00uu66uu(<8 x i32> %a, <8 x i32> %b) {
2051 ; AVX1-LABEL: shuffle_v8i32_00uu66uu:
2053 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,u,u,6,6,u,u]
2056 ; AVX2OR512VL-LABEL: shuffle_v8i32_00uu66uu:
2057 ; AVX2OR512VL: # %bb.0:
2058 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,0,u,u,6,6,u,u>
2059 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2060 ; AVX2OR512VL-NEXT: retq
2061 %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>
2062 ret <8 x i32> %shuffle
2065 define <8 x i32> @shuffle_v8i32_103245uu(<8 x i32> %a, <8 x i32> %b) {
2066 ; AVX1-LABEL: shuffle_v8i32_103245uu:
2068 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,0,3,2,4,5,u,u]
2071 ; AVX2OR512VL-LABEL: shuffle_v8i32_103245uu:
2072 ; AVX2OR512VL: # %bb.0:
2073 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <1,0,3,2,4,5,u,u>
2074 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2075 ; AVX2OR512VL-NEXT: retq
2076 %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>
2077 ret <8 x i32> %shuffle
2080 define <8 x i32> @shuffle_v8i32_1133uu67(<8 x i32> %a, <8 x i32> %b) {
2081 ; AVX1-LABEL: shuffle_v8i32_1133uu67:
2083 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,1,3,3,u,u,6,7]
2086 ; AVX2OR512VL-LABEL: shuffle_v8i32_1133uu67:
2087 ; AVX2OR512VL: # %bb.0:
2088 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <1,1,3,3,u,u,6,7>
2089 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2090 ; AVX2OR512VL-NEXT: retq
2091 %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>
2092 ret <8 x i32> %shuffle
2095 define <8 x i32> @shuffle_v8i32_0uu354uu(<8 x i32> %a, <8 x i32> %b) {
2096 ; AVX1-LABEL: shuffle_v8i32_0uu354uu:
2098 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,u,u,3,5,4,u,u]
2101 ; AVX2OR512VL-LABEL: shuffle_v8i32_0uu354uu:
2102 ; AVX2OR512VL: # %bb.0:
2103 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <0,u,u,3,5,4,u,u>
2104 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2105 ; AVX2OR512VL-NEXT: retq
2106 %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>
2107 ret <8 x i32> %shuffle
2110 define <8 x i32> @shuffle_v8i32_uuu3uu66(<8 x i32> %a, <8 x i32> %b) {
2111 ; AVX1-LABEL: shuffle_v8i32_uuu3uu66:
2113 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[u,u,u,3,u,u,6,6]
2116 ; AVX2OR512VL-LABEL: shuffle_v8i32_uuu3uu66:
2117 ; AVX2OR512VL: # %bb.0:
2118 ; AVX2OR512VL-NEXT: vmovaps {{.*#+}} ymm1 = <u,u,u,3,u,u,6,6>
2119 ; AVX2OR512VL-NEXT: vpermps %ymm0, %ymm1, %ymm0
2120 ; AVX2OR512VL-NEXT: retq
2121 %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>
2122 ret <8 x i32> %shuffle
2125 define <8 x i32> @shuffle_v8i32_6caa87e5(<8 x i32> %a, <8 x i32> %b) {
2126 ; AVX1-LABEL: shuffle_v8i32_6caa87e5:
2128 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
2129 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2130 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3,0,1]
2131 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm2[0,0],ymm1[2,2],ymm2[4,4],ymm1[6,6]
2132 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2135 ; AVX2-SLOW-LABEL: shuffle_v8i32_6caa87e5:
2136 ; AVX2-SLOW: # %bb.0:
2137 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,3,2]
2138 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[0,0,2,2,4,4,6,6]
2139 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,1,0,3]
2140 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2141 ; AVX2-SLOW-NEXT: retq
2143 ; AVX2-FAST-LABEL: shuffle_v8i32_6caa87e5:
2144 ; AVX2-FAST: # %bb.0:
2145 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [4,4,2,2,0,0,6,6]
2146 ; AVX2-FAST-NEXT: vpermps %ymm1, %ymm2, %ymm1
2147 ; AVX2-FAST-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,3,2]
2148 ; AVX2-FAST-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3,4],ymm0[5],ymm1[6],ymm0[7]
2149 ; AVX2-FAST-NEXT: retq
2151 ; AVX512VL-LABEL: shuffle_v8i32_6caa87e5:
2152 ; AVX512VL: # %bb.0:
2153 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [14,4,2,2,0,15,6,13]
2154 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2155 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
2156 ; AVX512VL-NEXT: retq
2157 %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>
2158 ret <8 x i32> %shuffle
2161 define <8 x i32> @shuffle_v8i32_32103210(<8 x i32> %a, <8 x i32> %b) {
2162 ; AVX1-LABEL: shuffle_v8i32_32103210:
2164 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2165 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2168 ; AVX2-SLOW-LABEL: shuffle_v8i32_32103210:
2169 ; AVX2-SLOW: # %bb.0:
2170 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2171 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
2172 ; AVX2-SLOW-NEXT: retq
2174 ; AVX2-FAST-LABEL: shuffle_v8i32_32103210:
2175 ; AVX2-FAST: # %bb.0:
2176 ; AVX2-FAST-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
2177 ; AVX2-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2178 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2179 ; AVX2-FAST-NEXT: retq
2181 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_32103210:
2182 ; AVX512VL-SLOW: # %bb.0:
2183 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,2,1,0]
2184 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
2185 ; AVX512VL-SLOW-NEXT: retq
2187 ; AVX512VL-FAST-LABEL: shuffle_v8i32_32103210:
2188 ; AVX512VL-FAST: # %bb.0:
2189 ; AVX512VL-FAST-NEXT: vbroadcasti128 {{.*#+}} ymm1 = [3,2,1,0,3,2,1,0]
2190 ; AVX512VL-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2191 ; AVX512VL-FAST-NEXT: vpermd %ymm0, %ymm1, %ymm0
2192 ; AVX512VL-FAST-NEXT: retq
2193 %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>
2194 ret <8 x i32> %shuffle
2197 define <8 x i32> @shuffle_v8i32_76547654(<8 x i32> %a, <8 x i32> %b) {
2198 ; AVX1-LABEL: shuffle_v8i32_76547654:
2200 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2201 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2204 ; AVX2-SLOW-LABEL: shuffle_v8i32_76547654:
2205 ; AVX2-SLOW: # %bb.0:
2206 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2207 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
2208 ; AVX2-SLOW-NEXT: retq
2210 ; AVX2-FAST-LABEL: shuffle_v8i32_76547654:
2211 ; AVX2-FAST: # %bb.0:
2212 ; AVX2-FAST-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
2213 ; AVX2-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2214 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2215 ; AVX2-FAST-NEXT: retq
2217 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_76547654:
2218 ; AVX512VL-SLOW: # %bb.0:
2219 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2220 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,2,3]
2221 ; AVX512VL-SLOW-NEXT: retq
2223 ; AVX512VL-FAST-LABEL: shuffle_v8i32_76547654:
2224 ; AVX512VL-FAST: # %bb.0:
2225 ; AVX512VL-FAST-NEXT: vbroadcasti128 {{.*#+}} ymm1 = [7,6,5,4,7,6,5,4]
2226 ; AVX512VL-FAST-NEXT: # ymm1 = mem[0,1,0,1]
2227 ; AVX512VL-FAST-NEXT: vpermd %ymm0, %ymm1, %ymm0
2228 ; AVX512VL-FAST-NEXT: retq
2229 %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>
2230 ret <8 x i32> %shuffle
2233 define <8 x i32> @shuffle_v8i32_76543210(<8 x i32> %a, <8 x i32> %b) {
2234 ; AVX1-LABEL: shuffle_v8i32_76543210:
2236 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2237 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
2240 ; AVX2-SLOW-LABEL: shuffle_v8i32_76543210:
2241 ; AVX2-SLOW: # %bb.0:
2242 ; AVX2-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2243 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
2244 ; AVX2-SLOW-NEXT: retq
2246 ; AVX2-FAST-LABEL: shuffle_v8i32_76543210:
2247 ; AVX2-FAST: # %bb.0:
2248 ; AVX2-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
2249 ; AVX2-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2250 ; AVX2-FAST-NEXT: retq
2252 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_76543210:
2253 ; AVX512VL-SLOW: # %bb.0:
2254 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2255 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,1]
2256 ; AVX512VL-SLOW-NEXT: retq
2258 ; AVX512VL-FAST-LABEL: shuffle_v8i32_76543210:
2259 ; AVX512VL-FAST: # %bb.0:
2260 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm1 = [7,6,5,4,3,2,1,0]
2261 ; AVX512VL-FAST-NEXT: vpermps %ymm0, %ymm1, %ymm0
2262 ; AVX512VL-FAST-NEXT: retq
2263 %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>
2264 ret <8 x i32> %shuffle
2267 define <8 x i32> @shuffle_v8i32_3210ba98(<8 x i32> %a, <8 x i32> %b) {
2268 ; AVX1OR2-LABEL: shuffle_v8i32_3210ba98:
2270 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2271 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2272 ; AVX1OR2-NEXT: retq
2274 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_3210ba98:
2275 ; AVX512VL-SLOW: # %bb.0:
2276 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2277 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2278 ; AVX512VL-SLOW-NEXT: retq
2280 ; AVX512VL-FAST-LABEL: shuffle_v8i32_3210ba98:
2281 ; AVX512VL-FAST: # %bb.0:
2282 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,11,10,9,8]
2283 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
2284 ; AVX512VL-FAST-NEXT: retq
2285 %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>
2286 ret <8 x i32> %shuffle
2289 define <8 x i32> @shuffle_v8i32_3210fedc(<8 x i32> %a, <8 x i32> %b) {
2290 ; AVX1OR2-LABEL: shuffle_v8i32_3210fedc:
2292 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2293 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2294 ; AVX1OR2-NEXT: retq
2296 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_3210fedc:
2297 ; AVX512VL-SLOW: # %bb.0:
2298 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2299 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2300 ; AVX512VL-SLOW-NEXT: retq
2302 ; AVX512VL-FAST-LABEL: shuffle_v8i32_3210fedc:
2303 ; AVX512VL-FAST: # %bb.0:
2304 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
2305 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
2306 ; AVX512VL-FAST-NEXT: retq
2307 %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>
2308 ret <8 x i32> %shuffle
2311 define <8 x i32> @shuffle_v8i32_7654fedc(<8 x i32> %a, <8 x i32> %b) {
2312 ; AVX1OR2-LABEL: shuffle_v8i32_7654fedc:
2314 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2315 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2316 ; AVX1OR2-NEXT: retq
2318 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_7654fedc:
2319 ; AVX512VL-SLOW: # %bb.0:
2320 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2321 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2322 ; AVX512VL-SLOW-NEXT: retq
2324 ; AVX512VL-FAST-LABEL: shuffle_v8i32_7654fedc:
2325 ; AVX512VL-FAST: # %bb.0:
2326 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
2327 ; AVX512VL-FAST-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
2328 ; AVX512VL-FAST-NEXT: retq
2329 %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>
2330 ret <8 x i32> %shuffle
2333 define <8 x i32> @shuffle_v8i32_fedc7654(<8 x i32> %a, <8 x i32> %b) {
2334 ; AVX1OR2-LABEL: shuffle_v8i32_fedc7654:
2336 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
2337 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2338 ; AVX1OR2-NEXT: retq
2340 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_fedc7654:
2341 ; AVX512VL-SLOW: # %bb.0:
2342 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm1[2,3],ymm0[2,3]
2343 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2344 ; AVX512VL-SLOW-NEXT: retq
2346 ; AVX512VL-FAST-LABEL: shuffle_v8i32_fedc7654:
2347 ; AVX512VL-FAST: # %bb.0:
2348 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [7,6,5,4,15,14,13,12]
2349 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2350 ; AVX512VL-FAST-NEXT: vmovdqa %ymm2, %ymm0
2351 ; AVX512VL-FAST-NEXT: retq
2352 %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>
2353 ret <8 x i32> %shuffle
2356 define <8 x i32> @shuffle_v8i32_ba987654(<8 x i32> %a, <8 x i32> %b) {
2357 ; AVX1OR2-LABEL: shuffle_v8i32_ba987654:
2359 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2360 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2361 ; AVX1OR2-NEXT: retq
2363 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_ba987654:
2364 ; AVX512VL-SLOW: # %bb.0:
2365 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2366 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2367 ; AVX512VL-SLOW-NEXT: retq
2369 ; AVX512VL-FAST-LABEL: shuffle_v8i32_ba987654:
2370 ; AVX512VL-FAST: # %bb.0:
2371 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
2372 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2373 ; AVX512VL-FAST-NEXT: vmovdqa %ymm2, %ymm0
2374 ; AVX512VL-FAST-NEXT: retq
2375 %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>
2376 ret <8 x i32> %shuffle
2379 define <8 x i32> @shuffle_v8i32_ba983210(<8 x i32> %a, <8 x i32> %b) {
2380 ; AVX1OR2-LABEL: shuffle_v8i32_ba983210:
2382 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2383 ; AVX1OR2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2384 ; AVX1OR2-NEXT: retq
2386 ; AVX512VL-SLOW-LABEL: shuffle_v8i32_ba983210:
2387 ; AVX512VL-SLOW: # %bb.0:
2388 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2389 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2390 ; AVX512VL-SLOW-NEXT: retq
2392 ; AVX512VL-FAST-LABEL: shuffle_v8i32_ba983210:
2393 ; AVX512VL-FAST: # %bb.0:
2394 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,1,0,15,14,13,12]
2395 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2396 ; AVX512VL-FAST-NEXT: vmovdqa %ymm2, %ymm0
2397 ; AVX512VL-FAST-NEXT: retq
2398 %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>
2399 ret <8 x i32> %shuffle
2402 define <8 x i32> @shuffle_v8i32_zuu8zuuc(<8 x i32> %a) {
2403 ; AVX1-LABEL: shuffle_v8i32_zuu8zuuc:
2405 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2406 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,0],ymm1[4,5],ymm0[6,4]
2409 ; AVX2OR512VL-LABEL: shuffle_v8i32_zuu8zuuc:
2410 ; AVX2OR512VL: # %bb.0:
2411 ; 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]
2412 ; AVX2OR512VL-NEXT: retq
2413 %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>
2414 ret <8 x i32> %shuffle
2417 define <8 x i32> @shuffle_v8i32_9ubzdefz(<8 x i32> %a) {
2418 ; AVX1-LABEL: shuffle_v8i32_9ubzdefz:
2420 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2421 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[3,0],ymm0[3,0],ymm1[7,4],ymm0[7,4]
2422 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2425 ; AVX2OR512VL-LABEL: shuffle_v8i32_9ubzdefz:
2426 ; AVX2OR512VL: # %bb.0:
2427 ; 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
2428 ; AVX2OR512VL-NEXT: retq
2429 %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>
2430 ret <8 x i32> %shuffle
2433 define <8 x i32> @shuffle_v8i32_80u1b4uu(<8 x i32> %a, <8 x i32> %b) {
2434 ; ALL-LABEL: shuffle_v8i32_80u1b4uu:
2436 ; ALL-NEXT: vunpcklps {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[1],ymm0[1],ymm1[4],ymm0[4],ymm1[5],ymm0[5]
2438 %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>
2439 ret <8 x i32> %shuffle
2442 define <8 x i32> @shuffle_v8i32_uuuu1111(<8 x i32> %a, <8 x i32> %b) {
2443 ; ALL-LABEL: shuffle_v8i32_uuuu1111:
2445 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
2446 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2448 %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>
2449 ret <8 x i32> %shuffle
2452 define <8 x i32> @shuffle_v8i32_2222uuuu(<8 x i32> %a, <8 x i32> %b) {
2453 ; ALL-LABEL: shuffle_v8i32_2222uuuu:
2455 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,2,2]
2457 %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>
2458 ret <8 x i32> %shuffle
2461 define <8 x i32> @shuffle_v8i32_2A3Buuuu(<8 x i32> %a, <8 x i32> %b) {
2462 ; ALL-LABEL: shuffle_v8i32_2A3Buuuu:
2464 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2466 %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>
2467 ret <8 x i32> %shuffle
2470 define <8 x i32> @shuffle_v8i32_44444444(<8 x i32> %a, <8 x i32> %b) {
2471 ; AVX1-LABEL: shuffle_v8i32_44444444:
2473 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,0,0,4,4,4,4]
2474 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
2477 ; AVX2OR512VL-LABEL: shuffle_v8i32_44444444:
2478 ; AVX2OR512VL: # %bb.0:
2479 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
2480 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2481 ; AVX2OR512VL-NEXT: retq
2482 %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>
2483 ret <8 x i32> %shuffle
2486 define <8 x i32> @shuffle_v8i32_44444444_bc(<8 x float> %a, <8 x float> %b) {
2487 ; AVX1-LABEL: shuffle_v8i32_44444444_bc:
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_bc:
2494 ; AVX2OR512VL: # %bb.0:
2495 ; AVX2OR512VL-NEXT: vextractf128 $1, %ymm0, %xmm0
2496 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2497 ; AVX2OR512VL-NEXT: retq
2498 %tmp0 = bitcast <8 x float> %a to <8 x i32>
2499 %tmp1 = bitcast <8 x float> %b to <8 x i32>
2500 %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>
2501 ret <8 x i32> %shuffle
2504 define <8 x i32> @shuffle_v8i32_5555uuuu(<8 x i32> %a, <8 x i32> %b) {
2505 ; ALL-LABEL: shuffle_v8i32_5555uuuu:
2507 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm0
2508 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,1,1]
2510 %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>
2511 ret <8 x i32> %shuffle
2514 define <8 x i32> @shuffle_v8i32_0dcd3f14(<8 x i32> %a, <8 x i32> %b) {
2515 ; AVX1-LABEL: shuffle_v8i32_0dcd3f14:
2517 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
2518 ; AVX1-NEXT: vblendps {{.*#+}} xmm2 = xmm2[0],xmm0[1,2,3]
2519 ; AVX1-NEXT: vpermilps {{.*#+}} xmm2 = xmm2[3,1,1,0]
2520 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
2521 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm1[2,3,2,3]
2522 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,3,2]
2523 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5],ymm0[6,7]
2526 ; AVX2-LABEL: shuffle_v8i32_0dcd3f14:
2528 ; AVX2-NEXT: vmovaps {{.*#+}} ymm2 = <0,u,u,u,3,u,1,4>
2529 ; AVX2-NEXT: vpermps %ymm0, %ymm2, %ymm0
2530 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[2,2,3,3]
2531 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3],ymm0[4],ymm1[5],ymm0[6,7]
2534 ; AVX512VL-LABEL: shuffle_v8i32_0dcd3f14:
2535 ; AVX512VL: # %bb.0:
2536 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [8,5,4,5,11,7,9,12]
2537 ; AVX512VL-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
2538 ; AVX512VL-NEXT: vmovdqa %ymm2, %ymm0
2539 ; AVX512VL-NEXT: retq
2540 %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>
2541 ret <8 x i32> %shuffle
2545 define <8 x i32> @shuffle_v8i32_uuuuuu7u(<8 x i32> %a, <8 x i32> %b) nounwind {
2546 ; AVX1-LABEL: shuffle_v8i32_uuuuuu7u:
2548 ; AVX1-NEXT: vmovshdup {{.*#+}} ymm0 = ymm0[1,1,3,3,5,5,7,7]
2551 ; AVX2OR512VL-LABEL: shuffle_v8i32_uuuuuu7u:
2552 ; AVX2OR512VL: # %bb.0:
2553 ; AVX2OR512VL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,1,3,3,4,5,7,7]
2554 ; AVX2OR512VL-NEXT: retq
2555 %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>
2556 ret <8 x i32> %shuffle
2559 define <8 x i32> @shuffle_v8i32_32107654_v4i32(<4 x i32> %a, <4 x i32> %b) {
2560 ; ALL-LABEL: shuffle_v8i32_32107654_v4i32:
2562 ; ALL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
2563 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2564 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,2,1,0,7,6,5,4]
2566 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
2567 %2 = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
2568 %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>
2572 define <8 x float> @splat_mem_v8f32_2(float* %p) {
2573 ; ALL-LABEL: splat_mem_v8f32_2:
2575 ; ALL-NEXT: vbroadcastss (%rdi), %ymm0
2577 %1 = load float, float* %p
2578 %2 = insertelement <4 x float> undef, float %1, i32 0
2579 %3 = shufflevector <4 x float> %2, <4 x float> undef, <8 x i32> zeroinitializer
2583 define <8 x float> @splat_v8f32(<4 x float> %r) {
2584 ; AVX1-LABEL: splat_v8f32:
2586 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
2587 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2590 ; AVX2OR512VL-LABEL: splat_v8f32:
2591 ; AVX2OR512VL: # %bb.0:
2592 ; AVX2OR512VL-NEXT: vbroadcastss %xmm0, %ymm0
2593 ; AVX2OR512VL-NEXT: retq
2594 %1 = shufflevector <4 x float> %r, <4 x float> undef, <8 x i32> zeroinitializer
2599 ; Shuffle to logical bit shifts
2602 define <8 x i32> @shuffle_v8i32_z0U2zUz6(<8 x i32> %a) {
2603 ; AVX1-LABEL: shuffle_v8i32_z0U2zUz6:
2605 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2606 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2607 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,0,3,1,6,4,7,5]
2610 ; AVX2OR512VL-LABEL: shuffle_v8i32_z0U2zUz6:
2611 ; AVX2OR512VL: # %bb.0:
2612 ; AVX2OR512VL-NEXT: vpsllq $32, %ymm0, %ymm0
2613 ; AVX2OR512VL-NEXT: retq
2614 %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>
2615 ret <8 x i32> %shuffle
2618 define <8 x i32> @shuffle_v8i32_1U3z5zUU(<8 x i32> %a) {
2619 ; AVX1-LABEL: shuffle_v8i32_1U3z5zUU:
2621 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
2622 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2623 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,1,3,4,6,5,7]
2626 ; AVX2OR512VL-LABEL: shuffle_v8i32_1U3z5zUU:
2627 ; AVX2OR512VL: # %bb.0:
2628 ; AVX2OR512VL-NEXT: vpsrlq $32, %ymm0, %ymm0
2629 ; AVX2OR512VL-NEXT: retq
2630 %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>
2631 ret <8 x i32> %shuffle
2634 define <8 x i32> @shuffle_v8i32_B012F456(<8 x i32> %a, <8 x i32> %b) {
2635 ; AVX1-LABEL: shuffle_v8i32_B012F456:
2637 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[3,0],ymm0[0,0],ymm1[7,4],ymm0[4,4]
2638 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[0,2],ymm0[1,2],ymm1[4,6],ymm0[5,6]
2641 ; AVX2OR512VL-LABEL: shuffle_v8i32_B012F456:
2642 ; AVX2OR512VL: # %bb.0:
2643 ; 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]
2644 ; AVX2OR512VL-NEXT: retq
2645 %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>
2646 ret <8 x i32> %shuffle
2649 define <8 x i32> @shuffle_v8i32_1238567C(<8 x i32> %a, <8 x i32> %b) {
2650 ; AVX1-LABEL: shuffle_v8i32_1238567C:
2652 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2653 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2656 ; AVX2OR512VL-LABEL: shuffle_v8i32_1238567C:
2657 ; AVX2OR512VL: # %bb.0:
2658 ; 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]
2659 ; AVX2OR512VL-NEXT: retq
2660 %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>
2661 ret <8 x i32> %shuffle
2664 define <8 x i32> @shuffle_v8i32_9AB0DEF4(<8 x i32> %a, <8 x i32> %b) {
2665 ; AVX1-LABEL: shuffle_v8i32_9AB0DEF4:
2667 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,0],ymm1[3,0],ymm0[4,4],ymm1[7,4]
2668 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,2],ymm0[2,0],ymm1[5,6],ymm0[6,4]
2671 ; AVX2OR512VL-LABEL: shuffle_v8i32_9AB0DEF4:
2672 ; AVX2OR512VL: # %bb.0:
2673 ; 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]
2674 ; AVX2OR512VL-NEXT: retq
2675 %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>
2676 ret <8 x i32> %shuffle
2679 define <8 x i32> @shuffle_v8i32_389A7CDE(<8 x i32> %a, <8 x i32> %b) {
2680 ; AVX1-LABEL: shuffle_v8i32_389A7CDE:
2682 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[3,0],ymm1[0,0],ymm0[7,4],ymm1[4,4]
2683 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,2],ymm1[1,2],ymm0[4,6],ymm1[5,6]
2686 ; AVX2OR512VL-LABEL: shuffle_v8i32_389A7CDE:
2687 ; AVX2OR512VL: # %bb.0:
2688 ; 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]
2689 ; AVX2OR512VL-NEXT: retq
2690 %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>
2691 ret <8 x i32> %shuffle
2694 define <8 x i32> @shuffle_v8i32_30127456(<8 x i32> %a, <8 x i32> %b) {
2695 ; ALL-LABEL: shuffle_v8i32_30127456:
2697 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[3,0,1,2,7,4,5,6]
2699 %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>
2700 ret <8 x i32> %shuffle
2703 define <8 x i32> @shuffle_v8i32_12305674(<8 x i32> %a, <8 x i32> %b) {
2704 ; ALL-LABEL: shuffle_v8i32_12305674:
2706 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[1,2,3,0,5,6,7,4]
2708 %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>
2709 ret <8 x i32> %shuffle
2712 define <8x float> @concat_v2f32_1(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2713 ; ALL-LABEL: concat_v2f32_1:
2714 ; ALL: # %bb.0: # %entry
2715 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2716 ; ALL-NEXT: vmovhps {{.*#+}} xmm0 = xmm0[0,1],mem[0,1]
2719 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2720 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2721 %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>
2722 %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>
2723 %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>
2724 ret <8 x float> %tmp76
2727 define <8x float> @concat_v2f32_2(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2728 ; ALL-LABEL: concat_v2f32_2:
2729 ; ALL: # %bb.0: # %entry
2730 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2731 ; ALL-NEXT: vmovhps {{.*#+}} xmm0 = xmm0[0,1],mem[0,1]
2734 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2735 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2736 %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>
2737 ret <8 x float> %tmp76
2740 define <8x float> @concat_v2f32_3(<2 x float>* %tmp64, <2 x float>* %tmp65) {
2741 ; ALL-LABEL: concat_v2f32_3:
2742 ; ALL: # %bb.0: # %entry
2743 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
2744 ; ALL-NEXT: vmovhps {{.*#+}} xmm0 = xmm0[0,1],mem[0,1]
2747 %tmp74 = load <2 x float>, <2 x float>* %tmp65, align 8
2748 %tmp72 = load <2 x float>, <2 x float>* %tmp64, align 8
2749 %tmp76 = shufflevector <2 x float> %tmp72, <2 x float> %tmp74, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2750 %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>
2751 ret <8 x float> %res
2754 define <8 x i32> @insert_mem_and_zero_v8i32(i32* %ptr) {
2755 ; ALL-LABEL: insert_mem_and_zero_v8i32:
2757 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
2759 %a = load i32, i32* %ptr
2760 %v = insertelement <8 x i32> undef, i32 %a, i32 0
2761 %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>
2762 ret <8 x i32> %shuffle
2765 define <8 x i32> @concat_v8i32_0123CDEF(<8 x i32> %a, <8 x i32> %b) {
2766 ; ALL-LABEL: concat_v8i32_0123CDEF:
2768 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
2770 %alo = shufflevector <8 x i32> %a, <8 x i32> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2771 %bhi = shufflevector <8 x i32> %b, <8 x i32> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2772 %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>
2776 define <8 x i32> @concat_v8i32_4567CDEF_bc(<8 x i32> %a0, <8 x i32> %a1) {
2777 ; AVX1OR2-LABEL: concat_v8i32_4567CDEF_bc:
2779 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2780 ; AVX1OR2-NEXT: retq
2782 ; AVX512VL-LABEL: concat_v8i32_4567CDEF_bc:
2783 ; AVX512VL: # %bb.0:
2784 ; AVX512VL-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2785 ; AVX512VL-NEXT: retq
2786 %a0hi = shufflevector <8 x i32> %a0, <8 x i32> %a1, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2787 %a1hi = shufflevector <8 x i32> %a0, <8 x i32> %a1, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
2788 %bc0hi = bitcast <4 x i32> %a0hi to <2 x i64>
2789 %bc1hi = bitcast <4 x i32> %a1hi to <2 x i64>
2790 %shuffle64 = shufflevector <2 x i64> %bc0hi, <2 x i64> %bc1hi, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
2791 %shuffle32 = bitcast <4 x i64> %shuffle64 to <8 x i32>
2792 ret <8 x i32> %shuffle32
2795 define <8 x float> @concat_v8f32_4567CDEF_bc(<8 x float> %f0, <8 x float> %f1) {
2796 ; ALL-LABEL: concat_v8f32_4567CDEF_bc:
2798 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
2800 %a0 = bitcast <8 x float> %f0 to <4 x i64>
2801 %a1 = bitcast <8 x float> %f1 to <8 x i32>
2802 %a0hi = shufflevector <4 x i64> %a0, <4 x i64> undef, <2 x i32> <i32 2, i32 3>
2803 %a1hi = shufflevector <8 x i32> %a1, <8 x i32> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
2804 %bc0hi = bitcast <2 x i64> %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 float>
2808 ret <8 x float> %shuffle32
2811 define <8 x i32> @insert_dup_mem_v8i32(i32* %ptr) {
2812 ; ALL-LABEL: insert_dup_mem_v8i32:
2814 ; ALL-NEXT: vbroadcastss (%rdi), %ymm0
2816 %tmp = load i32, i32* %ptr, align 4
2817 %tmp1 = insertelement <4 x i32> zeroinitializer, i32 %tmp, i32 0
2818 %tmp2 = shufflevector <4 x i32> %tmp1, <4 x i32> undef, <8 x i32> zeroinitializer
2822 define <8 x i32> @shuffle_v8i32_12345678(<8 x i32> %a, <8 x i32> %b) {
2823 ; AVX1-LABEL: shuffle_v8i32_12345678:
2825 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
2826 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2827 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2830 ; AVX2-LABEL: shuffle_v8i32_12345678:
2832 ; AVX2-NEXT: vperm2i128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
2833 ; 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]
2836 ; AVX512VL-LABEL: shuffle_v8i32_12345678:
2837 ; AVX512VL: # %bb.0:
2838 ; AVX512VL-NEXT: valignd {{.*#+}} ymm0 = ymm0[1,2,3,4,5,6,7],ymm1[0]
2839 ; AVX512VL-NEXT: retq
2840 %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>
2841 ret <8 x i32> %shuffle
2844 define <8 x i32> @shuffle_v8i32_12345670(<8 x i32> %a) {
2845 ; AVX1-LABEL: shuffle_v8i32_12345670:
2847 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
2848 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm1[0,0],ymm0[3,0],ymm1[4,4],ymm0[7,4]
2849 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,2],ymm1[2,0],ymm0[5,6],ymm1[6,4]
2852 ; AVX2-LABEL: shuffle_v8i32_12345670:
2854 ; AVX2-NEXT: vmovaps {{.*#+}} ymm1 = [1,2,3,4,5,6,7,0]
2855 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
2858 ; AVX512VL-LABEL: shuffle_v8i32_12345670:
2859 ; AVX512VL: # %bb.0:
2860 ; AVX512VL-NEXT: valignd {{.*#+}} ymm0 = ymm0[1,2,3,4,5,6,7,0]
2861 ; AVX512VL-NEXT: retq
2862 %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>
2863 ret <8 x i32> %shuffle
2866 define <8 x float> @add_v8f32_02468ACE_13579BDF(<8 x float> %a, <8 x float> %b) {
2867 ; AVX1-LABEL: add_v8f32_02468ACE_13579BDF:
2868 ; AVX1: # %bb.0: # %entry
2869 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
2870 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2871 ; AVX1-NEXT: vhaddps %ymm2, %ymm0, %ymm0
2874 ; AVX2-LABEL: add_v8f32_02468ACE_13579BDF:
2875 ; AVX2: # %bb.0: # %entry
2876 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2877 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2878 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2879 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2880 ; AVX2-NEXT: vaddps %ymm0, %ymm2, %ymm0
2883 ; AVX512VL-SLOW-LABEL: add_v8f32_02468ACE_13579BDF:
2884 ; AVX512VL-SLOW: # %bb.0: # %entry
2885 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2886 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2887 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2888 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2889 ; AVX512VL-SLOW-NEXT: vaddps %ymm0, %ymm2, %ymm0
2890 ; AVX512VL-SLOW-NEXT: retq
2892 ; AVX512VL-FAST-LABEL: add_v8f32_02468ACE_13579BDF:
2893 ; AVX512VL-FAST: # %bb.0: # %entry
2894 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2895 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm1, %ymm0, %ymm2
2896 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2897 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm1, %ymm0, %ymm3
2898 ; AVX512VL-FAST-NEXT: vaddps %ymm3, %ymm2, %ymm0
2899 ; AVX512VL-FAST-NEXT: retq
2901 %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>
2902 %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>
2903 %add = fadd <8 x float> %shuffle, %shuffle1
2904 ret <8 x float> %add
2907 define <8 x float> @add_v8f32_8ACE0246_9BDF1357(<8 x float> %a, <8 x float> %b) {
2908 ; AVX1-LABEL: add_v8f32_8ACE0246_9BDF1357:
2909 ; AVX1: # %bb.0: # %entry
2910 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
2911 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2912 ; AVX1-NEXT: vhaddps %ymm2, %ymm0, %ymm0
2915 ; AVX2-LABEL: add_v8f32_8ACE0246_9BDF1357:
2916 ; AVX2: # %bb.0: # %entry
2917 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2918 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2919 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2920 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2921 ; AVX2-NEXT: vaddps %ymm0, %ymm2, %ymm0
2924 ; AVX512VL-SLOW-LABEL: add_v8f32_8ACE0246_9BDF1357:
2925 ; AVX512VL-SLOW: # %bb.0: # %entry
2926 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
2927 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2928 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
2929 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2930 ; AVX512VL-SLOW-NEXT: vaddps %ymm0, %ymm2, %ymm0
2931 ; AVX512VL-SLOW-NEXT: retq
2933 ; AVX512VL-FAST-LABEL: add_v8f32_8ACE0246_9BDF1357:
2934 ; AVX512VL-FAST: # %bb.0: # %entry
2935 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2936 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm2
2937 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2938 ; AVX512VL-FAST-NEXT: vpermi2ps %ymm0, %ymm1, %ymm3
2939 ; AVX512VL-FAST-NEXT: vaddps %ymm3, %ymm2, %ymm0
2940 ; AVX512VL-FAST-NEXT: retq
2942 %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>
2943 %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>
2944 %add = fadd <8 x float> %shuffle, %shuffle1
2945 ret <8 x float> %add
2948 define <8 x i32> @add_v8i32_02468ACE_13579BDF(<8 x i32> %a, <8 x i32> %b) {
2949 ; AVX1-LABEL: add_v8i32_02468ACE_13579BDF:
2950 ; AVX1: # %bb.0: # %entry
2951 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
2952 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2953 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
2954 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
2955 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
2956 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
2957 ; AVX1-NEXT: vpaddd %xmm2, %xmm3, %xmm2
2958 ; AVX1-NEXT: vpaddd %xmm0, %xmm1, %xmm0
2959 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
2962 ; AVX2-LABEL: add_v8i32_02468ACE_13579BDF:
2963 ; AVX2: # %bb.0: # %entry
2964 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2965 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2966 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2967 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2968 ; AVX2-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2971 ; AVX512VL-SLOW-LABEL: add_v8i32_02468ACE_13579BDF:
2972 ; AVX512VL-SLOW: # %bb.0: # %entry
2973 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm0[0,2],ymm1[0,2],ymm0[4,6],ymm1[4,6]
2974 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
2975 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm1[1,3],ymm0[5,7],ymm1[5,7]
2976 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
2977 ; AVX512VL-SLOW-NEXT: vpaddd %ymm0, %ymm2, %ymm0
2978 ; AVX512VL-SLOW-NEXT: retq
2980 ; AVX512VL-FAST-LABEL: add_v8i32_02468ACE_13579BDF:
2981 ; AVX512VL-FAST: # %bb.0: # %entry
2982 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
2983 ; AVX512VL-FAST-NEXT: vpermi2d %ymm1, %ymm0, %ymm2
2984 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
2985 ; AVX512VL-FAST-NEXT: vpermi2d %ymm1, %ymm0, %ymm3
2986 ; AVX512VL-FAST-NEXT: vpaddd %ymm3, %ymm2, %ymm0
2987 ; AVX512VL-FAST-NEXT: retq
2989 %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>
2990 %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>
2991 %add = add <8 x i32> %shuffle, %shuffle1
2995 define <8 x i32> @add_v8i32_8ACE0246_9BDF1357(<8 x i32> %a, <8 x i32> %b) {
2996 ; AVX1-LABEL: add_v8i32_8ACE0246_9BDF1357:
2997 ; AVX1: # %bb.0: # %entry
2998 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
2999 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
3000 ; AVX1-NEXT: vshufps {{.*#+}} ymm1 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
3001 ; AVX1-NEXT: vshufps {{.*#+}} ymm0 = ymm0[1,3],ymm2[1,3],ymm0[5,7],ymm2[5,7]
3002 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
3003 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
3004 ; AVX1-NEXT: vpaddd %xmm2, %xmm3, %xmm2
3005 ; AVX1-NEXT: vpaddd %xmm0, %xmm1, %xmm0
3006 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
3009 ; AVX2-LABEL: add_v8i32_8ACE0246_9BDF1357:
3010 ; AVX2: # %bb.0: # %entry
3011 ; AVX2-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
3012 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
3013 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
3014 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
3015 ; AVX2-NEXT: vpaddd %ymm0, %ymm2, %ymm0
3018 ; AVX512VL-SLOW-LABEL: add_v8i32_8ACE0246_9BDF1357:
3019 ; AVX512VL-SLOW: # %bb.0: # %entry
3020 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm2 = ymm1[0,2],ymm0[0,2],ymm1[4,6],ymm0[4,6]
3021 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
3022 ; AVX512VL-SLOW-NEXT: vshufps {{.*#+}} ymm0 = ymm1[1,3],ymm0[1,3],ymm1[5,7],ymm0[5,7]
3023 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
3024 ; AVX512VL-SLOW-NEXT: vpaddd %ymm0, %ymm2, %ymm0
3025 ; AVX512VL-SLOW-NEXT: retq
3027 ; AVX512VL-FAST-LABEL: add_v8i32_8ACE0246_9BDF1357:
3028 ; AVX512VL-FAST: # %bb.0: # %entry
3029 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6,8,10,12,14]
3030 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm2
3031 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7,9,11,13,15]
3032 ; AVX512VL-FAST-NEXT: vpermi2d %ymm0, %ymm1, %ymm3
3033 ; AVX512VL-FAST-NEXT: vpaddd %ymm3, %ymm2, %ymm0
3034 ; AVX512VL-FAST-NEXT: retq
3036 %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>
3037 %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>
3038 %add = add <8 x i32> %shuffle, %shuffle1
3042 ; This test used to crash due to bad handling of concat_vectors after a bitcast
3043 ; in lowerVectorShuffleAsBroadcast.
3044 define <8 x float> @broadcast_concat_crash(<4 x float> %x, <4 x float> %y, float %z) {
3045 ; AVX1-LABEL: broadcast_concat_crash:
3046 ; AVX1: # %bb.0: # %entry
3047 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm1[3,3,1,1]
3048 ; AVX1-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
3049 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
3052 ; AVX2-LABEL: broadcast_concat_crash:
3053 ; AVX2: # %bb.0: # %entry
3054 ; AVX2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3055 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,2,3]
3056 ; AVX2-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,3,3]
3057 ; AVX2-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
3058 ; AVX2-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
3061 ; AVX512VL-SLOW-LABEL: broadcast_concat_crash:
3062 ; AVX512VL-SLOW: # %bb.0: # %entry
3063 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3064 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,2,3]
3065 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[1,1,3,3]
3066 ; AVX512VL-SLOW-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[2,3]
3067 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
3068 ; AVX512VL-SLOW-NEXT: retq
3070 ; AVX512VL-FAST-LABEL: broadcast_concat_crash:
3071 ; AVX512VL-FAST: # %bb.0: # %entry
3072 ; AVX512VL-FAST-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3073 ; AVX512VL-FAST-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,1,2,3]
3074 ; AVX512VL-FAST-NEXT: vmovaps {{.*#+}} xmm1 = [1,4,3,3]
3075 ; AVX512VL-FAST-NEXT: vpermi2ps %xmm2, %xmm0, %xmm1
3076 ; AVX512VL-FAST-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3077 ; AVX512VL-FAST-NEXT: retq
3079 %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>
3080 %bc = bitcast <8 x float> %tmp to <4 x i64>
3081 %tmp1 = extractelement <4 x i64> %bc, i32 3
3082 %tmp2 = bitcast i64 %tmp1 to <2 x float>
3083 %tmp4 = extractelement <2 x float> %tmp2, i32 1
3084 %tmp5 = insertelement <8 x float> undef, float %tmp4, i32 4
3085 %tmp6 = insertelement <8 x float> %tmp5, float %z, i32 5
3086 ret <8 x float> %tmp6
3089 ; PR40434: https://bugs.llvm.org/show_bug.cgi?id=40434
3091 define <8 x i32> @unpckh_v8i32(<8 x i32> %x, <8 x i32> %y) {
3092 ; ALL-LABEL: unpckh_v8i32:
3094 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3095 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3097 %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>
3098 ret <8 x i32> %unpckh
3101 ; Same as above but with floats.
3103 define <8 x float> @unpckh_v8f32(<8 x float> %x, <8 x float> %y) {
3104 ; ALL-LABEL: unpckh_v8f32:
3106 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3107 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3109 %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>
3110 ret <8 x float> %unpckh
3113 ; Alternate form of the above - make sure we don't have conflicting transforms.
3115 define <8 x i32> @blend_perm_v8i32(<8 x i32> %x, <8 x i32> %y) {
3116 ; ALL-LABEL: blend_perm_v8i32:
3118 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3119 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3121 %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>
3122 %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>
3126 ; Same as above but with floats.
3128 define <8 x float> @blend_perm_v8f32(<8 x float> %x, <8 x float> %y) {
3129 ; ALL-LABEL: blend_perm_v8f32:
3131 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
3132 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3134 %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>
3135 %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>
3139 ; Another variation of the above - make sure we don't have conflicting transforms.
3141 define <8 x i32> @unpckh_v8i32_unary(<8 x i32> %x) {
3142 ; ALL-LABEL: unpckh_v8i32_unary:
3144 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1
3145 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3147 %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>
3151 ; Same as above but with floats.
3153 define <8 x float> @unpckh_v8f32_unary(<8 x float> %x) {
3154 ; ALL-LABEL: unpckh_v8f32_unary:
3156 ; ALL-NEXT: vextractf128 $1, %ymm0, %xmm1
3157 ; ALL-NEXT: vunpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3159 %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>
3163 ; FIXME: Why are integer and FP (below) lowering different for AVX1?
3165 define <8 x i32> @lowhalf_v8i32(<8 x i32> %x, <8 x i32> %y) {
3166 ; AVX1-LABEL: lowhalf_v8i32:
3168 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
3169 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm1[0,2,2,2]
3170 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,2,3,3]
3171 ; AVX1-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3]
3174 ; AVX2-LABEL: lowhalf_v8i32:
3176 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
3177 ; AVX2-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [2,6,3,6,2,6,3,6]
3178 ; AVX2-NEXT: # ymm1 = mem[0,1,0,1]
3179 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
3182 ; AVX512VL-LABEL: lowhalf_v8i32:
3183 ; AVX512VL: # %bb.0:
3184 ; AVX512VL-NEXT: vbroadcasti128 {{.*#+}} ymm2 = [2,14,3,14,2,14,3,14]
3185 ; AVX512VL-NEXT: # ymm2 = mem[0,1,0,1]
3186 ; AVX512VL-NEXT: vpermt2d %ymm1, %ymm2, %ymm0
3187 ; AVX512VL-NEXT: retq
3188 %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>
3192 ; FIXME: AVX1 lowering is better than AVX2 (and AVX512?)
3194 define <8 x float> @lowhalf_v8f32(<8 x float> %x, <8 x float> %y) {
3195 ; AVX1-LABEL: lowhalf_v8f32:
3197 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
3198 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[2,3],xmm1[2,2]
3199 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,1,3]
3202 ; AVX2-LABEL: lowhalf_v8f32:
3204 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
3205 ; AVX2-NEXT: vbroadcastf128 {{.*#+}} ymm1 = [2,6,3,6,2,6,3,6]
3206 ; AVX2-NEXT: # ymm1 = mem[0,1,0,1]
3207 ; AVX2-NEXT: vpermps %ymm0, %ymm1, %ymm0
3210 ; AVX512VL-LABEL: lowhalf_v8f32:
3211 ; AVX512VL: # %bb.0:
3212 ; AVX512VL-NEXT: vbroadcasti128 {{.*#+}} ymm2 = [2,14,3,14,2,14,3,14]
3213 ; AVX512VL-NEXT: # ymm2 = mem[0,1,0,1]
3214 ; AVX512VL-NEXT: vpermt2ps %ymm1, %ymm2, %ymm0
3215 ; AVX512VL-NEXT: retq
3216 %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>