1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown \
3 ; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s
4 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64-unknown-unknown \
5 ; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s \
6 ; RUN: --check-prefix=CHECK-BE
7 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown \
8 ; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s \
9 ; RUN: --check-prefix=CHECK-P9
10 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64-unknown-unknown \
11 ; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s \
12 ; RUN: --check-prefix=CHECK-P9-BE
14 define <2 x i64> @testllv(<2 x i64> returned %a, <2 x i64> %b, ptr nocapture %ap, i64 %Idx) local_unnamed_addr #0 {
15 ; CHECK-LABEL: testllv:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: xxswapd vs0, vs34
18 ; CHECK-NEXT: sldi r3, r8, 3
19 ; CHECK-NEXT: stfdx f0, r7, r3
22 ; CHECK-BE-LABEL: testllv:
23 ; CHECK-BE: # %bb.0: # %entry
24 ; CHECK-BE-NEXT: sldi r3, r8, 3
25 ; CHECK-BE-NEXT: stxsdx vs34, r7, r3
28 ; CHECK-P9-LABEL: testllv:
29 ; CHECK-P9: # %bb.0: # %entry
30 ; CHECK-P9-NEXT: xxswapd vs0, vs34
31 ; CHECK-P9-NEXT: sldi r3, r8, 3
32 ; CHECK-P9-NEXT: stfdx f0, r7, r3
35 ; CHECK-P9-BE-LABEL: testllv:
36 ; CHECK-P9-BE: # %bb.0: # %entry
37 ; CHECK-P9-BE-NEXT: sldi r3, r8, 3
38 ; CHECK-P9-BE-NEXT: stxsdx vs34, r7, r3
39 ; CHECK-P9-BE-NEXT: blr
41 %vecext = extractelement <2 x i64> %a, i32 0
42 %arrayidx = getelementptr inbounds i64, ptr %ap, i64 %Idx
43 store i64 %vecext, ptr %arrayidx, align 8
47 define <2 x i64> @testll0(<2 x i64> returned %a, <2 x i64> %b, ptr nocapture %ap) local_unnamed_addr #0 {
48 ; CHECK-LABEL: testll0:
49 ; CHECK: # %bb.0: # %entry
50 ; CHECK-NEXT: xxswapd vs0, vs34
51 ; CHECK-NEXT: stfd f0, 24(r7)
54 ; CHECK-BE-LABEL: testll0:
55 ; CHECK-BE: # %bb.0: # %entry
56 ; CHECK-BE-NEXT: addi r3, r7, 24
57 ; CHECK-BE-NEXT: stxsdx vs34, 0, r3
60 ; CHECK-P9-LABEL: testll0:
61 ; CHECK-P9: # %bb.0: # %entry
62 ; CHECK-P9-NEXT: xxswapd vs0, vs34
63 ; CHECK-P9-NEXT: stfd f0, 24(r7)
66 ; CHECK-P9-BE-LABEL: testll0:
67 ; CHECK-P9-BE: # %bb.0: # %entry
68 ; CHECK-P9-BE-NEXT: stxsd v2, 24(r7)
69 ; CHECK-P9-BE-NEXT: blr
71 %vecext = extractelement <2 x i64> %a, i32 0
72 %arrayidx = getelementptr inbounds i64, ptr %ap, i64 3
73 store i64 %vecext, ptr %arrayidx, align 8
77 ; Function Attrs: norecurse nounwind writeonly
78 define <2 x i64> @testll1(<2 x i64> returned %a, i64 %b, ptr nocapture %ap) local_unnamed_addr #0 {
79 ; CHECK-LABEL: testll1:
80 ; CHECK: # %bb.0: # %entry
81 ; CHECK-NEXT: addi r3, r6, 24
82 ; CHECK-NEXT: stxsdx vs34, 0, r3
85 ; CHECK-BE-LABEL: testll1:
86 ; CHECK-BE: # %bb.0: # %entry
87 ; CHECK-BE-NEXT: xxswapd vs0, vs34
88 ; CHECK-BE-NEXT: stfd f0, 24(r6)
91 ; CHECK-P9-LABEL: testll1:
92 ; CHECK-P9: # %bb.0: # %entry
93 ; CHECK-P9-NEXT: stxsd v2, 24(r6)
96 ; CHECK-P9-BE-LABEL: testll1:
97 ; CHECK-P9-BE: # %bb.0: # %entry
98 ; CHECK-P9-BE-NEXT: xxswapd vs0, vs34
99 ; CHECK-P9-BE-NEXT: stfd f0, 24(r6)
100 ; CHECK-P9-BE-NEXT: blr
102 %vecext = extractelement <2 x i64> %a, i32 1
103 %arrayidx = getelementptr inbounds i64, ptr %ap, i64 3
104 store i64 %vecext, ptr %arrayidx, align 8
108 define <2 x double> @testdv(<2 x double> returned %a, <2 x double> %b, ptr nocapture %ap, i64 %Idx) local_unnamed_addr #0 {
109 ; CHECK-LABEL: testdv:
110 ; CHECK: # %bb.0: # %entry
111 ; CHECK-NEXT: xxswapd vs0, vs34
112 ; CHECK-NEXT: sldi r3, r8, 3
113 ; CHECK-NEXT: stfdx f0, r7, r3
116 ; CHECK-BE-LABEL: testdv:
117 ; CHECK-BE: # %bb.0: # %entry
118 ; CHECK-BE-NEXT: sldi r3, r8, 3
119 ; CHECK-BE-NEXT: stxsdx vs34, r7, r3
122 ; CHECK-P9-LABEL: testdv:
123 ; CHECK-P9: # %bb.0: # %entry
124 ; CHECK-P9-NEXT: xxswapd vs0, vs34
125 ; CHECK-P9-NEXT: sldi r3, r8, 3
126 ; CHECK-P9-NEXT: stfdx f0, r7, r3
129 ; CHECK-P9-BE-LABEL: testdv:
130 ; CHECK-P9-BE: # %bb.0: # %entry
131 ; CHECK-P9-BE-NEXT: sldi r3, r8, 3
132 ; CHECK-P9-BE-NEXT: stxsdx vs34, r7, r3
133 ; CHECK-P9-BE-NEXT: blr
135 %vecext = extractelement <2 x double> %a, i32 0
136 %arrayidx = getelementptr inbounds double, ptr %ap, i64 %Idx
137 store double %vecext, ptr %arrayidx, align 8
141 define <2 x double> @testd0(<2 x double> returned %a, <2 x double> %b, ptr nocapture %ap) local_unnamed_addr #0 {
142 ; CHECK-LABEL: testd0:
143 ; CHECK: # %bb.0: # %entry
144 ; CHECK-NEXT: xxswapd vs0, vs34
145 ; CHECK-NEXT: stfd f0, 24(r7)
148 ; CHECK-BE-LABEL: testd0:
149 ; CHECK-BE: # %bb.0: # %entry
150 ; CHECK-BE-NEXT: addi r3, r7, 24
151 ; CHECK-BE-NEXT: stxsdx vs34, 0, r3
154 ; CHECK-P9-LABEL: testd0:
155 ; CHECK-P9: # %bb.0: # %entry
156 ; CHECK-P9-NEXT: xxswapd vs0, vs34
157 ; CHECK-P9-NEXT: stfd f0, 24(r7)
160 ; CHECK-P9-BE-LABEL: testd0:
161 ; CHECK-P9-BE: # %bb.0: # %entry
162 ; CHECK-P9-BE-NEXT: stxsd v2, 24(r7)
163 ; CHECK-P9-BE-NEXT: blr
165 %vecext = extractelement <2 x double> %a, i32 0
166 %arrayidx = getelementptr inbounds double, ptr %ap, i64 3
167 store double %vecext, ptr %arrayidx, align 8
171 ; Function Attrs: norecurse nounwind writeonly
172 define <2 x double> @testd1(<2 x double> returned %a, <2 x double> %b, ptr nocapture %ap) local_unnamed_addr #0 {
173 ; CHECK-LABEL: testd1:
174 ; CHECK: # %bb.0: # %entry
175 ; CHECK-NEXT: addi r3, r7, 24
176 ; CHECK-NEXT: stxsdx vs34, 0, r3
179 ; CHECK-BE-LABEL: testd1:
180 ; CHECK-BE: # %bb.0: # %entry
181 ; CHECK-BE-NEXT: xxswapd vs0, vs34
182 ; CHECK-BE-NEXT: stfd f0, 24(r7)
185 ; CHECK-P9-LABEL: testd1:
186 ; CHECK-P9: # %bb.0: # %entry
187 ; CHECK-P9-NEXT: stxsd v2, 24(r7)
190 ; CHECK-P9-BE-LABEL: testd1:
191 ; CHECK-P9-BE: # %bb.0: # %entry
192 ; CHECK-P9-BE-NEXT: xxswapd vs0, vs34
193 ; CHECK-P9-BE-NEXT: stfd f0, 24(r7)
194 ; CHECK-P9-BE-NEXT: blr
196 %vecext = extractelement <2 x double> %a, i32 1
197 %arrayidx = getelementptr inbounds double, ptr %ap, i64 3
198 store double %vecext, ptr %arrayidx, align 8
202 ; Function Attrs: norecurse nounwind writeonly
203 define <4 x float> @testf0(<4 x float> returned %a, <4 x float> %b, ptr nocapture %ap) local_unnamed_addr #0 {
204 ; CHECK-LABEL: testf0:
205 ; CHECK: # %bb.0: # %entry
206 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2
207 ; CHECK-NEXT: addi r3, r7, 12
208 ; CHECK-NEXT: stfiwx f0, 0, r3
211 ; CHECK-BE-LABEL: testf0:
212 ; CHECK-BE: # %bb.0: # %entry
213 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
214 ; CHECK-BE-NEXT: addi r3, r7, 12
215 ; CHECK-BE-NEXT: stfiwx f0, 0, r3
218 ; CHECK-P9-LABEL: testf0:
219 ; CHECK-P9: # %bb.0: # %entry
220 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2
221 ; CHECK-P9-NEXT: addi r3, r7, 12
222 ; CHECK-P9-NEXT: stfiwx f0, 0, r3
225 ; CHECK-P9-BE-LABEL: testf0:
226 ; CHECK-P9-BE: # %bb.0: # %entry
227 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
228 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
229 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3
230 ; CHECK-P9-BE-NEXT: blr
232 %vecext = extractelement <4 x float> %a, i32 0
233 %arrayidx = getelementptr inbounds float, ptr %ap, i64 3
234 store float %vecext, ptr %arrayidx, align 4
238 ; Function Attrs: norecurse nounwind writeonly
239 define <4 x float> @testf1(<4 x float> returned %a, <4 x float> %b, ptr nocapture %ap) local_unnamed_addr #0 {
240 ; CHECK-LABEL: testf1:
241 ; CHECK: # %bb.0: # %entry
242 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 1
243 ; CHECK-NEXT: addi r3, r7, 12
244 ; CHECK-NEXT: stfiwx f0, 0, r3
247 ; CHECK-BE-LABEL: testf1:
248 ; CHECK-BE: # %bb.0: # %entry
249 ; CHECK-BE-NEXT: addi r3, r7, 12
250 ; CHECK-BE-NEXT: stxsiwx vs34, 0, r3
253 ; CHECK-P9-LABEL: testf1:
254 ; CHECK-P9: # %bb.0: # %entry
255 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1
256 ; CHECK-P9-NEXT: addi r3, r7, 12
257 ; CHECK-P9-NEXT: stfiwx f0, 0, r3
260 ; CHECK-P9-BE-LABEL: testf1:
261 ; CHECK-P9-BE: # %bb.0: # %entry
262 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
263 ; CHECK-P9-BE-NEXT: stxsiwx vs34, 0, r3
264 ; CHECK-P9-BE-NEXT: blr
266 %vecext = extractelement <4 x float> %a, i32 1
267 %arrayidx = getelementptr inbounds float, ptr %ap, i64 3
268 store float %vecext, ptr %arrayidx, align 4
272 ; Function Attrs: norecurse nounwind writeonly
273 define <4 x float> @testf2(<4 x float> returned %a, <4 x float> %b, ptr nocapture %ap) local_unnamed_addr #0 {
274 ; CHECK-LABEL: testf2:
275 ; CHECK: # %bb.0: # %entry
276 ; CHECK-NEXT: addi r3, r7, 12
277 ; CHECK-NEXT: stxsiwx vs34, 0, r3
280 ; CHECK-BE-LABEL: testf2:
281 ; CHECK-BE: # %bb.0: # %entry
282 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
283 ; CHECK-BE-NEXT: addi r3, r7, 12
284 ; CHECK-BE-NEXT: stfiwx f0, 0, r3
287 ; CHECK-P9-LABEL: testf2:
288 ; CHECK-P9: # %bb.0: # %entry
289 ; CHECK-P9-NEXT: addi r3, r7, 12
290 ; CHECK-P9-NEXT: stxsiwx vs34, 0, r3
293 ; CHECK-P9-BE-LABEL: testf2:
294 ; CHECK-P9-BE: # %bb.0: # %entry
295 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
296 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
297 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3
298 ; CHECK-P9-BE-NEXT: blr
300 %vecext = extractelement <4 x float> %a, i32 2
301 %arrayidx = getelementptr inbounds float, ptr %ap, i64 3
302 store float %vecext, ptr %arrayidx, align 4
306 ; Function Attrs: norecurse nounwind writeonly
307 define <4 x float> @testf3(<4 x float> returned %a, <4 x float> %b, ptr nocapture %ap) local_unnamed_addr #0 {
308 ; CHECK-LABEL: testf3:
309 ; CHECK: # %bb.0: # %entry
310 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 3
311 ; CHECK-NEXT: addi r3, r7, 12
312 ; CHECK-NEXT: stfiwx f0, 0, r3
315 ; CHECK-BE-LABEL: testf3:
316 ; CHECK-BE: # %bb.0: # %entry
317 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
318 ; CHECK-BE-NEXT: addi r3, r7, 12
319 ; CHECK-BE-NEXT: stfiwx f0, 0, r3
322 ; CHECK-P9-LABEL: testf3:
323 ; CHECK-P9: # %bb.0: # %entry
324 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3
325 ; CHECK-P9-NEXT: addi r3, r7, 12
326 ; CHECK-P9-NEXT: stfiwx f0, 0, r3
329 ; CHECK-P9-BE-LABEL: testf3:
330 ; CHECK-P9-BE: # %bb.0: # %entry
331 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
332 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
333 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3
334 ; CHECK-P9-BE-NEXT: blr
336 %vecext = extractelement <4 x float> %a, i32 3
337 %arrayidx = getelementptr inbounds float, ptr %ap, i64 3
338 store float %vecext, ptr %arrayidx, align 4
342 ; Function Attrs: norecurse nounwind writeonly
343 define <4 x i32> @testi0(<4 x i32> returned %a, <4 x i32> %b, ptr nocapture %ap) local_unnamed_addr #0 {
344 ; CHECK-LABEL: testi0:
345 ; CHECK: # %bb.0: # %entry
346 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2
347 ; CHECK-NEXT: addi r3, r7, 12
348 ; CHECK-NEXT: stfiwx f0, 0, r3
351 ; CHECK-BE-LABEL: testi0:
352 ; CHECK-BE: # %bb.0: # %entry
353 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
354 ; CHECK-BE-NEXT: addi r3, r7, 12
355 ; CHECK-BE-NEXT: stfiwx f0, 0, r3
358 ; CHECK-P9-LABEL: testi0:
359 ; CHECK-P9: # %bb.0: # %entry
360 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2
361 ; CHECK-P9-NEXT: addi r3, r7, 12
362 ; CHECK-P9-NEXT: stfiwx f0, 0, r3
365 ; CHECK-P9-BE-LABEL: testi0:
366 ; CHECK-P9-BE: # %bb.0: # %entry
367 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
368 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
369 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3
370 ; CHECK-P9-BE-NEXT: blr
372 %vecext = extractelement <4 x i32> %a, i32 0
373 %arrayidx = getelementptr inbounds i32, ptr %ap, i64 3
374 store i32 %vecext, ptr %arrayidx, align 4
378 ; Function Attrs: norecurse nounwind writeonly
379 define <4 x i32> @testi1(<4 x i32> returned %a, <4 x i32> %b, ptr nocapture %ap) local_unnamed_addr #0 {
380 ; CHECK-LABEL: testi1:
381 ; CHECK: # %bb.0: # %entry
382 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 1
383 ; CHECK-NEXT: addi r3, r7, 12
384 ; CHECK-NEXT: stfiwx f0, 0, r3
387 ; CHECK-BE-LABEL: testi1:
388 ; CHECK-BE: # %bb.0: # %entry
389 ; CHECK-BE-NEXT: addi r3, r7, 12
390 ; CHECK-BE-NEXT: stxsiwx vs34, 0, r3
393 ; CHECK-P9-LABEL: testi1:
394 ; CHECK-P9: # %bb.0: # %entry
395 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1
396 ; CHECK-P9-NEXT: addi r3, r7, 12
397 ; CHECK-P9-NEXT: stfiwx f0, 0, r3
400 ; CHECK-P9-BE-LABEL: testi1:
401 ; CHECK-P9-BE: # %bb.0: # %entry
402 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
403 ; CHECK-P9-BE-NEXT: stxsiwx vs34, 0, r3
404 ; CHECK-P9-BE-NEXT: blr
406 %vecext = extractelement <4 x i32> %a, i32 1
407 %arrayidx = getelementptr inbounds i32, ptr %ap, i64 3
408 store i32 %vecext, ptr %arrayidx, align 4
412 ; Function Attrs: norecurse nounwind writeonly
413 define <4 x i32> @testi2(<4 x i32> returned %a, <4 x i32> %b, ptr nocapture %ap) local_unnamed_addr #0 {
414 ; CHECK-LABEL: testi2:
415 ; CHECK: # %bb.0: # %entry
416 ; CHECK-NEXT: addi r3, r7, 12
417 ; CHECK-NEXT: stxsiwx vs34, 0, r3
420 ; CHECK-BE-LABEL: testi2:
421 ; CHECK-BE: # %bb.0: # %entry
422 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
423 ; CHECK-BE-NEXT: addi r3, r7, 12
424 ; CHECK-BE-NEXT: stfiwx f0, 0, r3
427 ; CHECK-P9-LABEL: testi2:
428 ; CHECK-P9: # %bb.0: # %entry
429 ; CHECK-P9-NEXT: addi r3, r7, 12
430 ; CHECK-P9-NEXT: stxsiwx vs34, 0, r3
433 ; CHECK-P9-BE-LABEL: testi2:
434 ; CHECK-P9-BE: # %bb.0: # %entry
435 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
436 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
437 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3
438 ; CHECK-P9-BE-NEXT: blr
440 %vecext = extractelement <4 x i32> %a, i32 2
441 %arrayidx = getelementptr inbounds i32, ptr %ap, i64 3
442 store i32 %vecext, ptr %arrayidx, align 4
446 ; Function Attrs: norecurse nounwind writeonly
447 define <4 x i32> @testi3(<4 x i32> returned %a, <4 x i32> %b, ptr nocapture %ap) local_unnamed_addr #0 {
448 ; CHECK-LABEL: testi3:
449 ; CHECK: # %bb.0: # %entry
450 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 3
451 ; CHECK-NEXT: addi r3, r7, 12
452 ; CHECK-NEXT: stfiwx f0, 0, r3
455 ; CHECK-BE-LABEL: testi3:
456 ; CHECK-BE: # %bb.0: # %entry
457 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
458 ; CHECK-BE-NEXT: addi r3, r7, 12
459 ; CHECK-BE-NEXT: stfiwx f0, 0, r3
462 ; CHECK-P9-LABEL: testi3:
463 ; CHECK-P9: # %bb.0: # %entry
464 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3
465 ; CHECK-P9-NEXT: addi r3, r7, 12
466 ; CHECK-P9-NEXT: stfiwx f0, 0, r3
469 ; CHECK-P9-BE-LABEL: testi3:
470 ; CHECK-P9-BE: # %bb.0: # %entry
471 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
472 ; CHECK-P9-BE-NEXT: addi r3, r7, 12
473 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3
474 ; CHECK-P9-BE-NEXT: blr
476 %vecext = extractelement <4 x i32> %a, i32 3
477 %arrayidx = getelementptr inbounds i32, ptr %ap, i64 3
478 store i32 %vecext, ptr %arrayidx, align 4
482 define dso_local void @test_consecutive_i32(<4 x i32> %a, ptr nocapture %b) local_unnamed_addr #0 {
483 ; CHECK-LABEL: test_consecutive_i32:
484 ; CHECK: # %bb.0: # %entry
485 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2
486 ; CHECK-NEXT: li r3, 4
487 ; CHECK-NEXT: stfiwx f0, 0, r5
488 ; CHECK-NEXT: stxsiwx vs34, r5, r3
491 ; CHECK-BE-LABEL: test_consecutive_i32:
492 ; CHECK-BE: # %bb.0: # %entry
493 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
494 ; CHECK-BE-NEXT: xxsldwi vs1, vs34, vs34, 1
495 ; CHECK-BE-NEXT: li r3, 4
496 ; CHECK-BE-NEXT: stfiwx f0, 0, r5
497 ; CHECK-BE-NEXT: stfiwx f1, r5, r3
500 ; CHECK-P9-LABEL: test_consecutive_i32:
501 ; CHECK-P9: # %bb.0: # %entry
502 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2
503 ; CHECK-P9-NEXT: li r3, 4
504 ; CHECK-P9-NEXT: stxsiwx vs34, r5, r3
505 ; CHECK-P9-NEXT: stfiwx f0, 0, r5
508 ; CHECK-P9-BE-LABEL: test_consecutive_i32:
509 ; CHECK-P9-BE: # %bb.0: # %entry
510 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
511 ; CHECK-P9-BE-NEXT: li r3, 4
512 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r5
513 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
514 ; CHECK-P9-BE-NEXT: stfiwx f0, r5, r3
515 ; CHECK-P9-BE-NEXT: blr
518 %vecext = extractelement <4 x i32> %a, i32 0
519 store i32 %vecext, ptr %b, align 4
520 %vecext1 = extractelement <4 x i32> %a, i32 2
521 %arrayidx2 = getelementptr inbounds i32, ptr %b, i64 1
522 store i32 %vecext1, ptr %arrayidx2, align 4
526 define dso_local void @test_consecutive_float(<4 x float> %a, ptr nocapture %b) local_unnamed_addr #0 {
527 ; CHECK-LABEL: test_consecutive_float:
528 ; CHECK: # %bb.0: # %entry
529 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 1
530 ; CHECK-NEXT: xxsldwi vs1, vs34, vs34, 3
531 ; CHECK-NEXT: li r3, 4
532 ; CHECK-NEXT: stfiwx f0, 0, r5
533 ; CHECK-NEXT: stfiwx f1, r5, r3
536 ; CHECK-BE-LABEL: test_consecutive_float:
537 ; CHECK-BE: # %bb.0: # %entry
538 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
539 ; CHECK-BE-NEXT: li r3, 4
540 ; CHECK-BE-NEXT: stxsiwx vs34, 0, r5
541 ; CHECK-BE-NEXT: stfiwx f0, r5, r3
544 ; CHECK-P9-LABEL: test_consecutive_float:
545 ; CHECK-P9: # %bb.0: # %entry
546 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1
547 ; CHECK-P9-NEXT: li r3, 4
548 ; CHECK-P9-NEXT: stfiwx f0, 0, r5
549 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3
550 ; CHECK-P9-NEXT: stfiwx f0, r5, r3
553 ; CHECK-P9-BE-LABEL: test_consecutive_float:
554 ; CHECK-P9-BE: # %bb.0: # %entry
555 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
556 ; CHECK-P9-BE-NEXT: li r3, 4
557 ; CHECK-P9-BE-NEXT: stxsiwx vs34, 0, r5
558 ; CHECK-P9-BE-NEXT: stfiwx f0, r5, r3
559 ; CHECK-P9-BE-NEXT: blr
561 %vecext = extractelement <4 x float> %a, i32 1
562 store float %vecext, ptr %b, align 4
563 %vecext1 = extractelement <4 x float> %a, i32 3
564 %arrayidx2 = getelementptr inbounds float, ptr %b, i64 1
565 store float %vecext1, ptr %arrayidx2, align 4
569 define dso_local void @test_stores_exceed_vec_size(<4 x i32> %a, ptr nocapture %b) local_unnamed_addr #0 {
570 ; CHECK-LABEL: test_stores_exceed_vec_size:
571 ; CHECK: # %bb.0: # %entry
572 ; CHECK-NEXT: addis r3, r2, .LCPI16_0@toc@ha
573 ; CHECK-NEXT: xxsldwi vs1, vs34, vs34, 1
574 ; CHECK-NEXT: addi r3, r3, .LCPI16_0@toc@l
575 ; CHECK-NEXT: lxvd2x vs0, 0, r3
576 ; CHECK-NEXT: li r3, 16
577 ; CHECK-NEXT: xxswapd vs35, vs0
578 ; CHECK-NEXT: vperm v3, v2, v2, v3
579 ; CHECK-NEXT: xxswapd vs0, vs35
580 ; CHECK-NEXT: stxvd2x vs0, 0, r5
581 ; CHECK-NEXT: stfiwx f1, r5, r3
582 ; CHECK-NEXT: li r3, 20
583 ; CHECK-NEXT: stxsiwx vs34, r5, r3
586 ; CHECK-BE-LABEL: test_stores_exceed_vec_size:
587 ; CHECK-BE: # %bb.0: # %entry
588 ; CHECK-BE-NEXT: addis r3, r2, .LCPI16_0@toc@ha
589 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
590 ; CHECK-BE-NEXT: addi r3, r3, .LCPI16_0@toc@l
591 ; CHECK-BE-NEXT: lxvw4x vs35, 0, r3
592 ; CHECK-BE-NEXT: li r3, 16
593 ; CHECK-BE-NEXT: stxsiwx vs34, r5, r3
594 ; CHECK-BE-NEXT: li r3, 20
595 ; CHECK-BE-NEXT: stfiwx f0, r5, r3
596 ; CHECK-BE-NEXT: vperm v3, v2, v2, v3
597 ; CHECK-BE-NEXT: stxvw4x vs35, 0, r5
600 ; CHECK-P9-LABEL: test_stores_exceed_vec_size:
601 ; CHECK-P9: # %bb.0: # %entry
602 ; CHECK-P9-NEXT: addis r3, r2, .LCPI16_0@toc@ha
603 ; CHECK-P9-NEXT: xxsldwi vs1, vs34, vs34, 1
604 ; CHECK-P9-NEXT: addi r3, r3, .LCPI16_0@toc@l
605 ; CHECK-P9-NEXT: lxv vs0, 0(r3)
606 ; CHECK-P9-NEXT: li r3, 20
607 ; CHECK-P9-NEXT: stxsiwx vs34, r5, r3
608 ; CHECK-P9-NEXT: li r3, 16
609 ; CHECK-P9-NEXT: stfiwx f1, r5, r3
610 ; CHECK-P9-NEXT: xxperm vs34, vs34, vs0
611 ; CHECK-P9-NEXT: stxv vs34, 0(r5)
614 ; CHECK-P9-BE-LABEL: test_stores_exceed_vec_size:
615 ; CHECK-P9-BE: # %bb.0: # %entry
616 ; CHECK-P9-BE-NEXT: addis r3, r2, .LCPI16_0@toc@ha
617 ; CHECK-P9-BE-NEXT: xxsldwi vs1, vs34, vs34, 1
618 ; CHECK-P9-BE-NEXT: addi r3, r3, .LCPI16_0@toc@l
619 ; CHECK-P9-BE-NEXT: lxv vs0, 0(r3)
620 ; CHECK-P9-BE-NEXT: li r3, 16
621 ; CHECK-P9-BE-NEXT: stxsiwx vs34, r5, r3
622 ; CHECK-P9-BE-NEXT: li r3, 20
623 ; CHECK-P9-BE-NEXT: stfiwx f1, r5, r3
624 ; CHECK-P9-BE-NEXT: xxperm vs34, vs34, vs0
625 ; CHECK-P9-BE-NEXT: stxv vs34, 0(r5)
626 ; CHECK-P9-BE-NEXT: blr
628 %vecext = extractelement <4 x i32> %a, i32 2
629 store i32 %vecext, ptr %b, align 4
630 %vecext1 = extractelement <4 x i32> %a, i32 3
631 %arrayidx2 = getelementptr inbounds i32, ptr %b, i64 1
632 store i32 %vecext1, ptr %arrayidx2, align 4
633 %vecext3 = extractelement <4 x i32> %a, i32 0
634 %arrayidx4 = getelementptr inbounds i32, ptr %b, i64 2
635 store i32 %vecext3, ptr %arrayidx4, align 4
636 %arrayidx6 = getelementptr inbounds i32, ptr %b, i64 3
637 store i32 %vecext3, ptr %arrayidx6, align 4
638 %vecext7 = extractelement <4 x i32> %a, i32 1
639 %arrayidx8 = getelementptr inbounds i32, ptr %b, i64 4
640 store i32 %vecext7, ptr %arrayidx8, align 4
641 %arrayidx10 = getelementptr inbounds i32, ptr %b, i64 5
642 store i32 %vecext, ptr %arrayidx10, align 4
646 define void @test_5_consecutive_stores_of_bytes(<16 x i8> %a, ptr nocapture %b) local_unnamed_addr #0 {
647 ; CHECK-LABEL: test_5_consecutive_stores_of_bytes:
648 ; CHECK: # %bb.0: # %entry
649 ; CHECK-NEXT: xxswapd vs0, vs34
650 ; CHECK-NEXT: mfvsrd r3, vs34
651 ; CHECK-NEXT: rldicl r6, r3, 32, 56
652 ; CHECK-NEXT: mffprd r4, f0
653 ; CHECK-NEXT: rldicl r3, r3, 56, 56
654 ; CHECK-NEXT: stb r3, 2(r5)
655 ; CHECK-NEXT: rldicl r3, r4, 8, 56
656 ; CHECK-NEXT: stb r6, 1(r5)
657 ; CHECK-NEXT: rldicl r6, r4, 32, 56
658 ; CHECK-NEXT: stb r3, 3(r5)
659 ; CHECK-NEXT: rldicl r3, r4, 16, 56
660 ; CHECK-NEXT: stb r6, 0(r5)
661 ; CHECK-NEXT: stb r3, 4(r5)
664 ; CHECK-BE-LABEL: test_5_consecutive_stores_of_bytes:
665 ; CHECK-BE: # %bb.0: # %entry
666 ; CHECK-BE-NEXT: xxswapd vs0, vs34
667 ; CHECK-BE-NEXT: mfvsrd r3, vs34
668 ; CHECK-BE-NEXT: rldicl r6, r3, 40, 56
669 ; CHECK-BE-NEXT: mffprd r4, f0
670 ; CHECK-BE-NEXT: stb r6, 0(r5)
671 ; CHECK-BE-NEXT: rldicl r6, r4, 40, 56
672 ; CHECK-BE-NEXT: rldicl r4, r4, 16, 56
673 ; CHECK-BE-NEXT: stb r4, 2(r5)
674 ; CHECK-BE-NEXT: clrldi r4, r3, 56
675 ; CHECK-BE-NEXT: rldicl r3, r3, 56, 56
676 ; CHECK-BE-NEXT: stb r6, 1(r5)
677 ; CHECK-BE-NEXT: stb r4, 3(r5)
678 ; CHECK-BE-NEXT: stb r3, 4(r5)
681 ; CHECK-P9-LABEL: test_5_consecutive_stores_of_bytes:
682 ; CHECK-P9: # %bb.0: # %entry
683 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 4
684 ; CHECK-P9-NEXT: li r3, 1
685 ; CHECK-P9-NEXT: stxsibx vs35, 0, r5
686 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 12
687 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
688 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 15
689 ; CHECK-P9-NEXT: li r3, 2
690 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
691 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 1
692 ; CHECK-P9-NEXT: li r3, 3
693 ; CHECK-P9-NEXT: vsldoi v2, v2, v2, 2
694 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
695 ; CHECK-P9-NEXT: li r3, 4
696 ; CHECK-P9-NEXT: stxsibx vs34, r5, r3
699 ; CHECK-P9-BE-LABEL: test_5_consecutive_stores_of_bytes:
700 ; CHECK-P9-BE: # %bb.0: # %entry
701 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 13
702 ; CHECK-P9-BE-NEXT: li r3, 1
703 ; CHECK-P9-BE-NEXT: stxsibx vs35, 0, r5
704 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 5
705 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
706 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 2
707 ; CHECK-P9-BE-NEXT: li r3, 2
708 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
709 ; CHECK-P9-BE-NEXT: li r3, 3
710 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
711 ; CHECK-P9-BE-NEXT: vsldoi v2, v2, v2, 15
712 ; CHECK-P9-BE-NEXT: li r3, 4
713 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
714 ; CHECK-P9-BE-NEXT: blr
716 %vecext = extractelement <16 x i8> %a, i32 4
717 store i8 %vecext, ptr %b, align 1
718 %vecext1 = extractelement <16 x i8> %a, i32 12
719 %arrayidx2 = getelementptr inbounds i8, ptr %b, i64 1
720 store i8 %vecext1, ptr %arrayidx2, align 1
721 %vecext3 = extractelement <16 x i8> %a, i32 9
722 %arrayidx4 = getelementptr inbounds i8, ptr %b, i64 2
723 store i8 %vecext3, ptr %arrayidx4, align 1
724 %vecext5 = extractelement <16 x i8> %a, i32 7
725 %arrayidx6 = getelementptr inbounds i8, ptr %b, i64 3
726 store i8 %vecext5, ptr %arrayidx6, align 1
727 %vecext7 = extractelement <16 x i8> %a, i32 6
728 %arrayidx8 = getelementptr inbounds i8, ptr %b, i64 4
729 store i8 %vecext7, ptr %arrayidx8, align 1
733 define void @test_13_consecutive_stores_of_bytes(<16 x i8> %a, ptr nocapture %b) local_unnamed_addr #0 {
734 ; CHECK-LABEL: test_13_consecutive_stores_of_bytes:
735 ; CHECK: # %bb.0: # %entry
736 ; CHECK-NEXT: mfvsrd r3, vs34
737 ; CHECK-NEXT: xxswapd vs0, vs34
738 ; CHECK-NEXT: rldicl r6, r3, 32, 56
739 ; CHECK-NEXT: mffprd r4, f0
740 ; CHECK-NEXT: stb r6, 1(r5)
741 ; CHECK-NEXT: rldicl r6, r3, 56, 56
742 ; CHECK-NEXT: stb r6, 2(r5)
743 ; CHECK-NEXT: rldicl r6, r3, 40, 56
744 ; CHECK-NEXT: stb r6, 6(r5)
745 ; CHECK-NEXT: rldicl r6, r3, 24, 56
746 ; CHECK-NEXT: stb r6, 7(r5)
747 ; CHECK-NEXT: rldicl r6, r3, 8, 56
748 ; CHECK-NEXT: rldicl r3, r3, 16, 56
749 ; CHECK-NEXT: stb r6, 9(r5)
750 ; CHECK-NEXT: rldicl r6, r4, 32, 56
751 ; CHECK-NEXT: stb r3, 12(r5)
752 ; CHECK-NEXT: stb r6, 0(r5)
753 ; CHECK-NEXT: rldicl r6, r4, 8, 56
754 ; CHECK-NEXT: stb r6, 3(r5)
755 ; CHECK-NEXT: rldicl r6, r4, 16, 56
756 ; CHECK-NEXT: stb r6, 4(r5)
757 ; CHECK-NEXT: clrldi r6, r4, 56
758 ; CHECK-NEXT: stb r6, 5(r5)
759 ; CHECK-NEXT: rldicl r6, r4, 48, 56
760 ; CHECK-NEXT: stb r6, 8(r5)
761 ; CHECK-NEXT: rldicl r6, r4, 56, 56
762 ; CHECK-NEXT: rldicl r4, r4, 24, 56
763 ; CHECK-NEXT: stb r6, 10(r5)
764 ; CHECK-NEXT: stb r4, 11(r5)
767 ; CHECK-BE-LABEL: test_13_consecutive_stores_of_bytes:
768 ; CHECK-BE: # %bb.0: # %entry
769 ; CHECK-BE-NEXT: mfvsrd r3, vs34
770 ; CHECK-BE-NEXT: xxswapd vs0, vs34
771 ; CHECK-BE-NEXT: rldicl r6, r3, 40, 56
772 ; CHECK-BE-NEXT: mffprd r4, f0
773 ; CHECK-BE-NEXT: stb r6, 0(r5)
774 ; CHECK-BE-NEXT: clrldi r6, r3, 56
775 ; CHECK-BE-NEXT: stb r6, 3(r5)
776 ; CHECK-BE-NEXT: rldicl r6, r3, 56, 56
777 ; CHECK-BE-NEXT: stb r6, 4(r5)
778 ; CHECK-BE-NEXT: rldicl r6, r3, 8, 56
779 ; CHECK-BE-NEXT: stb r6, 5(r5)
780 ; CHECK-BE-NEXT: rldicl r6, r3, 24, 56
781 ; CHECK-BE-NEXT: stb r6, 8(r5)
782 ; CHECK-BE-NEXT: rldicl r6, r3, 16, 56
783 ; CHECK-BE-NEXT: rldicl r3, r3, 48, 56
784 ; CHECK-BE-NEXT: stb r6, 10(r5)
785 ; CHECK-BE-NEXT: rldicl r6, r4, 40, 56
786 ; CHECK-BE-NEXT: stb r3, 11(r5)
787 ; CHECK-BE-NEXT: rldicl r3, r4, 56, 56
788 ; CHECK-BE-NEXT: stb r6, 1(r5)
789 ; CHECK-BE-NEXT: rldicl r6, r4, 16, 56
790 ; CHECK-BE-NEXT: stb r3, 12(r5)
791 ; CHECK-BE-NEXT: stb r6, 2(r5)
792 ; CHECK-BE-NEXT: rldicl r6, r4, 32, 56
793 ; CHECK-BE-NEXT: stb r6, 6(r5)
794 ; CHECK-BE-NEXT: rldicl r6, r4, 48, 56
795 ; CHECK-BE-NEXT: stb r6, 7(r5)
796 ; CHECK-BE-NEXT: clrldi r6, r4, 56
797 ; CHECK-BE-NEXT: stb r6, 9(r5)
800 ; CHECK-P9-LABEL: test_13_consecutive_stores_of_bytes:
801 ; CHECK-P9: # %bb.0: # %entry
802 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 12
803 ; CHECK-P9-NEXT: li r3, 1
804 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
805 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 15
806 ; CHECK-P9-NEXT: li r3, 2
807 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
808 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 1
809 ; CHECK-P9-NEXT: li r3, 3
810 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
811 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 2
812 ; CHECK-P9-NEXT: li r3, 4
813 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
814 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 4
815 ; CHECK-P9-NEXT: li r3, 5
816 ; CHECK-P9-NEXT: stxsibx vs35, 0, r5
817 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 8
818 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
819 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 13
820 ; CHECK-P9-NEXT: li r3, 6
821 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
822 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 11
823 ; CHECK-P9-NEXT: li r3, 7
824 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
825 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 6
826 ; CHECK-P9-NEXT: li r3, 8
827 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
828 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 9
829 ; CHECK-P9-NEXT: li r3, 9
830 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
831 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 7
832 ; CHECK-P9-NEXT: li r3, 10
833 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
834 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 3
835 ; CHECK-P9-NEXT: li r3, 11
836 ; CHECK-P9-NEXT: vsldoi v2, v2, v2, 10
837 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
838 ; CHECK-P9-NEXT: li r3, 12
839 ; CHECK-P9-NEXT: stxsibx vs34, r5, r3
842 ; CHECK-P9-BE-LABEL: test_13_consecutive_stores_of_bytes:
843 ; CHECK-P9-BE: # %bb.0: # %entry
844 ; CHECK-P9-BE-NEXT: li r3, 3
845 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 5
846 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
847 ; CHECK-P9-BE-NEXT: li r3, 1
848 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
849 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 2
850 ; CHECK-P9-BE-NEXT: li r3, 2
851 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
852 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 15
853 ; CHECK-P9-BE-NEXT: li r3, 4
854 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
855 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 13
856 ; CHECK-P9-BE-NEXT: li r3, 5
857 ; CHECK-P9-BE-NEXT: stxsibx vs35, 0, r5
858 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 9
859 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
860 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 4
861 ; CHECK-P9-BE-NEXT: li r3, 6
862 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
863 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 6
864 ; CHECK-P9-BE-NEXT: li r3, 7
865 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
866 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 11
867 ; CHECK-P9-BE-NEXT: li r3, 8
868 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
869 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 8
870 ; CHECK-P9-BE-NEXT: li r3, 9
871 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
872 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 10
873 ; CHECK-P9-BE-NEXT: li r3, 10
874 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
875 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 14
876 ; CHECK-P9-BE-NEXT: li r3, 11
877 ; CHECK-P9-BE-NEXT: vsldoi v2, v2, v2, 7
878 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
879 ; CHECK-P9-BE-NEXT: li r3, 12
880 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
881 ; CHECK-P9-BE-NEXT: blr
883 %vecext = extractelement <16 x i8> %a, i32 4
884 store i8 %vecext, ptr %b, align 1
885 %vecext1 = extractelement <16 x i8> %a, i32 12
886 %arrayidx2 = getelementptr inbounds i8, ptr %b, i64 1
887 store i8 %vecext1, ptr %arrayidx2, align 1
888 %vecext3 = extractelement <16 x i8> %a, i32 9
889 %arrayidx4 = getelementptr inbounds i8, ptr %b, i64 2
890 store i8 %vecext3, ptr %arrayidx4, align 1
891 %vecext5 = extractelement <16 x i8> %a, i32 7
892 %arrayidx6 = getelementptr inbounds i8, ptr %b, i64 3
893 store i8 %vecext5, ptr %arrayidx6, align 1
894 %vecext7 = extractelement <16 x i8> %a, i32 6
895 %arrayidx8 = getelementptr inbounds i8, ptr %b, i64 4
896 store i8 %vecext7, ptr %arrayidx8, align 1
897 %vecext9 = extractelement <16 x i8> %a, i32 0
898 %arrayidx10 = getelementptr inbounds i8, ptr %b, i64 5
899 store i8 %vecext9, ptr %arrayidx10, align 1
900 %vecext11 = extractelement <16 x i8> %a, i32 11
901 %arrayidx12 = getelementptr inbounds i8, ptr %b, i64 6
902 store i8 %vecext11, ptr %arrayidx12, align 1
903 %vecext13 = extractelement <16 x i8> %a, i32 13
904 %arrayidx14 = getelementptr inbounds i8, ptr %b, i64 7
905 store i8 %vecext13, ptr %arrayidx14, align 1
906 %vecext15 = extractelement <16 x i8> %a, i32 2
907 %arrayidx16 = getelementptr inbounds i8, ptr %b, i64 8
908 store i8 %vecext15, ptr %arrayidx16, align 1
909 %vecext17 = extractelement <16 x i8> %a, i32 15
910 %arrayidx18 = getelementptr inbounds i8, ptr %b, i64 9
911 store i8 %vecext17, ptr %arrayidx18, align 1
912 %vecext19 = extractelement <16 x i8> %a, i32 1
913 %arrayidx20 = getelementptr inbounds i8, ptr %b, i64 10
914 store i8 %vecext19, ptr %arrayidx20, align 1
915 %vecext21 = extractelement <16 x i8> %a, i32 5
916 %arrayidx22 = getelementptr inbounds i8, ptr %b, i64 11
917 store i8 %vecext21, ptr %arrayidx22, align 1
918 %vecext23 = extractelement <16 x i8> %a, i32 14
919 %arrayidx24 = getelementptr inbounds i8, ptr %b, i64 12
920 store i8 %vecext23, ptr %arrayidx24, align 1
924 define void @test_elements_from_two_vec(<4 x i32> %a, <4 x i32> %b, ptr nocapture %c) local_unnamed_addr #0 {
925 ; CHECK-LABEL: test_elements_from_two_vec:
926 ; CHECK: # %bb.0: # %entry
927 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2
928 ; CHECK-NEXT: xxsldwi vs1, vs35, vs35, 1
929 ; CHECK-NEXT: li r3, 4
930 ; CHECK-NEXT: stfiwx f0, r7, r3
931 ; CHECK-NEXT: stfiwx f1, 0, r7
934 ; CHECK-BE-LABEL: test_elements_from_two_vec:
935 ; CHECK-BE: # %bb.0: # %entry
936 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
937 ; CHECK-BE-NEXT: li r3, 4
938 ; CHECK-BE-NEXT: stxsiwx vs35, 0, r7
939 ; CHECK-BE-NEXT: stfiwx f0, r7, r3
942 ; CHECK-P9-LABEL: test_elements_from_two_vec:
943 ; CHECK-P9: # %bb.0: # %entry
944 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2
945 ; CHECK-P9-NEXT: li r3, 4
946 ; CHECK-P9-NEXT: stfiwx f0, r7, r3
947 ; CHECK-P9-NEXT: xxsldwi vs0, vs35, vs35, 1
948 ; CHECK-P9-NEXT: stfiwx f0, 0, r7
951 ; CHECK-P9-BE-LABEL: test_elements_from_two_vec:
952 ; CHECK-P9-BE: # %bb.0: # %entry
953 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
954 ; CHECK-P9-BE-NEXT: li r3, 4
955 ; CHECK-P9-BE-NEXT: stxsiwx vs35, 0, r7
956 ; CHECK-P9-BE-NEXT: stfiwx f0, r7, r3
957 ; CHECK-P9-BE-NEXT: blr
959 %vecext = extractelement <4 x i32> %a, i32 0
960 %arrayidx = getelementptr inbounds i32, ptr %c, i64 1
961 store i32 %vecext, ptr %arrayidx, align 4
962 %vecext1 = extractelement <4 x i32> %b, i32 1
963 store i32 %vecext1, ptr %c, align 4
967 define dso_local void @test_elements_from_three_vec(<4 x float> %a, <4 x float> %b, <4 x float> %c, ptr nocapture %d) local_unnamed_addr #0 {
968 ; CHECK-LABEL: test_elements_from_three_vec:
969 ; CHECK: # %bb.0: # %entry
970 ; CHECK-NEXT: li r3, 4
971 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 3
972 ; CHECK-NEXT: xxsldwi vs1, vs36, vs36, 1
973 ; CHECK-NEXT: stxsiwx vs35, r9, r3
974 ; CHECK-NEXT: li r3, 8
975 ; CHECK-NEXT: stfiwx f0, 0, r9
976 ; CHECK-NEXT: stfiwx f1, r9, r3
979 ; CHECK-BE-LABEL: test_elements_from_three_vec:
980 ; CHECK-BE: # %bb.0: # %entry
981 ; CHECK-BE-NEXT: xxsldwi vs1, vs35, vs35, 1
982 ; CHECK-BE-NEXT: li r3, 4
983 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
984 ; CHECK-BE-NEXT: stfiwx f1, r9, r3
985 ; CHECK-BE-NEXT: li r3, 8
986 ; CHECK-BE-NEXT: stfiwx f0, 0, r9
987 ; CHECK-BE-NEXT: stxsiwx vs36, r9, r3
990 ; CHECK-P9-LABEL: test_elements_from_three_vec:
991 ; CHECK-P9: # %bb.0: # %entry
992 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3
993 ; CHECK-P9-NEXT: li r3, 4
994 ; CHECK-P9-NEXT: stxsiwx vs35, r9, r3
995 ; CHECK-P9-NEXT: li r3, 8
996 ; CHECK-P9-NEXT: stfiwx f0, 0, r9
997 ; CHECK-P9-NEXT: xxsldwi vs0, vs36, vs36, 1
998 ; CHECK-P9-NEXT: stfiwx f0, r9, r3
1001 ; CHECK-P9-BE-LABEL: test_elements_from_three_vec:
1002 ; CHECK-P9-BE: # %bb.0: # %entry
1003 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
1004 ; CHECK-P9-BE-NEXT: li r3, 4
1005 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r9
1006 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs35, vs35, 1
1007 ; CHECK-P9-BE-NEXT: stfiwx f0, r9, r3
1008 ; CHECK-P9-BE-NEXT: li r3, 8
1009 ; CHECK-P9-BE-NEXT: stxsiwx vs36, r9, r3
1010 ; CHECK-P9-BE-NEXT: blr
1012 %vecext = extractelement <4 x float> %a, i32 3
1013 store float %vecext, ptr %d, align 4
1014 %vecext1 = extractelement <4 x float> %b, i32 2
1015 %arrayidx2 = getelementptr inbounds float, ptr %d, i64 1
1016 store float %vecext1, ptr %arrayidx2, align 4
1017 %vecext3 = extractelement <4 x float> %c, i32 1
1018 %arrayidx4 = getelementptr inbounds float, ptr %d, i64 2
1019 store float %vecext3, ptr %arrayidx4, align 4