1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -ppc-asm-full-reg-names \
3 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64le-unknown-linux-gnu < %s | \
4 ; RUN: FileCheck %s --check-prefix=CHECK-LE-P8
5 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-asm-full-reg-names \
6 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64le-unknown-linux-gnu < %s | \
7 ; RUN: FileCheck %s --check-prefix=CHECK-LE-P9
8 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -ppc-asm-full-reg-names \
9 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu < %s | \
10 ; RUN: FileCheck %s --check-prefix=CHECK-BE-P8
11 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-asm-full-reg-names \
12 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu < %s | \
13 ; RUN: FileCheck %s --check-prefix=CHECK-BE-P9
15 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -ppc-asm-full-reg-names \
16 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64-ibm-aix < %s | \
17 ; RUN: FileCheck %s --check-prefix=CHECK-AIX-64-P8
18 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-asm-full-reg-names \
19 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc64-ibm-aix < %s | \
20 ; RUN: FileCheck %s --check-prefix=CHECK-AIX-64-P9
21 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -ppc-asm-full-reg-names \
22 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc-ibm-aix < %s | \
23 ; RUN: FileCheck %s --check-prefix=CHECK-AIX-32-P8
24 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-asm-full-reg-names \
25 ; RUN: -ppc-vsr-nums-as-vr -mtriple=powerpc-ibm-aix < %s | \
26 ; RUN: FileCheck %s --check-prefix=CHECK-AIX-32-P9
28 define <2 x i64> @test_v16i8_v16i8(i8 %arg1, i8 %arg) {
29 ; CHECK-LE-P8-LABEL: test_v16i8_v16i8:
30 ; CHECK-LE-P8: # %bb.0: # %entry
31 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
32 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
33 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs1, vs0
34 ; CHECK-LE-P8-NEXT: blr
36 ; CHECK-LE-P9-LABEL: test_v16i8_v16i8:
37 ; CHECK-LE-P9: # %bb.0: # %entry
38 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
39 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
40 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs1, vs0
41 ; CHECK-LE-P9-NEXT: blr
43 ; CHECK-BE-P8-LABEL: test_v16i8_v16i8:
44 ; CHECK-BE-P8: # %bb.0: # %entry
45 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
46 ; CHECK-BE-P8-NEXT: mtfprwz f1, r4
47 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
48 ; CHECK-BE-P8-NEXT: blr
50 ; CHECK-BE-P9-LABEL: test_v16i8_v16i8:
51 ; CHECK-BE-P9: # %bb.0: # %entry
52 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
53 ; CHECK-BE-P9-NEXT: mtfprwz f1, r4
54 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
55 ; CHECK-BE-P9-NEXT: blr
57 ; CHECK-AIX-64-P8-LABEL: test_v16i8_v16i8:
58 ; CHECK-AIX-64-P8: # %bb.0: # %entry
59 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
60 ; CHECK-AIX-64-P8-NEXT: mtfprwz f1, r4
61 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
62 ; CHECK-AIX-64-P8-NEXT: blr
64 ; CHECK-AIX-64-P9-LABEL: test_v16i8_v16i8:
65 ; CHECK-AIX-64-P9: # %bb.0: # %entry
66 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
67 ; CHECK-AIX-64-P9-NEXT: mtfprwz f1, r4
68 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
69 ; CHECK-AIX-64-P9-NEXT: blr
71 ; CHECK-AIX-32-P8-LABEL: test_v16i8_v16i8:
72 ; CHECK-AIX-32-P8: # %bb.0: # %entry
73 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
74 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
75 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
76 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
77 ; CHECK-AIX-32-P8-NEXT: stb r4, -32(r1)
78 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
79 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, vs1
80 ; CHECK-AIX-32-P8-NEXT: blr
82 ; CHECK-AIX-32-P9-LABEL: test_v16i8_v16i8:
83 ; CHECK-AIX-32-P9: # %bb.0: # %entry
84 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
85 ; CHECK-AIX-32-P9-NEXT: stb r4, -32(r1)
86 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
87 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
88 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, vs1
89 ; CHECK-AIX-32-P9-NEXT: blr
91 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
92 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
93 %rhs.tmp = insertelement <16 x i8> undef, i8 %arg, i32 0
94 %rhs = bitcast <16 x i8> %rhs.tmp to <2 x i64>
95 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
96 ret <2 x i64> %shuffle
99 define <2 x i64> @test_none_v16i8(i8 %arg1, ptr nocapture noundef readonly %b) {
100 ; CHECK-LE-P8-LABEL: test_none_v16i8:
101 ; CHECK-LE-P8: # %bb.0: # %entry
102 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r4
103 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
104 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
105 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, v2
106 ; CHECK-LE-P8-NEXT: blr
108 ; CHECK-LE-P9-LABEL: test_none_v16i8:
109 ; CHECK-LE-P9: # %bb.0: # %entry
110 ; CHECK-LE-P9-NEXT: lxv v2, 0(r4)
111 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
112 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, v2
113 ; CHECK-LE-P9-NEXT: blr
115 ; CHECK-BE-P8-LABEL: test_none_v16i8:
116 ; CHECK-BE-P8: # %bb.0: # %entry
117 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
118 ; CHECK-BE-P8-NEXT: lxvd2x v2, 0, r4
119 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, vs0
120 ; CHECK-BE-P8-NEXT: blr
122 ; CHECK-BE-P9-LABEL: test_none_v16i8:
123 ; CHECK-BE-P9: # %bb.0: # %entry
124 ; CHECK-BE-P9-NEXT: lxv v2, 0(r4)
125 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
126 ; CHECK-BE-P9-NEXT: xxmrghd v2, v2, vs0
127 ; CHECK-BE-P9-NEXT: blr
129 ; CHECK-AIX-64-P8-LABEL: test_none_v16i8:
130 ; CHECK-AIX-64-P8: # %bb.0: # %entry
131 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
132 ; CHECK-AIX-64-P8-NEXT: lxvd2x v2, 0, r4
133 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, vs0
134 ; CHECK-AIX-64-P8-NEXT: blr
136 ; CHECK-AIX-64-P9-LABEL: test_none_v16i8:
137 ; CHECK-AIX-64-P9: # %bb.0: # %entry
138 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r4)
139 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
140 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v2, vs0
141 ; CHECK-AIX-64-P9-NEXT: blr
143 ; CHECK-AIX-32-P8-LABEL: test_none_v16i8:
144 ; CHECK-AIX-32-P8: # %bb.0: # %entry
145 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
146 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
147 ; CHECK-AIX-32-P8-NEXT: lxvd2x v2, 0, r4
148 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
149 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, v2, vs0
150 ; CHECK-AIX-32-P8-NEXT: blr
152 ; CHECK-AIX-32-P9-LABEL: test_none_v16i8:
153 ; CHECK-AIX-32-P9: # %bb.0: # %entry
154 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
155 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
156 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r4)
157 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, v2, vs0
158 ; CHECK-AIX-32-P9-NEXT: blr
160 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
161 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
162 %rhs = load <2 x i64>, ptr %b, align 4
163 %shuffle = shufflevector <2 x i64> %rhs, <2 x i64> %lhs, <2 x i32> <i32 0, i32 2>
164 ret <2 x i64> %shuffle
167 define <2 x i64> @test_v16i8_none(i8 %arg1, ptr nocapture noundef readonly %b) {
168 ; CHECK-LE-P8-LABEL: test_v16i8_none:
169 ; CHECK-LE-P8: # %bb.0: # %entry
170 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r4
171 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
172 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
173 ; CHECK-LE-P8-NEXT: xxmrgld v2, v2, vs0
174 ; CHECK-LE-P8-NEXT: blr
176 ; CHECK-LE-P9-LABEL: test_v16i8_none:
177 ; CHECK-LE-P9: # %bb.0: # %entry
178 ; CHECK-LE-P9-NEXT: lxv v2, 0(r4)
179 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
180 ; CHECK-LE-P9-NEXT: xxmrgld v2, v2, vs0
181 ; CHECK-LE-P9-NEXT: blr
183 ; CHECK-BE-P8-LABEL: test_v16i8_none:
184 ; CHECK-BE-P8: # %bb.0: # %entry
185 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
186 ; CHECK-BE-P8-NEXT: lxvd2x v2, 0, r4
187 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, v2
188 ; CHECK-BE-P8-NEXT: blr
190 ; CHECK-BE-P9-LABEL: test_v16i8_none:
191 ; CHECK-BE-P9: # %bb.0: # %entry
192 ; CHECK-BE-P9-NEXT: lxv v2, 0(r4)
193 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
194 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, v2
195 ; CHECK-BE-P9-NEXT: blr
197 ; CHECK-AIX-64-P8-LABEL: test_v16i8_none:
198 ; CHECK-AIX-64-P8: # %bb.0: # %entry
199 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
200 ; CHECK-AIX-64-P8-NEXT: lxvd2x v2, 0, r4
201 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, v2
202 ; CHECK-AIX-64-P8-NEXT: blr
204 ; CHECK-AIX-64-P9-LABEL: test_v16i8_none:
205 ; CHECK-AIX-64-P9: # %bb.0: # %entry
206 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r4)
207 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
208 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, v2
209 ; CHECK-AIX-64-P9-NEXT: blr
211 ; CHECK-AIX-32-P8-LABEL: test_v16i8_none:
212 ; CHECK-AIX-32-P8: # %bb.0: # %entry
213 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
214 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
215 ; CHECK-AIX-32-P8-NEXT: lxvd2x v2, 0, r4
216 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
217 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, v2
218 ; CHECK-AIX-32-P8-NEXT: blr
220 ; CHECK-AIX-32-P9-LABEL: test_v16i8_none:
221 ; CHECK-AIX-32-P9: # %bb.0: # %entry
222 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
223 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
224 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r4)
225 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, v2
226 ; CHECK-AIX-32-P9-NEXT: blr
228 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
229 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
230 %rhs = load <2 x i64>, ptr %b, align 4
231 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
232 ret <2 x i64> %shuffle
235 define <2 x i64> @test_v16i8_v8i16(i8 %arg1, i16 %arg) {
236 ; CHECK-LE-P8-LABEL: test_v16i8_v8i16:
237 ; CHECK-LE-P8: # %bb.0: # %entry
238 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
239 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
240 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
241 ; CHECK-LE-P8-NEXT: xxswapd vs1, vs1
242 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs1, vs0
243 ; CHECK-LE-P8-NEXT: blr
245 ; CHECK-LE-P9-LABEL: test_v16i8_v8i16:
246 ; CHECK-LE-P9: # %bb.0: # %entry
247 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
248 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
249 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
250 ; CHECK-LE-P9-NEXT: xxswapd vs1, vs1
251 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs1, vs0
252 ; CHECK-LE-P9-NEXT: blr
254 ; CHECK-BE-P8-LABEL: test_v16i8_v8i16:
255 ; CHECK-BE-P8: # %bb.0: # %entry
256 ; CHECK-BE-P8-NEXT: sldi r3, r3, 56
257 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
258 ; CHECK-BE-P8-NEXT: sldi r3, r4, 48
259 ; CHECK-BE-P8-NEXT: mtfprd f1, r3
260 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
261 ; CHECK-BE-P8-NEXT: blr
263 ; CHECK-BE-P9-LABEL: test_v16i8_v8i16:
264 ; CHECK-BE-P9: # %bb.0: # %entry
265 ; CHECK-BE-P9-NEXT: sldi r3, r3, 56
266 ; CHECK-BE-P9-NEXT: mtfprd f0, r3
267 ; CHECK-BE-P9-NEXT: sldi r3, r4, 48
268 ; CHECK-BE-P9-NEXT: mtfprd f1, r3
269 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
270 ; CHECK-BE-P9-NEXT: blr
272 ; CHECK-AIX-64-P8-LABEL: test_v16i8_v8i16:
273 ; CHECK-AIX-64-P8: # %bb.0: # %entry
274 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 56
275 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
276 ; CHECK-AIX-64-P8-NEXT: sldi r3, r4, 48
277 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r3
278 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
279 ; CHECK-AIX-64-P8-NEXT: blr
281 ; CHECK-AIX-64-P9-LABEL: test_v16i8_v8i16:
282 ; CHECK-AIX-64-P9: # %bb.0: # %entry
283 ; CHECK-AIX-64-P9-NEXT: sldi r3, r3, 56
284 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r3
285 ; CHECK-AIX-64-P9-NEXT: sldi r3, r4, 48
286 ; CHECK-AIX-64-P9-NEXT: mtfprd f1, r3
287 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
288 ; CHECK-AIX-64-P9-NEXT: blr
290 ; CHECK-AIX-32-P8-LABEL: test_v16i8_v8i16:
291 ; CHECK-AIX-32-P8: # %bb.0: # %entry
292 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
293 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
294 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
295 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
296 ; CHECK-AIX-32-P8-NEXT: sth r4, -32(r1)
297 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
298 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, vs1
299 ; CHECK-AIX-32-P8-NEXT: blr
301 ; CHECK-AIX-32-P9-LABEL: test_v16i8_v8i16:
302 ; CHECK-AIX-32-P9: # %bb.0: # %entry
303 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
304 ; CHECK-AIX-32-P9-NEXT: sth r4, -32(r1)
305 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
306 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
307 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, vs1
308 ; CHECK-AIX-32-P9-NEXT: blr
310 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
311 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
312 %rhs.tmp = insertelement <8 x i16> undef, i16 %arg, i32 0
313 %rhs = bitcast <8 x i16> %rhs.tmp to <2 x i64>
314 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
315 ret <2 x i64> %shuffle
318 define <2 x i64> @test_v8i16_v16i8(i8 %arg1, i16 %arg) {
319 ; CHECK-LE-P8-LABEL: test_v8i16_v16i8:
320 ; CHECK-LE-P8: # %bb.0: # %entry
321 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
322 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
323 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
324 ; CHECK-LE-P8-NEXT: xxswapd vs1, vs1
325 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, vs1
326 ; CHECK-LE-P8-NEXT: blr
328 ; CHECK-LE-P9-LABEL: test_v8i16_v16i8:
329 ; CHECK-LE-P9: # %bb.0: # %entry
330 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
331 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
332 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
333 ; CHECK-LE-P9-NEXT: xxswapd vs1, vs1
334 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, vs1
335 ; CHECK-LE-P9-NEXT: blr
337 ; CHECK-BE-P8-LABEL: test_v8i16_v16i8:
338 ; CHECK-BE-P8: # %bb.0: # %entry
339 ; CHECK-BE-P8-NEXT: sldi r3, r3, 56
340 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
341 ; CHECK-BE-P8-NEXT: sldi r3, r4, 48
342 ; CHECK-BE-P8-NEXT: mtfprd f1, r3
343 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs1, vs0
344 ; CHECK-BE-P8-NEXT: blr
346 ; CHECK-BE-P9-LABEL: test_v8i16_v16i8:
347 ; CHECK-BE-P9: # %bb.0: # %entry
348 ; CHECK-BE-P9-NEXT: sldi r3, r3, 56
349 ; CHECK-BE-P9-NEXT: mtfprd f0, r3
350 ; CHECK-BE-P9-NEXT: sldi r3, r4, 48
351 ; CHECK-BE-P9-NEXT: mtfprd f1, r3
352 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs1, vs0
353 ; CHECK-BE-P9-NEXT: blr
355 ; CHECK-AIX-64-P8-LABEL: test_v8i16_v16i8:
356 ; CHECK-AIX-64-P8: # %bb.0: # %entry
357 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 56
358 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
359 ; CHECK-AIX-64-P8-NEXT: sldi r3, r4, 48
360 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r3
361 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs1, vs0
362 ; CHECK-AIX-64-P8-NEXT: blr
364 ; CHECK-AIX-64-P9-LABEL: test_v8i16_v16i8:
365 ; CHECK-AIX-64-P9: # %bb.0: # %entry
366 ; CHECK-AIX-64-P9-NEXT: sldi r3, r3, 56
367 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r3
368 ; CHECK-AIX-64-P9-NEXT: sldi r3, r4, 48
369 ; CHECK-AIX-64-P9-NEXT: mtfprd f1, r3
370 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs1, vs0
371 ; CHECK-AIX-64-P9-NEXT: blr
373 ; CHECK-AIX-32-P8-LABEL: test_v8i16_v16i8:
374 ; CHECK-AIX-32-P8: # %bb.0: # %entry
375 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
376 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
377 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
378 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
379 ; CHECK-AIX-32-P8-NEXT: sth r4, -32(r1)
380 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
381 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs1, vs0
382 ; CHECK-AIX-32-P8-NEXT: blr
384 ; CHECK-AIX-32-P9-LABEL: test_v8i16_v16i8:
385 ; CHECK-AIX-32-P9: # %bb.0: # %entry
386 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
387 ; CHECK-AIX-32-P9-NEXT: sth r4, -32(r1)
388 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
389 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
390 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs1, vs0
391 ; CHECK-AIX-32-P9-NEXT: blr
393 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
394 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
395 %rhs.tmp = insertelement <8 x i16> undef, i16 %arg, i32 0
396 %rhs = bitcast <8 x i16> %rhs.tmp to <2 x i64>
397 %shuffle = shufflevector <2 x i64> %rhs, <2 x i64> %lhs, <2 x i32> <i32 0, i32 2>
398 ret <2 x i64> %shuffle
401 define <2 x i64> @test_v8i16_none(i16 %arg1, ptr nocapture noundef readonly %b) {
402 ; CHECK-LE-P8-LABEL: test_v8i16_none:
403 ; CHECK-LE-P8: # %bb.0: # %entry
404 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r4
405 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
406 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
407 ; CHECK-LE-P8-NEXT: xxmrgld v2, v2, vs0
408 ; CHECK-LE-P8-NEXT: blr
410 ; CHECK-LE-P9-LABEL: test_v8i16_none:
411 ; CHECK-LE-P9: # %bb.0: # %entry
412 ; CHECK-LE-P9-NEXT: lxv v2, 0(r4)
413 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
414 ; CHECK-LE-P9-NEXT: xxmrgld v2, v2, vs0
415 ; CHECK-LE-P9-NEXT: blr
417 ; CHECK-BE-P8-LABEL: test_v8i16_none:
418 ; CHECK-BE-P8: # %bb.0: # %entry
419 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
420 ; CHECK-BE-P8-NEXT: lxvd2x v2, 0, r4
421 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, v2
422 ; CHECK-BE-P8-NEXT: blr
424 ; CHECK-BE-P9-LABEL: test_v8i16_none:
425 ; CHECK-BE-P9: # %bb.0: # %entry
426 ; CHECK-BE-P9-NEXT: lxv v2, 0(r4)
427 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
428 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, v2
429 ; CHECK-BE-P9-NEXT: blr
431 ; CHECK-AIX-64-P8-LABEL: test_v8i16_none:
432 ; CHECK-AIX-64-P8: # %bb.0: # %entry
433 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
434 ; CHECK-AIX-64-P8-NEXT: lxvd2x v2, 0, r4
435 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, v2
436 ; CHECK-AIX-64-P8-NEXT: blr
438 ; CHECK-AIX-64-P9-LABEL: test_v8i16_none:
439 ; CHECK-AIX-64-P9: # %bb.0: # %entry
440 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r4)
441 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
442 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, v2
443 ; CHECK-AIX-64-P9-NEXT: blr
445 ; CHECK-AIX-32-P8-LABEL: test_v8i16_none:
446 ; CHECK-AIX-32-P8: # %bb.0: # %entry
447 ; CHECK-AIX-32-P8-NEXT: sth r3, -16(r1)
448 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
449 ; CHECK-AIX-32-P8-NEXT: lxvd2x v2, 0, r4
450 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
451 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, v2
452 ; CHECK-AIX-32-P8-NEXT: blr
454 ; CHECK-AIX-32-P9-LABEL: test_v8i16_none:
455 ; CHECK-AIX-32-P9: # %bb.0: # %entry
456 ; CHECK-AIX-32-P9-NEXT: sth r3, -16(r1)
457 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
458 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r4)
459 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, v2
460 ; CHECK-AIX-32-P9-NEXT: blr
462 %lhs.tmp = insertelement <8 x i16> undef, i16 %arg1, i32 0
463 %lhs = bitcast <8 x i16> %lhs.tmp to <2 x i64>
464 %rhs = load <2 x i64>, ptr %b, align 4
465 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
466 ret <2 x i64> %shuffle
469 define <2 x i64> @test_none_v8i16(i16 %arg1, ptr nocapture noundef readonly %b) {
470 ; CHECK-LE-P8-LABEL: test_none_v8i16:
471 ; CHECK-LE-P8: # %bb.0: # %entry
472 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r4
473 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
474 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
475 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, v2
476 ; CHECK-LE-P8-NEXT: blr
478 ; CHECK-LE-P9-LABEL: test_none_v8i16:
479 ; CHECK-LE-P9: # %bb.0: # %entry
480 ; CHECK-LE-P9-NEXT: lxv v2, 0(r4)
481 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
482 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, v2
483 ; CHECK-LE-P9-NEXT: blr
485 ; CHECK-BE-P8-LABEL: test_none_v8i16:
486 ; CHECK-BE-P8: # %bb.0: # %entry
487 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
488 ; CHECK-BE-P8-NEXT: lxvd2x v2, 0, r4
489 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, vs0
490 ; CHECK-BE-P8-NEXT: blr
492 ; CHECK-BE-P9-LABEL: test_none_v8i16:
493 ; CHECK-BE-P9: # %bb.0: # %entry
494 ; CHECK-BE-P9-NEXT: lxv v2, 0(r4)
495 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
496 ; CHECK-BE-P9-NEXT: xxmrghd v2, v2, vs0
497 ; CHECK-BE-P9-NEXT: blr
499 ; CHECK-AIX-64-P8-LABEL: test_none_v8i16:
500 ; CHECK-AIX-64-P8: # %bb.0: # %entry
501 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
502 ; CHECK-AIX-64-P8-NEXT: lxvd2x v2, 0, r4
503 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, vs0
504 ; CHECK-AIX-64-P8-NEXT: blr
506 ; CHECK-AIX-64-P9-LABEL: test_none_v8i16:
507 ; CHECK-AIX-64-P9: # %bb.0: # %entry
508 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r4)
509 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
510 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v2, vs0
511 ; CHECK-AIX-64-P9-NEXT: blr
513 ; CHECK-AIX-32-P8-LABEL: test_none_v8i16:
514 ; CHECK-AIX-32-P8: # %bb.0: # %entry
515 ; CHECK-AIX-32-P8-NEXT: sth r3, -16(r1)
516 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
517 ; CHECK-AIX-32-P8-NEXT: lxvd2x v2, 0, r4
518 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
519 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, v2, vs0
520 ; CHECK-AIX-32-P8-NEXT: blr
522 ; CHECK-AIX-32-P9-LABEL: test_none_v8i16:
523 ; CHECK-AIX-32-P9: # %bb.0: # %entry
524 ; CHECK-AIX-32-P9-NEXT: sth r3, -16(r1)
525 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
526 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r4)
527 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, v2, vs0
528 ; CHECK-AIX-32-P9-NEXT: blr
530 %lhs.tmp = insertelement <8 x i16> undef, i16 %arg1, i32 0
531 %lhs = bitcast <8 x i16> %lhs.tmp to <2 x i64>
532 %rhs = load <2 x i64>, ptr %b, align 4
533 %shuffle = shufflevector <2 x i64> %rhs, <2 x i64> %lhs, <2 x i32> <i32 0, i32 2>
534 ret <2 x i64> %shuffle
537 define <2 x i64> @test_v16i8_v4i32(i8 %arg1, i32 %arg) {
538 ; CHECK-LE-P8-LABEL: test_v16i8_v4i32:
539 ; CHECK-LE-P8: # %bb.0: # %entry
540 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
541 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
542 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
543 ; CHECK-LE-P8-NEXT: xxswapd vs1, vs1
544 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs1, vs0
545 ; CHECK-LE-P8-NEXT: blr
547 ; CHECK-LE-P9-LABEL: test_v16i8_v4i32:
548 ; CHECK-LE-P9: # %bb.0: # %entry
549 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
550 ; CHECK-LE-P9-NEXT: mtvsrws vs1, r4
551 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
552 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs1, vs0
553 ; CHECK-LE-P9-NEXT: blr
555 ; CHECK-BE-P8-LABEL: test_v16i8_v4i32:
556 ; CHECK-BE-P8: # %bb.0: # %entry
557 ; CHECK-BE-P8-NEXT: sldi r3, r3, 56
558 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
559 ; CHECK-BE-P8-NEXT: sldi r3, r4, 32
560 ; CHECK-BE-P8-NEXT: mtfprd f1, r3
561 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
562 ; CHECK-BE-P8-NEXT: blr
564 ; CHECK-BE-P9-LABEL: test_v16i8_v4i32:
565 ; CHECK-BE-P9: # %bb.0: # %entry
566 ; CHECK-BE-P9-NEXT: sldi r3, r3, 56
567 ; CHECK-BE-P9-NEXT: mtvsrws vs1, r4
568 ; CHECK-BE-P9-NEXT: mtfprd f0, r3
569 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
570 ; CHECK-BE-P9-NEXT: blr
572 ; CHECK-AIX-64-P8-LABEL: test_v16i8_v4i32:
573 ; CHECK-AIX-64-P8: # %bb.0: # %entry
574 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 56
575 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
576 ; CHECK-AIX-64-P8-NEXT: sldi r3, r4, 32
577 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r3
578 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
579 ; CHECK-AIX-64-P8-NEXT: blr
581 ; CHECK-AIX-64-P9-LABEL: test_v16i8_v4i32:
582 ; CHECK-AIX-64-P9: # %bb.0: # %entry
583 ; CHECK-AIX-64-P9-NEXT: sldi r3, r3, 56
584 ; CHECK-AIX-64-P9-NEXT: mtvsrws vs1, r4
585 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r3
586 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
587 ; CHECK-AIX-64-P9-NEXT: blr
589 ; CHECK-AIX-32-P8-LABEL: test_v16i8_v4i32:
590 ; CHECK-AIX-32-P8: # %bb.0: # %entry
591 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
592 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
593 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
594 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
595 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
596 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
597 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, vs1
598 ; CHECK-AIX-32-P8-NEXT: blr
600 ; CHECK-AIX-32-P9-LABEL: test_v16i8_v4i32:
601 ; CHECK-AIX-32-P9: # %bb.0: # %entry
602 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
603 ; CHECK-AIX-32-P9-NEXT: stw r4, -32(r1)
604 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
605 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
606 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, vs1
607 ; CHECK-AIX-32-P9-NEXT: blr
609 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
610 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
611 %rhs.tmp = insertelement <4 x i32> undef, i32 %arg, i32 0
612 %rhs = bitcast <4 x i32> %rhs.tmp to <2 x i64>
613 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
614 ret <2 x i64> %shuffle
617 define <2 x i64> @test_v4i32_v16i8(i8 %arg1, i32 %arg) {
618 ; CHECK-LE-P8-LABEL: test_v4i32_v16i8:
619 ; CHECK-LE-P8: # %bb.0: # %entry
620 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
621 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
622 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
623 ; CHECK-LE-P8-NEXT: xxswapd vs1, vs1
624 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, vs1
625 ; CHECK-LE-P8-NEXT: blr
627 ; CHECK-LE-P9-LABEL: test_v4i32_v16i8:
628 ; CHECK-LE-P9: # %bb.0: # %entry
629 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
630 ; CHECK-LE-P9-NEXT: mtvsrws vs1, r4
631 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
632 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, vs1
633 ; CHECK-LE-P9-NEXT: blr
635 ; CHECK-BE-P8-LABEL: test_v4i32_v16i8:
636 ; CHECK-BE-P8: # %bb.0: # %entry
637 ; CHECK-BE-P8-NEXT: sldi r3, r3, 56
638 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
639 ; CHECK-BE-P8-NEXT: sldi r3, r4, 32
640 ; CHECK-BE-P8-NEXT: mtfprd f1, r3
641 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs1, vs0
642 ; CHECK-BE-P8-NEXT: blr
644 ; CHECK-BE-P9-LABEL: test_v4i32_v16i8:
645 ; CHECK-BE-P9: # %bb.0: # %entry
646 ; CHECK-BE-P9-NEXT: sldi r3, r3, 56
647 ; CHECK-BE-P9-NEXT: mtvsrws vs1, r4
648 ; CHECK-BE-P9-NEXT: mtfprd f0, r3
649 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs1, vs0
650 ; CHECK-BE-P9-NEXT: blr
652 ; CHECK-AIX-64-P8-LABEL: test_v4i32_v16i8:
653 ; CHECK-AIX-64-P8: # %bb.0: # %entry
654 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 56
655 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
656 ; CHECK-AIX-64-P8-NEXT: sldi r3, r4, 32
657 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r3
658 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs1, vs0
659 ; CHECK-AIX-64-P8-NEXT: blr
661 ; CHECK-AIX-64-P9-LABEL: test_v4i32_v16i8:
662 ; CHECK-AIX-64-P9: # %bb.0: # %entry
663 ; CHECK-AIX-64-P9-NEXT: sldi r3, r3, 56
664 ; CHECK-AIX-64-P9-NEXT: mtvsrws vs1, r4
665 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r3
666 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs1, vs0
667 ; CHECK-AIX-64-P9-NEXT: blr
669 ; CHECK-AIX-32-P8-LABEL: test_v4i32_v16i8:
670 ; CHECK-AIX-32-P8: # %bb.0: # %entry
671 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
672 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
673 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
674 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
675 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
676 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
677 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs1, vs0
678 ; CHECK-AIX-32-P8-NEXT: blr
680 ; CHECK-AIX-32-P9-LABEL: test_v4i32_v16i8:
681 ; CHECK-AIX-32-P9: # %bb.0: # %entry
682 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
683 ; CHECK-AIX-32-P9-NEXT: stw r4, -32(r1)
684 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
685 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
686 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs1, vs0
687 ; CHECK-AIX-32-P9-NEXT: blr
689 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
690 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
691 %rhs.tmp = insertelement <4 x i32> undef, i32 %arg, i32 0
692 %rhs = bitcast <4 x i32> %rhs.tmp to <2 x i64>
693 %shuffle = shufflevector <2 x i64> %rhs, <2 x i64> %lhs, <2 x i32> <i32 0, i32 2>
694 ret <2 x i64> %shuffle
697 define <2 x i64> @test_none_v4i32(i32 %arg1, ptr nocapture noundef readonly %b) {
698 ; CHECK-LE-P8-LABEL: test_none_v4i32:
699 ; CHECK-LE-P8: # %bb.0: # %entry
700 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r4
701 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
702 ; CHECK-LE-P8-NEXT: mtfprwz f0, r3
703 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, v2
704 ; CHECK-LE-P8-NEXT: blr
706 ; CHECK-LE-P9-LABEL: test_none_v4i32:
707 ; CHECK-LE-P9: # %bb.0: # %entry
708 ; CHECK-LE-P9-NEXT: lxv v2, 0(r4)
709 ; CHECK-LE-P9-NEXT: mtfprwz f0, r3
710 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, v2
711 ; CHECK-LE-P9-NEXT: blr
713 ; CHECK-BE-P8-LABEL: test_none_v4i32:
714 ; CHECK-BE-P8: # %bb.0: # %entry
715 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
716 ; CHECK-BE-P8-NEXT: lxvd2x v2, 0, r4
717 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, vs0
718 ; CHECK-BE-P8-NEXT: blr
720 ; CHECK-BE-P9-LABEL: test_none_v4i32:
721 ; CHECK-BE-P9: # %bb.0: # %entry
722 ; CHECK-BE-P9-NEXT: lxv v2, 0(r4)
723 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
724 ; CHECK-BE-P9-NEXT: xxmrghd v2, v2, vs0
725 ; CHECK-BE-P9-NEXT: blr
727 ; CHECK-AIX-64-P8-LABEL: test_none_v4i32:
728 ; CHECK-AIX-64-P8: # %bb.0: # %entry
729 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
730 ; CHECK-AIX-64-P8-NEXT: lxvd2x v2, 0, r4
731 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, vs0
732 ; CHECK-AIX-64-P8-NEXT: blr
734 ; CHECK-AIX-64-P9-LABEL: test_none_v4i32:
735 ; CHECK-AIX-64-P9: # %bb.0: # %entry
736 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r4)
737 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
738 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v2, vs0
739 ; CHECK-AIX-64-P9-NEXT: blr
741 ; CHECK-AIX-32-P8-LABEL: test_none_v4i32:
742 ; CHECK-AIX-32-P8: # %bb.0: # %entry
743 ; CHECK-AIX-32-P8-NEXT: stw r3, -16(r1)
744 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
745 ; CHECK-AIX-32-P8-NEXT: lxvd2x v2, 0, r4
746 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
747 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, v2, vs0
748 ; CHECK-AIX-32-P8-NEXT: blr
750 ; CHECK-AIX-32-P9-LABEL: test_none_v4i32:
751 ; CHECK-AIX-32-P9: # %bb.0: # %entry
752 ; CHECK-AIX-32-P9-NEXT: stw r3, -16(r1)
753 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
754 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r4)
755 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, v2, vs0
756 ; CHECK-AIX-32-P9-NEXT: blr
758 %lhs.tmp = insertelement <4 x i32> undef, i32 %arg1, i32 0
759 %lhs = bitcast <4 x i32> %lhs.tmp to <2 x i64>
760 %rhs = load <2 x i64>, ptr %b, align 4
761 %shuffle = shufflevector <2 x i64> %rhs, <2 x i64> %lhs, <2 x i32> <i32 0, i32 2>
762 ret <2 x i64> %shuffle
765 define <2 x i64> @test_v4i32_none(i32 %arg1, ptr nocapture noundef readonly %b) {
766 ; CHECK-LE-P8-LABEL: test_v4i32_none:
767 ; CHECK-LE-P8: # %bb.0: # %entry
768 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r4
769 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
770 ; CHECK-LE-P8-NEXT: mtfprwz f0, r3
771 ; CHECK-LE-P8-NEXT: xxmrgld v2, v2, vs0
772 ; CHECK-LE-P8-NEXT: blr
774 ; CHECK-LE-P9-LABEL: test_v4i32_none:
775 ; CHECK-LE-P9: # %bb.0: # %entry
776 ; CHECK-LE-P9-NEXT: lxv v2, 0(r4)
777 ; CHECK-LE-P9-NEXT: mtfprwz f0, r3
778 ; CHECK-LE-P9-NEXT: xxmrgld v2, v2, vs0
779 ; CHECK-LE-P9-NEXT: blr
781 ; CHECK-BE-P8-LABEL: test_v4i32_none:
782 ; CHECK-BE-P8: # %bb.0: # %entry
783 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
784 ; CHECK-BE-P8-NEXT: lxvd2x v2, 0, r4
785 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, v2
786 ; CHECK-BE-P8-NEXT: blr
788 ; CHECK-BE-P9-LABEL: test_v4i32_none:
789 ; CHECK-BE-P9: # %bb.0: # %entry
790 ; CHECK-BE-P9-NEXT: lxv v2, 0(r4)
791 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
792 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, v2
793 ; CHECK-BE-P9-NEXT: blr
795 ; CHECK-AIX-64-P8-LABEL: test_v4i32_none:
796 ; CHECK-AIX-64-P8: # %bb.0: # %entry
797 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
798 ; CHECK-AIX-64-P8-NEXT: lxvd2x v2, 0, r4
799 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, v2
800 ; CHECK-AIX-64-P8-NEXT: blr
802 ; CHECK-AIX-64-P9-LABEL: test_v4i32_none:
803 ; CHECK-AIX-64-P9: # %bb.0: # %entry
804 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r4)
805 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
806 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, v2
807 ; CHECK-AIX-64-P9-NEXT: blr
809 ; CHECK-AIX-32-P8-LABEL: test_v4i32_none:
810 ; CHECK-AIX-32-P8: # %bb.0: # %entry
811 ; CHECK-AIX-32-P8-NEXT: stw r3, -16(r1)
812 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
813 ; CHECK-AIX-32-P8-NEXT: lxvd2x v2, 0, r4
814 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
815 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, v2
816 ; CHECK-AIX-32-P8-NEXT: blr
818 ; CHECK-AIX-32-P9-LABEL: test_v4i32_none:
819 ; CHECK-AIX-32-P9: # %bb.0: # %entry
820 ; CHECK-AIX-32-P9-NEXT: stw r3, -16(r1)
821 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
822 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r4)
823 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, v2
824 ; CHECK-AIX-32-P9-NEXT: blr
826 %lhs.tmp = insertelement <4 x i32> undef, i32 %arg1, i32 0
827 %lhs = bitcast <4 x i32> %lhs.tmp to <2 x i64>
828 %rhs = load <2 x i64>, ptr %b, align 4
829 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
830 ret <2 x i64> %shuffle
833 define <2 x i64> @test_v16i8_v2i64(i8 %arg1, i64 %arg) {
834 ; CHECK-LE-P8-LABEL: test_v16i8_v2i64:
835 ; CHECK-LE-P8: # %bb.0: # %entry
836 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
837 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
838 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
839 ; CHECK-LE-P8-NEXT: xxswapd v2, vs1
840 ; CHECK-LE-P8-NEXT: xxmrgld v2, v2, vs0
841 ; CHECK-LE-P8-NEXT: blr
843 ; CHECK-LE-P9-LABEL: test_v16i8_v2i64:
844 ; CHECK-LE-P9: # %bb.0: # %entry
845 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
846 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
847 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
848 ; CHECK-LE-P9-NEXT: xxswapd v2, vs1
849 ; CHECK-LE-P9-NEXT: xxmrgld v2, v2, vs0
850 ; CHECK-LE-P9-NEXT: blr
852 ; CHECK-BE-P8-LABEL: test_v16i8_v2i64:
853 ; CHECK-BE-P8: # %bb.0: # %entry
854 ; CHECK-BE-P8-NEXT: sldi r3, r3, 56
855 ; CHECK-BE-P8-NEXT: mtfprd f1, r4
856 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
857 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
858 ; CHECK-BE-P8-NEXT: blr
860 ; CHECK-BE-P9-LABEL: test_v16i8_v2i64:
861 ; CHECK-BE-P9: # %bb.0: # %entry
862 ; CHECK-BE-P9-NEXT: sldi r3, r3, 56
863 ; CHECK-BE-P9-NEXT: mtfprd f1, r4
864 ; CHECK-BE-P9-NEXT: mtfprd f0, r3
865 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
866 ; CHECK-BE-P9-NEXT: blr
868 ; CHECK-AIX-64-P8-LABEL: test_v16i8_v2i64:
869 ; CHECK-AIX-64-P8: # %bb.0: # %entry
870 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 56
871 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r4
872 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
873 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
874 ; CHECK-AIX-64-P8-NEXT: blr
876 ; CHECK-AIX-64-P9-LABEL: test_v16i8_v2i64:
877 ; CHECK-AIX-64-P9: # %bb.0: # %entry
878 ; CHECK-AIX-64-P9-NEXT: sldi r3, r3, 56
879 ; CHECK-AIX-64-P9-NEXT: mtfprd f1, r4
880 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r3
881 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
882 ; CHECK-AIX-64-P9-NEXT: blr
884 ; CHECK-AIX-32-P8-LABEL: test_v16i8_v2i64:
885 ; CHECK-AIX-32-P8: # %bb.0: # %entry
886 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
887 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
888 ; CHECK-AIX-32-P8-NEXT: lxvw4x v2, 0, r3
889 ; CHECK-AIX-32-P8-NEXT: lwz r3, L..C0(r2) # %const.0
890 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
891 ; CHECK-AIX-32-P8-NEXT: stw r5, -48(r1)
892 ; CHECK-AIX-32-P8-NEXT: lxvw4x v3, 0, r3
893 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
894 ; CHECK-AIX-32-P8-NEXT: lxvw4x v4, 0, r3
895 ; CHECK-AIX-32-P8-NEXT: lwz r3, L..C1(r2) # %const.1
896 ; CHECK-AIX-32-P8-NEXT: vperm v2, v2, v4, v3
897 ; CHECK-AIX-32-P8-NEXT: lxvw4x v3, 0, r3
898 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -48
899 ; CHECK-AIX-32-P8-NEXT: lxvw4x v4, 0, r3
900 ; CHECK-AIX-32-P8-NEXT: vperm v2, v2, v4, v3
901 ; CHECK-AIX-32-P8-NEXT: blr
903 ; CHECK-AIX-32-P9-LABEL: test_v16i8_v2i64:
904 ; CHECK-AIX-32-P9: # %bb.0: # %entry
905 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
906 ; CHECK-AIX-32-P9-NEXT: mtfprwz f0, r4
907 ; CHECK-AIX-32-P9-NEXT: lxv v2, -16(r1)
908 ; CHECK-AIX-32-P9-NEXT: xxinsertw v2, vs0, 8
909 ; CHECK-AIX-32-P9-NEXT: mtfprwz f0, r5
910 ; CHECK-AIX-32-P9-NEXT: xxinsertw v2, vs0, 12
911 ; CHECK-AIX-32-P9-NEXT: blr
913 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
914 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
915 %rhs.tmp = insertelement <2 x i64> undef, i64 %arg, i32 0
916 %rhs = bitcast <2 x i64> %rhs.tmp to <2 x i64>
917 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
918 ret <2 x i64> %shuffle
921 define <2 x i64> @test_v2i64_v16i8(i8 %arg1, i64 %arg) {
922 ; CHECK-LE-P8-LABEL: test_v2i64_v16i8:
923 ; CHECK-LE-P8: # %bb.0: # %entry
924 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
925 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
926 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
927 ; CHECK-LE-P8-NEXT: xxswapd v2, vs1
928 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, v2
929 ; CHECK-LE-P8-NEXT: blr
931 ; CHECK-LE-P9-LABEL: test_v2i64_v16i8:
932 ; CHECK-LE-P9: # %bb.0: # %entry
933 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
934 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
935 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
936 ; CHECK-LE-P9-NEXT: xxswapd v2, vs1
937 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, v2
938 ; CHECK-LE-P9-NEXT: blr
940 ; CHECK-BE-P8-LABEL: test_v2i64_v16i8:
941 ; CHECK-BE-P8: # %bb.0: # %entry
942 ; CHECK-BE-P8-NEXT: mtfprd f0, r4
943 ; CHECK-BE-P8-NEXT: xxspltd v2, vs0, 0
944 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
945 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, vs0
946 ; CHECK-BE-P8-NEXT: blr
948 ; CHECK-BE-P9-LABEL: test_v2i64_v16i8:
949 ; CHECK-BE-P9: # %bb.0: # %entry
950 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
951 ; CHECK-BE-P9-NEXT: mtvsrdd v2, r4, r4
952 ; CHECK-BE-P9-NEXT: xxmrghd v2, v2, vs0
953 ; CHECK-BE-P9-NEXT: blr
955 ; CHECK-AIX-64-P8-LABEL: test_v2i64_v16i8:
956 ; CHECK-AIX-64-P8: # %bb.0: # %entry
957 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r4
958 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs0
959 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
960 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, vs0
961 ; CHECK-AIX-64-P8-NEXT: blr
963 ; CHECK-AIX-64-P9-LABEL: test_v2i64_v16i8:
964 ; CHECK-AIX-64-P9: # %bb.0: # %entry
965 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
966 ; CHECK-AIX-64-P9-NEXT: mtvsrdd v2, r4, r4
967 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v2, vs0
968 ; CHECK-AIX-64-P9-NEXT: blr
970 ; CHECK-AIX-32-P8-LABEL: test_v2i64_v16i8:
971 ; CHECK-AIX-32-P8: # %bb.0: # %entry
972 ; CHECK-AIX-32-P8-NEXT: stb r3, -16(r1)
973 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
974 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
975 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
976 ; CHECK-AIX-32-P8-NEXT: stw r5, -32(r1)
977 ; CHECK-AIX-32-P8-NEXT: stw r4, -48(r1)
978 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
979 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -48
980 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs2, 0, r3
981 ; CHECK-AIX-32-P8-NEXT: xxmrghw vs1, vs2, vs1
982 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs1, vs0
983 ; CHECK-AIX-32-P8-NEXT: blr
985 ; CHECK-AIX-32-P9-LABEL: test_v2i64_v16i8:
986 ; CHECK-AIX-32-P9: # %bb.0: # %entry
987 ; CHECK-AIX-32-P9-NEXT: stw r5, -32(r1)
988 ; CHECK-AIX-32-P9-NEXT: stw r4, -48(r1)
989 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
990 ; CHECK-AIX-32-P9-NEXT: lxv vs2, -48(r1)
991 ; CHECK-AIX-32-P9-NEXT: stb r3, -16(r1)
992 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
993 ; CHECK-AIX-32-P9-NEXT: xxmrghw vs1, vs2, vs1
994 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs1, vs0
995 ; CHECK-AIX-32-P9-NEXT: blr
997 %lhs.tmp = insertelement <16 x i8> undef, i8 %arg1, i32 0
998 %lhs = bitcast <16 x i8> %lhs.tmp to <2 x i64>
999 %rhs.tmp = insertelement <2 x i64> undef, i64 %arg, i32 0
1000 %rhs = bitcast <2 x i64> %rhs.tmp to <2 x i64>
1001 %shuffle = shufflevector <2 x i64> %rhs, <2 x i64> %lhs, <2 x i32> <i32 0, i32 2>
1002 ret <2 x i64> %shuffle
1005 define <2 x i64> @test_none_v2i64(ptr nocapture noundef readonly %b, i64 %arg) {
1006 ; CHECK-LE-P8-LABEL: test_none_v2i64:
1007 ; CHECK-LE-P8: # %bb.0: # %entry
1008 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r3
1009 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
1010 ; CHECK-LE-P8-NEXT: mtfprd f0, r4
1011 ; CHECK-LE-P8-NEXT: xxpermdi v2, vs0, v2, 1
1012 ; CHECK-LE-P8-NEXT: blr
1014 ; CHECK-LE-P9-LABEL: test_none_v2i64:
1015 ; CHECK-LE-P9: # %bb.0: # %entry
1016 ; CHECK-LE-P9-NEXT: lxv v2, 0(r3)
1017 ; CHECK-LE-P9-NEXT: mtfprd f0, r4
1018 ; CHECK-LE-P9-NEXT: xxpermdi v2, vs0, v2, 1
1019 ; CHECK-LE-P9-NEXT: blr
1021 ; CHECK-BE-P8-LABEL: test_none_v2i64:
1022 ; CHECK-BE-P8: # %bb.0: # %entry
1023 ; CHECK-BE-P8-NEXT: lxvd2x v2, 0, r3
1024 ; CHECK-BE-P8-NEXT: mtfprd f0, r4
1025 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, vs0
1026 ; CHECK-BE-P8-NEXT: blr
1028 ; CHECK-BE-P9-LABEL: test_none_v2i64:
1029 ; CHECK-BE-P9: # %bb.0: # %entry
1030 ; CHECK-BE-P9-NEXT: lxv v2, 0(r3)
1031 ; CHECK-BE-P9-NEXT: mtfprd f0, r4
1032 ; CHECK-BE-P9-NEXT: xxmrghd v2, v2, vs0
1033 ; CHECK-BE-P9-NEXT: blr
1035 ; CHECK-AIX-64-P8-LABEL: test_none_v2i64:
1036 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1037 ; CHECK-AIX-64-P8-NEXT: lxvd2x v2, 0, r3
1038 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r4
1039 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, vs0
1040 ; CHECK-AIX-64-P8-NEXT: blr
1042 ; CHECK-AIX-64-P9-LABEL: test_none_v2i64:
1043 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1044 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r3)
1045 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r4
1046 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v2, vs0
1047 ; CHECK-AIX-64-P9-NEXT: blr
1049 ; CHECK-AIX-32-P8-LABEL: test_none_v2i64:
1050 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1051 ; CHECK-AIX-32-P8-NEXT: stw r4, -16(r1)
1052 ; CHECK-AIX-32-P8-NEXT: stw r5, -32(r1)
1053 ; CHECK-AIX-32-P8-NEXT: lwz r4, L..C2(r2) # %const.0
1054 ; CHECK-AIX-32-P8-NEXT: lxvw4x v3, 0, r3
1055 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1056 ; CHECK-AIX-32-P8-NEXT: lxvw4x v2, 0, r4
1057 ; CHECK-AIX-32-P8-NEXT: lxvw4x v4, 0, r3
1058 ; CHECK-AIX-32-P8-NEXT: lwz r3, L..C3(r2) # %const.1
1059 ; CHECK-AIX-32-P8-NEXT: vperm v2, v3, v4, v2
1060 ; CHECK-AIX-32-P8-NEXT: lxvw4x v3, 0, r3
1061 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1062 ; CHECK-AIX-32-P8-NEXT: lxvw4x v4, 0, r3
1063 ; CHECK-AIX-32-P8-NEXT: vperm v2, v2, v4, v3
1064 ; CHECK-AIX-32-P8-NEXT: blr
1066 ; CHECK-AIX-32-P9-LABEL: test_none_v2i64:
1067 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1068 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r3)
1069 ; CHECK-AIX-32-P9-NEXT: mtfprwz f0, r4
1070 ; CHECK-AIX-32-P9-NEXT: xxinsertw v2, vs0, 8
1071 ; CHECK-AIX-32-P9-NEXT: mtfprwz f0, r5
1072 ; CHECK-AIX-32-P9-NEXT: xxinsertw v2, vs0, 12
1073 ; CHECK-AIX-32-P9-NEXT: blr
1075 %lhs = load <2 x i64>, ptr %b, align 4
1076 %rhs = insertelement <2 x i64> undef, i64 %arg, i32 0
1077 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1078 ret <2 x i64> %shuffle
1081 define <2 x i64> @test_v2i64_none(ptr nocapture noundef readonly %b, i64 %arg) {
1082 ; CHECK-LE-P8-LABEL: test_v2i64_none:
1083 ; CHECK-LE-P8: # %bb.0: # %entry
1084 ; CHECK-LE-P8-NEXT: lxvd2x vs0, 0, r3
1085 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
1086 ; CHECK-LE-P8-NEXT: mtfprd f0, r4
1087 ; CHECK-LE-P8-NEXT: xxpermdi v2, v2, vs0, 2
1088 ; CHECK-LE-P8-NEXT: blr
1090 ; CHECK-LE-P9-LABEL: test_v2i64_none:
1091 ; CHECK-LE-P9: # %bb.0: # %entry
1092 ; CHECK-LE-P9-NEXT: lxv v2, 0(r3)
1093 ; CHECK-LE-P9-NEXT: mtfprd f0, r4
1094 ; CHECK-LE-P9-NEXT: xxpermdi v2, v2, vs0, 2
1095 ; CHECK-LE-P9-NEXT: blr
1097 ; CHECK-BE-P8-LABEL: test_v2i64_none:
1098 ; CHECK-BE-P8: # %bb.0: # %entry
1099 ; CHECK-BE-P8-NEXT: mtfprd f0, r4
1100 ; CHECK-BE-P8-NEXT: lxvd2x v3, 0, r3
1101 ; CHECK-BE-P8-NEXT: xxspltd v2, vs0, 0
1102 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, v3
1103 ; CHECK-BE-P8-NEXT: blr
1105 ; CHECK-BE-P9-LABEL: test_v2i64_none:
1106 ; CHECK-BE-P9: # %bb.0: # %entry
1107 ; CHECK-BE-P9-NEXT: lxv v2, 0(r3)
1108 ; CHECK-BE-P9-NEXT: mtvsrdd v3, r4, r4
1109 ; CHECK-BE-P9-NEXT: xxmrghd v2, v3, v2
1110 ; CHECK-BE-P9-NEXT: blr
1112 ; CHECK-AIX-64-P8-LABEL: test_v2i64_none:
1113 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1114 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r4
1115 ; CHECK-AIX-64-P8-NEXT: lxvd2x v3, 0, r3
1116 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs0
1117 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, v3
1118 ; CHECK-AIX-64-P8-NEXT: blr
1120 ; CHECK-AIX-64-P9-LABEL: test_v2i64_none:
1121 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1122 ; CHECK-AIX-64-P9-NEXT: lxv v2, 0(r3)
1123 ; CHECK-AIX-64-P9-NEXT: mtvsrdd v3, r4, r4
1124 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v3, v2
1125 ; CHECK-AIX-64-P9-NEXT: blr
1127 ; CHECK-AIX-32-P8-LABEL: test_v2i64_none:
1128 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1129 ; CHECK-AIX-32-P8-NEXT: lxvd2x v2, 0, r3
1130 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1131 ; CHECK-AIX-32-P8-NEXT: stw r5, -16(r1)
1132 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
1133 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1134 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1135 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1136 ; CHECK-AIX-32-P8-NEXT: xxmrghw vs0, vs1, vs0
1137 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, v2
1138 ; CHECK-AIX-32-P8-NEXT: blr
1140 ; CHECK-AIX-32-P9-LABEL: test_v2i64_none:
1141 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1142 ; CHECK-AIX-32-P9-NEXT: lxv v2, 0(r3)
1143 ; CHECK-AIX-32-P9-NEXT: stw r5, -16(r1)
1144 ; CHECK-AIX-32-P9-NEXT: stw r4, -32(r1)
1145 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
1146 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
1147 ; CHECK-AIX-32-P9-NEXT: xxmrghw vs0, vs1, vs0
1148 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, v2
1149 ; CHECK-AIX-32-P9-NEXT: blr
1151 %lhs = load <2 x i64>, ptr %b, align 4
1152 %rhs = insertelement <2 x i64> undef, i64 %arg, i32 0
1153 %shuffle = shufflevector <2 x i64> %rhs, <2 x i64> %lhs, <2 x i32> <i32 0, i32 2>
1154 ret <2 x i64> %shuffle
1157 define <2 x i64> @test_v8i16_v8i16(i16 %arg1, i16 %arg) {
1158 ; CHECK-LE-P8-LABEL: test_v8i16_v8i16:
1159 ; CHECK-LE-P8: # %bb.0: # %entry
1160 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1161 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
1162 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs1, vs0
1163 ; CHECK-LE-P8-NEXT: blr
1165 ; CHECK-LE-P9-LABEL: test_v8i16_v8i16:
1166 ; CHECK-LE-P9: # %bb.0: # %entry
1167 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
1168 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
1169 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs1, vs0
1170 ; CHECK-LE-P9-NEXT: blr
1172 ; CHECK-BE-P8-LABEL: test_v8i16_v8i16:
1173 ; CHECK-BE-P8: # %bb.0: # %entry
1174 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
1175 ; CHECK-BE-P8-NEXT: mtfprwz f1, r4
1176 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
1177 ; CHECK-BE-P8-NEXT: blr
1179 ; CHECK-BE-P9-LABEL: test_v8i16_v8i16:
1180 ; CHECK-BE-P9: # %bb.0: # %entry
1181 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
1182 ; CHECK-BE-P9-NEXT: mtfprwz f1, r4
1183 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
1184 ; CHECK-BE-P9-NEXT: blr
1186 ; CHECK-AIX-64-P8-LABEL: test_v8i16_v8i16:
1187 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1188 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
1189 ; CHECK-AIX-64-P8-NEXT: mtfprwz f1, r4
1190 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
1191 ; CHECK-AIX-64-P8-NEXT: blr
1193 ; CHECK-AIX-64-P9-LABEL: test_v8i16_v8i16:
1194 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1195 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
1196 ; CHECK-AIX-64-P9-NEXT: mtfprwz f1, r4
1197 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
1198 ; CHECK-AIX-64-P9-NEXT: blr
1200 ; CHECK-AIX-32-P8-LABEL: test_v8i16_v8i16:
1201 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1202 ; CHECK-AIX-32-P8-NEXT: sth r3, -16(r1)
1203 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1204 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1205 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1206 ; CHECK-AIX-32-P8-NEXT: sth r4, -32(r1)
1207 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1208 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, vs1
1209 ; CHECK-AIX-32-P8-NEXT: blr
1211 ; CHECK-AIX-32-P9-LABEL: test_v8i16_v8i16:
1212 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1213 ; CHECK-AIX-32-P9-NEXT: sth r3, -16(r1)
1214 ; CHECK-AIX-32-P9-NEXT: sth r4, -32(r1)
1215 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
1216 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
1217 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, vs1
1218 ; CHECK-AIX-32-P9-NEXT: blr
1220 %lhs.tmp = insertelement <8 x i16> undef, i16 %arg1, i32 0
1221 %lhs = bitcast <8 x i16> %lhs.tmp to <2 x i64>
1222 %rhs.tmp = insertelement <8 x i16> undef, i16 %arg, i32 0
1223 %rhs = bitcast <8 x i16> %rhs.tmp to <2 x i64>
1224 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1225 ret <2 x i64> %shuffle
1228 define <2 x i64> @test_v8i16_v4i32(i16 %arg1, i32 %arg) {
1229 ; CHECK-LE-P8-LABEL: test_v8i16_v4i32:
1230 ; CHECK-LE-P8: # %bb.0: # %entry
1231 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1232 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
1233 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
1234 ; CHECK-LE-P8-NEXT: xxswapd vs1, vs1
1235 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs1, vs0
1236 ; CHECK-LE-P8-NEXT: blr
1238 ; CHECK-LE-P9-LABEL: test_v8i16_v4i32:
1239 ; CHECK-LE-P9: # %bb.0: # %entry
1240 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
1241 ; CHECK-LE-P9-NEXT: mtvsrws vs1, r4
1242 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
1243 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs1, vs0
1244 ; CHECK-LE-P9-NEXT: blr
1246 ; CHECK-BE-P8-LABEL: test_v8i16_v4i32:
1247 ; CHECK-BE-P8: # %bb.0: # %entry
1248 ; CHECK-BE-P8-NEXT: sldi r3, r3, 48
1249 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
1250 ; CHECK-BE-P8-NEXT: sldi r3, r4, 32
1251 ; CHECK-BE-P8-NEXT: mtfprd f1, r3
1252 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
1253 ; CHECK-BE-P8-NEXT: blr
1255 ; CHECK-BE-P9-LABEL: test_v8i16_v4i32:
1256 ; CHECK-BE-P9: # %bb.0: # %entry
1257 ; CHECK-BE-P9-NEXT: sldi r3, r3, 48
1258 ; CHECK-BE-P9-NEXT: mtvsrws vs1, r4
1259 ; CHECK-BE-P9-NEXT: mtfprd f0, r3
1260 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
1261 ; CHECK-BE-P9-NEXT: blr
1263 ; CHECK-AIX-64-P8-LABEL: test_v8i16_v4i32:
1264 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1265 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 48
1266 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
1267 ; CHECK-AIX-64-P8-NEXT: sldi r3, r4, 32
1268 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r3
1269 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
1270 ; CHECK-AIX-64-P8-NEXT: blr
1272 ; CHECK-AIX-64-P9-LABEL: test_v8i16_v4i32:
1273 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1274 ; CHECK-AIX-64-P9-NEXT: sldi r3, r3, 48
1275 ; CHECK-AIX-64-P9-NEXT: mtvsrws vs1, r4
1276 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r3
1277 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
1278 ; CHECK-AIX-64-P9-NEXT: blr
1280 ; CHECK-AIX-32-P8-LABEL: test_v8i16_v4i32:
1281 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1282 ; CHECK-AIX-32-P8-NEXT: sth r3, -16(r1)
1283 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1284 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1285 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1286 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
1287 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1288 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, vs1
1289 ; CHECK-AIX-32-P8-NEXT: blr
1291 ; CHECK-AIX-32-P9-LABEL: test_v8i16_v4i32:
1292 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1293 ; CHECK-AIX-32-P9-NEXT: sth r3, -16(r1)
1294 ; CHECK-AIX-32-P9-NEXT: stw r4, -32(r1)
1295 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
1296 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
1297 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, vs1
1298 ; CHECK-AIX-32-P9-NEXT: blr
1300 %lhs.tmp = insertelement <8 x i16> undef, i16 %arg1, i32 0
1301 %lhs = bitcast <8 x i16> %lhs.tmp to <2 x i64>
1302 %rhs.tmp = insertelement <4 x i32> undef, i32 %arg, i32 0
1303 %rhs = bitcast <4 x i32> %rhs.tmp to <2 x i64>
1304 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1305 ret <2 x i64> %shuffle
1308 define <2 x i64> @test_v8i16_v2i64(i16 %arg1, i64 %arg) {
1309 ; CHECK-LE-P8-LABEL: test_v8i16_v2i64:
1310 ; CHECK-LE-P8: # %bb.0: # %entry
1311 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1312 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
1313 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
1314 ; CHECK-LE-P8-NEXT: xxswapd v2, vs1
1315 ; CHECK-LE-P8-NEXT: xxmrgld v2, v2, vs0
1316 ; CHECK-LE-P8-NEXT: blr
1318 ; CHECK-LE-P9-LABEL: test_v8i16_v2i64:
1319 ; CHECK-LE-P9: # %bb.0: # %entry
1320 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
1321 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
1322 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
1323 ; CHECK-LE-P9-NEXT: xxswapd v2, vs1
1324 ; CHECK-LE-P9-NEXT: xxmrgld v2, v2, vs0
1325 ; CHECK-LE-P9-NEXT: blr
1327 ; CHECK-BE-P8-LABEL: test_v8i16_v2i64:
1328 ; CHECK-BE-P8: # %bb.0: # %entry
1329 ; CHECK-BE-P8-NEXT: sldi r3, r3, 48
1330 ; CHECK-BE-P8-NEXT: mtfprd f1, r4
1331 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
1332 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
1333 ; CHECK-BE-P8-NEXT: blr
1335 ; CHECK-BE-P9-LABEL: test_v8i16_v2i64:
1336 ; CHECK-BE-P9: # %bb.0: # %entry
1337 ; CHECK-BE-P9-NEXT: sldi r3, r3, 48
1338 ; CHECK-BE-P9-NEXT: mtfprd f1, r4
1339 ; CHECK-BE-P9-NEXT: mtfprd f0, r3
1340 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
1341 ; CHECK-BE-P9-NEXT: blr
1343 ; CHECK-AIX-64-P8-LABEL: test_v8i16_v2i64:
1344 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1345 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 48
1346 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r4
1347 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
1348 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
1349 ; CHECK-AIX-64-P8-NEXT: blr
1351 ; CHECK-AIX-64-P9-LABEL: test_v8i16_v2i64:
1352 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1353 ; CHECK-AIX-64-P9-NEXT: sldi r3, r3, 48
1354 ; CHECK-AIX-64-P9-NEXT: mtfprd f1, r4
1355 ; CHECK-AIX-64-P9-NEXT: mtfprd f0, r3
1356 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
1357 ; CHECK-AIX-64-P9-NEXT: blr
1359 ; CHECK-AIX-32-P8-LABEL: test_v8i16_v2i64:
1360 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1361 ; CHECK-AIX-32-P8-NEXT: sth r3, -16(r1)
1362 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1363 ; CHECK-AIX-32-P8-NEXT: lxvw4x v2, 0, r3
1364 ; CHECK-AIX-32-P8-NEXT: lwz r3, L..C4(r2) # %const.0
1365 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
1366 ; CHECK-AIX-32-P8-NEXT: stw r5, -48(r1)
1367 ; CHECK-AIX-32-P8-NEXT: lxvw4x v3, 0, r3
1368 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1369 ; CHECK-AIX-32-P8-NEXT: lxvw4x v4, 0, r3
1370 ; CHECK-AIX-32-P8-NEXT: lwz r3, L..C5(r2) # %const.1
1371 ; CHECK-AIX-32-P8-NEXT: vperm v2, v2, v4, v3
1372 ; CHECK-AIX-32-P8-NEXT: lxvw4x v3, 0, r3
1373 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -48
1374 ; CHECK-AIX-32-P8-NEXT: lxvw4x v4, 0, r3
1375 ; CHECK-AIX-32-P8-NEXT: vperm v2, v2, v4, v3
1376 ; CHECK-AIX-32-P8-NEXT: blr
1378 ; CHECK-AIX-32-P9-LABEL: test_v8i16_v2i64:
1379 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1380 ; CHECK-AIX-32-P9-NEXT: sth r3, -16(r1)
1381 ; CHECK-AIX-32-P9-NEXT: mtfprwz f0, r4
1382 ; CHECK-AIX-32-P9-NEXT: lxv v2, -16(r1)
1383 ; CHECK-AIX-32-P9-NEXT: xxinsertw v2, vs0, 8
1384 ; CHECK-AIX-32-P9-NEXT: mtfprwz f0, r5
1385 ; CHECK-AIX-32-P9-NEXT: xxinsertw v2, vs0, 12
1386 ; CHECK-AIX-32-P9-NEXT: blr
1388 %lhs.tmp = insertelement <8 x i16> undef, i16 %arg1, i32 0
1389 %lhs = bitcast <8 x i16> %lhs.tmp to <2 x i64>
1390 %rhs.tmp = insertelement <2 x i64> undef, i64 %arg, i32 0
1391 %rhs = bitcast <2 x i64> %rhs.tmp to <2 x i64>
1392 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1393 ret <2 x i64> %shuffle
1396 define <2 x i64> @test_v4i32_v4i32(i32 %arg1, i32 %arg) {
1397 ; CHECK-LE-P8-LABEL: test_v4i32_v4i32:
1398 ; CHECK-LE-P8: # %bb.0: # %entry
1399 ; CHECK-LE-P8-NEXT: mtfprwz f0, r3
1400 ; CHECK-LE-P8-NEXT: mtfprwz f1, r4
1401 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs1, vs0
1402 ; CHECK-LE-P8-NEXT: blr
1404 ; CHECK-LE-P9-LABEL: test_v4i32_v4i32:
1405 ; CHECK-LE-P9: # %bb.0: # %entry
1406 ; CHECK-LE-P9-NEXT: mtfprwz f0, r3
1407 ; CHECK-LE-P9-NEXT: mtfprwz f1, r4
1408 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs1, vs0
1409 ; CHECK-LE-P9-NEXT: blr
1411 ; CHECK-BE-P8-LABEL: test_v4i32_v4i32:
1412 ; CHECK-BE-P8: # %bb.0: # %entry
1413 ; CHECK-BE-P8-NEXT: mtfprwz f0, r3
1414 ; CHECK-BE-P8-NEXT: mtfprwz f1, r4
1415 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
1416 ; CHECK-BE-P8-NEXT: blr
1418 ; CHECK-BE-P9-LABEL: test_v4i32_v4i32:
1419 ; CHECK-BE-P9: # %bb.0: # %entry
1420 ; CHECK-BE-P9-NEXT: mtfprwz f0, r3
1421 ; CHECK-BE-P9-NEXT: mtfprwz f1, r4
1422 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
1423 ; CHECK-BE-P9-NEXT: blr
1425 ; CHECK-AIX-64-P8-LABEL: test_v4i32_v4i32:
1426 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1427 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r3
1428 ; CHECK-AIX-64-P8-NEXT: mtfprwz f1, r4
1429 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
1430 ; CHECK-AIX-64-P8-NEXT: blr
1432 ; CHECK-AIX-64-P9-LABEL: test_v4i32_v4i32:
1433 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1434 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r3
1435 ; CHECK-AIX-64-P9-NEXT: mtfprwz f1, r4
1436 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
1437 ; CHECK-AIX-64-P9-NEXT: blr
1439 ; CHECK-AIX-32-P8-LABEL: test_v4i32_v4i32:
1440 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1441 ; CHECK-AIX-32-P8-NEXT: stw r3, -16(r1)
1442 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1443 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1444 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1445 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
1446 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1447 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, vs1
1448 ; CHECK-AIX-32-P8-NEXT: blr
1450 ; CHECK-AIX-32-P9-LABEL: test_v4i32_v4i32:
1451 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1452 ; CHECK-AIX-32-P9-NEXT: stw r3, -16(r1)
1453 ; CHECK-AIX-32-P9-NEXT: stw r4, -32(r1)
1454 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
1455 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
1456 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, vs1
1457 ; CHECK-AIX-32-P9-NEXT: blr
1459 %lhs.tmp = insertelement <4 x i32> undef, i32 %arg1, i32 0
1460 %lhs = bitcast <4 x i32> %lhs.tmp to <2 x i64>
1461 %rhs.tmp = insertelement <4 x i32> undef, i32 %arg, i32 0
1462 %rhs = bitcast <4 x i32> %rhs.tmp to <2 x i64>
1463 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1464 ret <2 x i64> %shuffle
1467 define <2 x i64> @test_v4i32_v8i16(i32 %arg1, i16 %arg) {
1468 ; CHECK-LE-P8-LABEL: test_v4i32_v8i16:
1469 ; CHECK-LE-P8: # %bb.0: # %entry
1470 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1471 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
1472 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
1473 ; CHECK-LE-P8-NEXT: xxswapd vs1, vs1
1474 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs1, vs0
1475 ; CHECK-LE-P8-NEXT: blr
1477 ; CHECK-LE-P9-LABEL: test_v4i32_v8i16:
1478 ; CHECK-LE-P9: # %bb.0: # %entry
1479 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
1480 ; CHECK-LE-P9-NEXT: mtvsrws vs0, r3
1481 ; CHECK-LE-P9-NEXT: xxswapd vs1, vs1
1482 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs1, vs0
1483 ; CHECK-LE-P9-NEXT: blr
1485 ; CHECK-BE-P8-LABEL: test_v4i32_v8i16:
1486 ; CHECK-BE-P8: # %bb.0: # %entry
1487 ; CHECK-BE-P8-NEXT: sldi r3, r3, 32
1488 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
1489 ; CHECK-BE-P8-NEXT: sldi r3, r4, 48
1490 ; CHECK-BE-P8-NEXT: mtfprd f1, r3
1491 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
1492 ; CHECK-BE-P8-NEXT: blr
1494 ; CHECK-BE-P9-LABEL: test_v4i32_v8i16:
1495 ; CHECK-BE-P9: # %bb.0: # %entry
1496 ; CHECK-BE-P9-NEXT: mtvsrws vs0, r3
1497 ; CHECK-BE-P9-NEXT: sldi r3, r4, 48
1498 ; CHECK-BE-P9-NEXT: mtfprd f1, r3
1499 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
1500 ; CHECK-BE-P9-NEXT: blr
1502 ; CHECK-AIX-64-P8-LABEL: test_v4i32_v8i16:
1503 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1504 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 32
1505 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
1506 ; CHECK-AIX-64-P8-NEXT: sldi r3, r4, 48
1507 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r3
1508 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
1509 ; CHECK-AIX-64-P8-NEXT: blr
1511 ; CHECK-AIX-64-P9-LABEL: test_v4i32_v8i16:
1512 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1513 ; CHECK-AIX-64-P9-NEXT: mtvsrws vs0, r3
1514 ; CHECK-AIX-64-P9-NEXT: sldi r3, r4, 48
1515 ; CHECK-AIX-64-P9-NEXT: mtfprd f1, r3
1516 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
1517 ; CHECK-AIX-64-P9-NEXT: blr
1519 ; CHECK-AIX-32-P8-LABEL: test_v4i32_v8i16:
1520 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1521 ; CHECK-AIX-32-P8-NEXT: stw r3, -16(r1)
1522 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1523 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1524 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1525 ; CHECK-AIX-32-P8-NEXT: sth r4, -32(r1)
1526 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1527 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs0, vs1
1528 ; CHECK-AIX-32-P8-NEXT: blr
1530 ; CHECK-AIX-32-P9-LABEL: test_v4i32_v8i16:
1531 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1532 ; CHECK-AIX-32-P9-NEXT: stw r3, -16(r1)
1533 ; CHECK-AIX-32-P9-NEXT: sth r4, -32(r1)
1534 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
1535 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
1536 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs0, vs1
1537 ; CHECK-AIX-32-P9-NEXT: blr
1539 %lhs.tmp = insertelement <4 x i32> undef, i32 %arg1, i32 0
1540 %lhs = bitcast <4 x i32> %lhs.tmp to <2 x i64>
1541 %rhs.tmp = insertelement <8 x i16> undef, i16 %arg, i32 0
1542 %rhs = bitcast <8 x i16> %rhs.tmp to <2 x i64>
1543 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1544 ret <2 x i64> %shuffle
1547 define <2 x i64> @test_v4i32_v2i64(i32 %arg1, i64 %arg) {
1548 ; CHECK-LE-P8-LABEL: test_v4i32_v2i64:
1549 ; CHECK-LE-P8: # %bb.0: # %entry
1550 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1551 ; CHECK-LE-P8-NEXT: mtfprd f1, r4
1552 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
1553 ; CHECK-LE-P8-NEXT: xxswapd v2, vs1
1554 ; CHECK-LE-P8-NEXT: xxmrgld v2, v2, vs0
1555 ; CHECK-LE-P8-NEXT: blr
1557 ; CHECK-LE-P9-LABEL: test_v4i32_v2i64:
1558 ; CHECK-LE-P9: # %bb.0: # %entry
1559 ; CHECK-LE-P9-NEXT: mtfprd f1, r4
1560 ; CHECK-LE-P9-NEXT: mtvsrws vs0, r3
1561 ; CHECK-LE-P9-NEXT: xxswapd v2, vs1
1562 ; CHECK-LE-P9-NEXT: xxmrgld v2, v2, vs0
1563 ; CHECK-LE-P9-NEXT: blr
1565 ; CHECK-BE-P8-LABEL: test_v4i32_v2i64:
1566 ; CHECK-BE-P8: # %bb.0: # %entry
1567 ; CHECK-BE-P8-NEXT: sldi r3, r3, 32
1568 ; CHECK-BE-P8-NEXT: mtfprd f1, r4
1569 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
1570 ; CHECK-BE-P8-NEXT: xxmrghd v2, vs0, vs1
1571 ; CHECK-BE-P8-NEXT: blr
1573 ; CHECK-BE-P9-LABEL: test_v4i32_v2i64:
1574 ; CHECK-BE-P9: # %bb.0: # %entry
1575 ; CHECK-BE-P9-NEXT: mtvsrws vs0, r3
1576 ; CHECK-BE-P9-NEXT: mtfprd f1, r4
1577 ; CHECK-BE-P9-NEXT: xxmrghd v2, vs0, vs1
1578 ; CHECK-BE-P9-NEXT: blr
1580 ; CHECK-AIX-64-P8-LABEL: test_v4i32_v2i64:
1581 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1582 ; CHECK-AIX-64-P8-NEXT: sldi r3, r3, 32
1583 ; CHECK-AIX-64-P8-NEXT: mtfprd f1, r4
1584 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
1585 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs1
1586 ; CHECK-AIX-64-P8-NEXT: blr
1588 ; CHECK-AIX-64-P9-LABEL: test_v4i32_v2i64:
1589 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1590 ; CHECK-AIX-64-P9-NEXT: mtvsrws vs0, r3
1591 ; CHECK-AIX-64-P9-NEXT: mtfprd f1, r4
1592 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, vs0, vs1
1593 ; CHECK-AIX-64-P9-NEXT: blr
1595 ; CHECK-AIX-32-P8-LABEL: test_v4i32_v2i64:
1596 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1597 ; CHECK-AIX-32-P8-NEXT: stw r3, -48(r1)
1598 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1599 ; CHECK-AIX-32-P8-NEXT: stw r4, -32(r1)
1600 ; CHECK-AIX-32-P8-NEXT: stw r5, -16(r1)
1601 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1602 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -48
1603 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1604 ; CHECK-AIX-32-P8-NEXT: lwz r3, L..C6(r2) # %const.0
1605 ; CHECK-AIX-32-P8-NEXT: lxvw4x v3, 0, r3
1606 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1607 ; CHECK-AIX-32-P8-NEXT: lxvw4x v4, 0, r3
1608 ; CHECK-AIX-32-P8-NEXT: xxmrghw v2, vs1, vs0
1609 ; CHECK-AIX-32-P8-NEXT: vperm v2, v2, v4, v3
1610 ; CHECK-AIX-32-P8-NEXT: blr
1612 ; CHECK-AIX-32-P9-LABEL: test_v4i32_v2i64:
1613 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1614 ; CHECK-AIX-32-P9-NEXT: stw r4, -32(r1)
1615 ; CHECK-AIX-32-P9-NEXT: stw r3, -48(r1)
1616 ; CHECK-AIX-32-P9-NEXT: lwz r3, L..C0(r2) # %const.0
1617 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -32(r1)
1618 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -48(r1)
1619 ; CHECK-AIX-32-P9-NEXT: stw r5, -16(r1)
1620 ; CHECK-AIX-32-P9-NEXT: lxv v2, -16(r1)
1621 ; CHECK-AIX-32-P9-NEXT: xxmrghw v3, vs1, vs0
1622 ; CHECK-AIX-32-P9-NEXT: lxv vs0, 0(r3)
1623 ; CHECK-AIX-32-P9-NEXT: xxperm v2, v3, vs0
1624 ; CHECK-AIX-32-P9-NEXT: blr
1626 %lhs.tmp = insertelement <4 x i32> undef, i32 %arg1, i32 0
1627 %lhs = bitcast <4 x i32> %lhs.tmp to <2 x i64>
1628 %rhs = insertelement <2 x i64> undef, i64 %arg, i32 0
1629 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1630 ret <2 x i64> %shuffle
1633 define <2 x i64> @test_v2i64_v2i64(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) {
1634 ; CHECK-LE-P8-LABEL: test_v2i64_v2i64:
1635 ; CHECK-LE-P8: # %bb.0: # %entry
1636 ; CHECK-LE-P8-NEXT: ld r3, 0(r3)
1637 ; CHECK-LE-P8-NEXT: lfdx f1, 0, r4
1638 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1639 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
1640 ; CHECK-LE-P8-NEXT: xxmrghd v3, vs1, vs0
1641 ; CHECK-LE-P8-NEXT: vaddudm v2, v3, v2
1642 ; CHECK-LE-P8-NEXT: blr
1644 ; CHECK-LE-P9-LABEL: test_v2i64_v2i64:
1645 ; CHECK-LE-P9: # %bb.0: # %entry
1646 ; CHECK-LE-P9-NEXT: ld r3, 0(r3)
1647 ; CHECK-LE-P9-NEXT: lfd f1, 0(r4)
1648 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
1649 ; CHECK-LE-P9-NEXT: xxswapd v2, vs0
1650 ; CHECK-LE-P9-NEXT: xxmrghd v3, vs1, vs0
1651 ; CHECK-LE-P9-NEXT: vaddudm v2, v3, v2
1652 ; CHECK-LE-P9-NEXT: blr
1654 ; CHECK-BE-P8-LABEL: test_v2i64_v2i64:
1655 ; CHECK-BE-P8: # %bb.0: # %entry
1656 ; CHECK-BE-P8-NEXT: lxsdx v2, 0, r3
1657 ; CHECK-BE-P8-NEXT: lfdx f0, 0, r4
1658 ; CHECK-BE-P8-NEXT: xxmrghd v3, v2, vs0
1659 ; CHECK-BE-P8-NEXT: vaddudm v2, v3, v2
1660 ; CHECK-BE-P8-NEXT: blr
1662 ; CHECK-BE-P9-LABEL: test_v2i64_v2i64:
1663 ; CHECK-BE-P9: # %bb.0: # %entry
1664 ; CHECK-BE-P9-NEXT: lxsd v2, 0(r3)
1665 ; CHECK-BE-P9-NEXT: lfd f0, 0(r4)
1666 ; CHECK-BE-P9-NEXT: xxmrghd v3, v2, vs0
1667 ; CHECK-BE-P9-NEXT: vaddudm v2, v3, v2
1668 ; CHECK-BE-P9-NEXT: blr
1670 ; CHECK-AIX-64-P8-LABEL: test_v2i64_v2i64:
1671 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1672 ; CHECK-AIX-64-P8-NEXT: lxsdx v2, 0, r3
1673 ; CHECK-AIX-64-P8-NEXT: lfdx f0, 0, r4
1674 ; CHECK-AIX-64-P8-NEXT: xxmrghd v3, v2, vs0
1675 ; CHECK-AIX-64-P8-NEXT: vaddudm v2, v3, v2
1676 ; CHECK-AIX-64-P8-NEXT: blr
1678 ; CHECK-AIX-64-P9-LABEL: test_v2i64_v2i64:
1679 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1680 ; CHECK-AIX-64-P9-NEXT: lxsd v2, 0(r3)
1681 ; CHECK-AIX-64-P9-NEXT: lfd f0, 0(r4)
1682 ; CHECK-AIX-64-P9-NEXT: xxmrghd v3, v2, vs0
1683 ; CHECK-AIX-64-P9-NEXT: vaddudm v2, v3, v2
1684 ; CHECK-AIX-64-P9-NEXT: blr
1686 ; CHECK-AIX-32-P8-LABEL: test_v2i64_v2i64:
1687 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1688 ; CHECK-AIX-32-P8-NEXT: lwz r5, 4(r3)
1689 ; CHECK-AIX-32-P8-NEXT: stw r5, -16(r1)
1690 ; CHECK-AIX-32-P8-NEXT: lwz r3, 0(r3)
1691 ; CHECK-AIX-32-P8-NEXT: stw r3, -32(r1)
1692 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1693 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1694 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1695 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1696 ; CHECK-AIX-32-P8-NEXT: lwz r3, 4(r4)
1697 ; CHECK-AIX-32-P8-NEXT: stw r3, -48(r1)
1698 ; CHECK-AIX-32-P8-NEXT: lwz r3, 0(r4)
1699 ; CHECK-AIX-32-P8-NEXT: stw r3, -64(r1)
1700 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -48
1701 ; CHECK-AIX-32-P8-NEXT: xxmrghw v2, vs1, vs0
1702 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r3
1703 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -64
1704 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1705 ; CHECK-AIX-32-P8-NEXT: xxmrghw vs0, vs1, vs0
1706 ; CHECK-AIX-32-P8-NEXT: xxmrghd v3, v2, vs0
1707 ; CHECK-AIX-32-P8-NEXT: vaddudm v2, v3, v2
1708 ; CHECK-AIX-32-P8-NEXT: blr
1710 ; CHECK-AIX-32-P9-LABEL: test_v2i64_v2i64:
1711 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1712 ; CHECK-AIX-32-P9-NEXT: lwz r5, 4(r3)
1713 ; CHECK-AIX-32-P9-NEXT: stw r5, -16(r1)
1714 ; CHECK-AIX-32-P9-NEXT: lwz r3, 0(r3)
1715 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -16(r1)
1716 ; CHECK-AIX-32-P9-NEXT: stw r3, -32(r1)
1717 ; CHECK-AIX-32-P9-NEXT: lwz r3, 4(r4)
1718 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -32(r1)
1719 ; CHECK-AIX-32-P9-NEXT: stw r3, -48(r1)
1720 ; CHECK-AIX-32-P9-NEXT: lwz r3, 0(r4)
1721 ; CHECK-AIX-32-P9-NEXT: xxmrghw v2, vs1, vs0
1722 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -48(r1)
1723 ; CHECK-AIX-32-P9-NEXT: stw r3, -64(r1)
1724 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -64(r1)
1725 ; CHECK-AIX-32-P9-NEXT: xxmrghw vs0, vs1, vs0
1726 ; CHECK-AIX-32-P9-NEXT: xxmrghd v3, v2, vs0
1727 ; CHECK-AIX-32-P9-NEXT: vaddudm v2, v3, v2
1728 ; CHECK-AIX-32-P9-NEXT: blr
1730 %0 = load <8 x i8>, ptr %a, align 8
1731 %bc1 = bitcast <8 x i8> %0 to i64
1732 %vecinit3 = insertelement <2 x i64> poison, i64 %bc1, i64 0
1733 %1 = load <8 x i8>, ptr %b, align 8
1734 %bc2 = bitcast <8 x i8> %1 to i64
1735 %vecinit6 = insertelement <2 x i64> undef, i64 %bc2, i64 0
1736 %2 = bitcast <2 x i64> %vecinit3 to <2 x i64>
1737 %3 = bitcast <2 x i64> %vecinit6 to <2 x i64>
1738 %shuffle = shufflevector <2 x i64> %2, <2 x i64> %3, <2 x i32> <i32 0, i32 2>
1739 %4 = add <2 x i64> %shuffle, %2
1743 define <2 x i64> @test_v2i64_v4i32(i64 %arg1, i32 %arg) {
1744 ; CHECK-LE-P8-LABEL: test_v2i64_v4i32:
1745 ; CHECK-LE-P8: # %bb.0: # %entry
1746 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1747 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
1748 ; CHECK-LE-P8-NEXT: mtfprd f0, r4
1749 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
1750 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, v2
1751 ; CHECK-LE-P8-NEXT: blr
1753 ; CHECK-LE-P9-LABEL: test_v2i64_v4i32:
1754 ; CHECK-LE-P9: # %bb.0: # %entry
1755 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
1756 ; CHECK-LE-P9-NEXT: xxswapd v2, vs0
1757 ; CHECK-LE-P9-NEXT: mtvsrws vs0, r4
1758 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, v2
1759 ; CHECK-LE-P9-NEXT: blr
1761 ; CHECK-BE-P8-LABEL: test_v2i64_v4i32:
1762 ; CHECK-BE-P8: # %bb.0: # %entry
1763 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
1764 ; CHECK-BE-P8-NEXT: xxspltd v2, vs0, 0
1765 ; CHECK-BE-P8-NEXT: mtfprwz f0, r4
1766 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, vs0
1767 ; CHECK-BE-P8-NEXT: blr
1769 ; CHECK-BE-P9-LABEL: test_v2i64_v4i32:
1770 ; CHECK-BE-P9: # %bb.0: # %entry
1771 ; CHECK-BE-P9-NEXT: mtfprwz f0, r4
1772 ; CHECK-BE-P9-NEXT: mtvsrdd v2, r3, r3
1773 ; CHECK-BE-P9-NEXT: xxmrghd v2, v2, vs0
1774 ; CHECK-BE-P9-NEXT: blr
1776 ; CHECK-AIX-64-P8-LABEL: test_v2i64_v4i32:
1777 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1778 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
1779 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs0
1780 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r4
1781 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, vs0
1782 ; CHECK-AIX-64-P8-NEXT: blr
1784 ; CHECK-AIX-64-P9-LABEL: test_v2i64_v4i32:
1785 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1786 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r4
1787 ; CHECK-AIX-64-P9-NEXT: mtvsrdd v2, r3, r3
1788 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v2, vs0
1789 ; CHECK-AIX-64-P9-NEXT: blr
1791 ; CHECK-AIX-32-P8-LABEL: test_v2i64_v4i32:
1792 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1793 ; CHECK-AIX-32-P8-NEXT: stw r5, -48(r1)
1794 ; CHECK-AIX-32-P8-NEXT: addi r5, r1, -48
1795 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r5
1796 ; CHECK-AIX-32-P8-NEXT: stw r3, -32(r1)
1797 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1798 ; CHECK-AIX-32-P8-NEXT: stw r4, -16(r1)
1799 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1800 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1801 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs2, 0, r3
1802 ; CHECK-AIX-32-P8-NEXT: xxmrghw vs1, vs2, vs1
1803 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs1, vs0
1804 ; CHECK-AIX-32-P8-NEXT: blr
1806 ; CHECK-AIX-32-P9-LABEL: test_v2i64_v4i32:
1807 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1808 ; CHECK-AIX-32-P9-NEXT: stw r4, -16(r1)
1809 ; CHECK-AIX-32-P9-NEXT: stw r3, -32(r1)
1810 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -16(r1)
1811 ; CHECK-AIX-32-P9-NEXT: lxv vs2, -32(r1)
1812 ; CHECK-AIX-32-P9-NEXT: stw r5, -48(r1)
1813 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -48(r1)
1814 ; CHECK-AIX-32-P9-NEXT: xxmrghw vs1, vs2, vs1
1815 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs1, vs0
1816 ; CHECK-AIX-32-P9-NEXT: blr
1818 %lhs.tmp = insertelement <2 x i64> undef, i64 %arg1, i32 0
1819 %lhs = bitcast <2 x i64> %lhs.tmp to <2 x i64>
1820 %rhs.tmp = insertelement <4 x i32> undef, i32 %arg, i32 0
1821 %rhs = bitcast <4 x i32> %rhs.tmp to <2 x i64>
1822 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1823 ret <2 x i64> %shuffle
1826 define <2 x i64> @test_v2i64_v8i16(i64 %arg1, i16 %arg) {
1827 ; CHECK-LE-P8-LABEL: test_v2i64_v8i16:
1828 ; CHECK-LE-P8: # %bb.0: # %entry
1829 ; CHECK-LE-P8-NEXT: mtfprd f0, r3
1830 ; CHECK-LE-P8-NEXT: xxswapd v2, vs0
1831 ; CHECK-LE-P8-NEXT: mtfprd f0, r4
1832 ; CHECK-LE-P8-NEXT: xxswapd vs0, vs0
1833 ; CHECK-LE-P8-NEXT: xxmrgld v2, vs0, v2
1834 ; CHECK-LE-P8-NEXT: blr
1836 ; CHECK-LE-P9-LABEL: test_v2i64_v8i16:
1837 ; CHECK-LE-P9: # %bb.0: # %entry
1838 ; CHECK-LE-P9-NEXT: mtfprd f0, r3
1839 ; CHECK-LE-P9-NEXT: xxswapd v2, vs0
1840 ; CHECK-LE-P9-NEXT: mtfprd f0, r4
1841 ; CHECK-LE-P9-NEXT: xxswapd vs0, vs0
1842 ; CHECK-LE-P9-NEXT: xxmrgld v2, vs0, v2
1843 ; CHECK-LE-P9-NEXT: blr
1845 ; CHECK-BE-P8-LABEL: test_v2i64_v8i16:
1846 ; CHECK-BE-P8: # %bb.0: # %entry
1847 ; CHECK-BE-P8-NEXT: mtfprd f0, r3
1848 ; CHECK-BE-P8-NEXT: xxspltd v2, vs0, 0
1849 ; CHECK-BE-P8-NEXT: mtfprwz f0, r4
1850 ; CHECK-BE-P8-NEXT: xxmrghd v2, v2, vs0
1851 ; CHECK-BE-P8-NEXT: blr
1853 ; CHECK-BE-P9-LABEL: test_v2i64_v8i16:
1854 ; CHECK-BE-P9: # %bb.0: # %entry
1855 ; CHECK-BE-P9-NEXT: mtfprwz f0, r4
1856 ; CHECK-BE-P9-NEXT: mtvsrdd v2, r3, r3
1857 ; CHECK-BE-P9-NEXT: xxmrghd v2, v2, vs0
1858 ; CHECK-BE-P9-NEXT: blr
1860 ; CHECK-AIX-64-P8-LABEL: test_v2i64_v8i16:
1861 ; CHECK-AIX-64-P8: # %bb.0: # %entry
1862 ; CHECK-AIX-64-P8-NEXT: mtfprd f0, r3
1863 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, vs0, vs0
1864 ; CHECK-AIX-64-P8-NEXT: mtfprwz f0, r4
1865 ; CHECK-AIX-64-P8-NEXT: xxmrghd v2, v2, vs0
1866 ; CHECK-AIX-64-P8-NEXT: blr
1868 ; CHECK-AIX-64-P9-LABEL: test_v2i64_v8i16:
1869 ; CHECK-AIX-64-P9: # %bb.0: # %entry
1870 ; CHECK-AIX-64-P9-NEXT: mtfprwz f0, r4
1871 ; CHECK-AIX-64-P9-NEXT: mtvsrdd v2, r3, r3
1872 ; CHECK-AIX-64-P9-NEXT: xxmrghd v2, v2, vs0
1873 ; CHECK-AIX-64-P9-NEXT: blr
1875 ; CHECK-AIX-32-P8-LABEL: test_v2i64_v8i16:
1876 ; CHECK-AIX-32-P8: # %bb.0: # %entry
1877 ; CHECK-AIX-32-P8-NEXT: sth r5, -48(r1)
1878 ; CHECK-AIX-32-P8-NEXT: addi r5, r1, -48
1879 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs0, 0, r5
1880 ; CHECK-AIX-32-P8-NEXT: stw r3, -32(r1)
1881 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -16
1882 ; CHECK-AIX-32-P8-NEXT: stw r4, -16(r1)
1883 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs1, 0, r3
1884 ; CHECK-AIX-32-P8-NEXT: addi r3, r1, -32
1885 ; CHECK-AIX-32-P8-NEXT: lxvw4x vs2, 0, r3
1886 ; CHECK-AIX-32-P8-NEXT: xxmrghw vs1, vs2, vs1
1887 ; CHECK-AIX-32-P8-NEXT: xxmrghd v2, vs1, vs0
1888 ; CHECK-AIX-32-P8-NEXT: blr
1890 ; CHECK-AIX-32-P9-LABEL: test_v2i64_v8i16:
1891 ; CHECK-AIX-32-P9: # %bb.0: # %entry
1892 ; CHECK-AIX-32-P9-NEXT: stw r4, -16(r1)
1893 ; CHECK-AIX-32-P9-NEXT: stw r3, -32(r1)
1894 ; CHECK-AIX-32-P9-NEXT: lxv vs1, -16(r1)
1895 ; CHECK-AIX-32-P9-NEXT: lxv vs2, -32(r1)
1896 ; CHECK-AIX-32-P9-NEXT: sth r5, -48(r1)
1897 ; CHECK-AIX-32-P9-NEXT: lxv vs0, -48(r1)
1898 ; CHECK-AIX-32-P9-NEXT: xxmrghw vs1, vs2, vs1
1899 ; CHECK-AIX-32-P9-NEXT: xxmrghd v2, vs1, vs0
1900 ; CHECK-AIX-32-P9-NEXT: blr
1902 %lhs.tmp = insertelement <2 x i64> undef, i64 %arg1, i32 0
1903 %lhs = bitcast <2 x i64> %lhs.tmp to <2 x i64>
1904 %rhs.tmp = insertelement <8 x i16> undef, i16 %arg, i32 0
1905 %rhs = bitcast <8 x i16> %rhs.tmp to <2 x i64>
1906 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
1907 ret <2 x i64> %shuffle