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, i64* 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, i64* %ap, i64 %Idx
43 store i64 %vecext, i64* %arrayidx, align 8
47 define <2 x i64> @testll0(<2 x i64> returned %a, <2 x i64> %b, i64* 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, i64* %ap, i64 3
73 store i64 %vecext, i64* %arrayidx, align 8
77 ; Function Attrs: norecurse nounwind writeonly
78 define <2 x i64> @testll1(<2 x i64> returned %a, i64 %b, i64* 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, i64* %ap, i64 3
104 store i64 %vecext, i64* %arrayidx, align 8
108 define <2 x double> @testdv(<2 x double> returned %a, <2 x double> %b, double* 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, double* %ap, i64 %Idx
137 store double %vecext, double* %arrayidx, align 8
141 define <2 x double> @testd0(<2 x double> returned %a, <2 x double> %b, double* 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, double* %ap, i64 3
167 store double %vecext, double* %arrayidx, align 8
171 ; Function Attrs: norecurse nounwind writeonly
172 define <2 x double> @testd1(<2 x double> returned %a, <2 x double> %b, double* 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, double* %ap, i64 3
198 store double %vecext, double* %arrayidx, align 8
202 ; Function Attrs: norecurse nounwind writeonly
203 define <4 x float> @testf0(<4 x float> returned %a, <4 x float> %b, float* 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, float* %ap, i64 3
234 store float %vecext, float* %arrayidx, align 4
238 ; Function Attrs: norecurse nounwind writeonly
239 define <4 x float> @testf1(<4 x float> returned %a, <4 x float> %b, float* 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, float* %ap, i64 3
268 store float %vecext, float* %arrayidx, align 4
272 ; Function Attrs: norecurse nounwind writeonly
273 define <4 x float> @testf2(<4 x float> returned %a, <4 x float> %b, float* 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, float* %ap, i64 3
302 store float %vecext, float* %arrayidx, align 4
306 ; Function Attrs: norecurse nounwind writeonly
307 define <4 x float> @testf3(<4 x float> returned %a, <4 x float> %b, float* 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, float* %ap, i64 3
338 store float %vecext, float* %arrayidx, align 4
342 ; Function Attrs: norecurse nounwind writeonly
343 define <4 x i32> @testi0(<4 x i32> returned %a, <4 x i32> %b, i32* 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, i32* %ap, i64 3
374 store i32 %vecext, i32* %arrayidx, align 4
378 ; Function Attrs: norecurse nounwind writeonly
379 define <4 x i32> @testi1(<4 x i32> returned %a, <4 x i32> %b, i32* 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, i32* %ap, i64 3
408 store i32 %vecext, i32* %arrayidx, align 4
412 ; Function Attrs: norecurse nounwind writeonly
413 define <4 x i32> @testi2(<4 x i32> returned %a, <4 x i32> %b, i32* 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, i32* %ap, i64 3
442 store i32 %vecext, i32* %arrayidx, align 4
446 ; Function Attrs: norecurse nounwind writeonly
447 define <4 x i32> @testi3(<4 x i32> returned %a, <4 x i32> %b, i32* 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, i32* %ap, i64 3
478 store i32 %vecext, i32* %arrayidx, align 4
482 define dso_local void @test_consecutive_i32(<4 x i32> %a, i32* 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: stfiwx f0, 0, r5
505 ; CHECK-P9-NEXT: stxsiwx vs34, r5, r3
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: stfiwx f0, 0, r5
512 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
513 ; CHECK-P9-BE-NEXT: li r3, 4
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, i32* %b, align 4
520 %vecext1 = extractelement <4 x i32> %a, i32 2
521 %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 1
522 store i32 %vecext1, i32* %arrayidx2, align 4
526 define dso_local void @test_consecutive_float(<4 x float> %a, float* 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: stfiwx f0, 0, r5
548 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3
549 ; CHECK-P9-NEXT: li r3, 4
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, float* %b, align 4
563 %vecext1 = extractelement <4 x float> %a, i32 3
564 %arrayidx2 = getelementptr inbounds float, float* %b, i64 1
565 store float %vecext1, float* %arrayidx2, align 4
569 define dso_local void @test_stores_exceed_vec_size(<4 x i32> %a, i32* 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: li r4, 20
575 ; CHECK-NEXT: addi r3, r3, .LCPI16_0@toc@l
576 ; CHECK-NEXT: lvx v3, 0, r3
577 ; CHECK-NEXT: li r3, 16
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: stxsiwx vs34, r5, r4
585 ; CHECK-BE-LABEL: test_stores_exceed_vec_size:
586 ; CHECK-BE: # %bb.0: # %entry
587 ; CHECK-BE-NEXT: xxspltw vs0, vs34, 0
588 ; CHECK-BE-NEXT: xxsldwi vs1, vs34, vs34, 1
589 ; CHECK-BE-NEXT: li r3, 16
590 ; CHECK-BE-NEXT: li r4, 20
591 ; CHECK-BE-NEXT: stxsiwx vs34, r5, r3
592 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs0, 2
593 ; CHECK-BE-NEXT: stxvw4x vs0, 0, r5
594 ; CHECK-BE-NEXT: stfiwx f1, r5, r4
597 ; CHECK-P9-LABEL: test_stores_exceed_vec_size:
598 ; CHECK-P9: # %bb.0: # %entry
599 ; CHECK-P9-NEXT: addis r3, r2, .LCPI16_0@toc@ha
600 ; CHECK-P9-NEXT: addi r3, r3, .LCPI16_0@toc@l
601 ; CHECK-P9-NEXT: lxvx vs35, 0, r3
602 ; CHECK-P9-NEXT: li r3, 16
603 ; CHECK-P9-NEXT: vperm v3, v2, v2, v3
604 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1
605 ; CHECK-P9-NEXT: stxv vs35, 0(r5)
606 ; CHECK-P9-NEXT: stfiwx f0, r5, r3
607 ; CHECK-P9-NEXT: li r3, 20
608 ; CHECK-P9-NEXT: stxsiwx vs34, r5, r3
611 ; CHECK-P9-BE-LABEL: test_stores_exceed_vec_size:
612 ; CHECK-P9-BE: # %bb.0: # %entry
613 ; CHECK-P9-BE-NEXT: xxspltw vs0, vs34, 0
614 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs0, 2
615 ; CHECK-P9-BE-NEXT: li r3, 16
616 ; CHECK-P9-BE-NEXT: stxv vs0, 0(r5)
617 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1
618 ; CHECK-P9-BE-NEXT: stxsiwx vs34, r5, r3
619 ; CHECK-P9-BE-NEXT: li r3, 20
620 ; CHECK-P9-BE-NEXT: stfiwx f0, r5, r3
621 ; CHECK-P9-BE-NEXT: blr
623 %vecext = extractelement <4 x i32> %a, i32 2
624 store i32 %vecext, i32* %b, align 4
625 %vecext1 = extractelement <4 x i32> %a, i32 3
626 %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 1
627 store i32 %vecext1, i32* %arrayidx2, align 4
628 %vecext3 = extractelement <4 x i32> %a, i32 0
629 %arrayidx4 = getelementptr inbounds i32, i32* %b, i64 2
630 store i32 %vecext3, i32* %arrayidx4, align 4
631 %arrayidx6 = getelementptr inbounds i32, i32* %b, i64 3
632 store i32 %vecext3, i32* %arrayidx6, align 4
633 %vecext7 = extractelement <4 x i32> %a, i32 1
634 %arrayidx8 = getelementptr inbounds i32, i32* %b, i64 4
635 store i32 %vecext7, i32* %arrayidx8, align 4
636 %arrayidx10 = getelementptr inbounds i32, i32* %b, i64 5
637 store i32 %vecext, i32* %arrayidx10, align 4
641 define void @test_5_consecutive_stores_of_bytes(<16 x i8> %a, i8* nocapture %b) local_unnamed_addr #0 {
642 ; CHECK-LABEL: test_5_consecutive_stores_of_bytes:
643 ; CHECK: # %bb.0: # %entry
644 ; CHECK-NEXT: xxswapd vs0, vs34
645 ; CHECK-NEXT: mfvsrd r3, vs34
646 ; CHECK-NEXT: rldicl r6, r3, 32, 56
647 ; CHECK-NEXT: rldicl r3, r3, 56, 56
648 ; CHECK-NEXT: mfvsrd r4, f0
649 ; CHECK-NEXT: stb r6, 1(r5)
650 ; CHECK-NEXT: stb r3, 2(r5)
651 ; CHECK-NEXT: rldicl r6, r4, 32, 56
652 ; CHECK-NEXT: rldicl r3, r4, 8, 56
653 ; CHECK-NEXT: rldicl r4, r4, 16, 56
654 ; CHECK-NEXT: stb r6, 0(r5)
655 ; CHECK-NEXT: stb r3, 3(r5)
656 ; CHECK-NEXT: stb r4, 4(r5)
659 ; CHECK-BE-LABEL: test_5_consecutive_stores_of_bytes:
660 ; CHECK-BE: # %bb.0: # %entry
661 ; CHECK-BE-NEXT: xxswapd vs0, vs34
662 ; CHECK-BE-NEXT: mfvsrd r3, vs34
663 ; CHECK-BE-NEXT: rldicl r6, r3, 40, 56
664 ; CHECK-BE-NEXT: mfvsrd r4, f0
665 ; CHECK-BE-NEXT: stb r6, 0(r5)
666 ; CHECK-BE-NEXT: rldicl r6, r4, 40, 56
667 ; CHECK-BE-NEXT: rldicl r4, r4, 16, 56
668 ; CHECK-BE-NEXT: stb r6, 1(r5)
669 ; CHECK-BE-NEXT: clrldi r6, r3, 56
670 ; CHECK-BE-NEXT: rldicl r3, r3, 56, 56
671 ; CHECK-BE-NEXT: stb r4, 2(r5)
672 ; CHECK-BE-NEXT: stb r6, 3(r5)
673 ; CHECK-BE-NEXT: stb r3, 4(r5)
676 ; CHECK-P9-LABEL: test_5_consecutive_stores_of_bytes:
677 ; CHECK-P9: # %bb.0: # %entry
678 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 4
679 ; CHECK-P9-NEXT: stxsibx vs35, 0, r5
680 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 12
681 ; CHECK-P9-NEXT: li r3, 1
682 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
683 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 15
684 ; CHECK-P9-NEXT: li r3, 2
685 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
686 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 1
687 ; CHECK-P9-NEXT: li r3, 3
688 ; CHECK-P9-NEXT: vsldoi v2, v2, v2, 2
689 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
690 ; CHECK-P9-NEXT: li r3, 4
691 ; CHECK-P9-NEXT: stxsibx vs34, r5, r3
694 ; CHECK-P9-BE-LABEL: test_5_consecutive_stores_of_bytes:
695 ; CHECK-P9-BE: # %bb.0: # %entry
696 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 13
697 ; CHECK-P9-BE-NEXT: stxsibx vs35, 0, r5
698 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 5
699 ; CHECK-P9-BE-NEXT: li r3, 1
700 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
701 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 2
702 ; CHECK-P9-BE-NEXT: li r3, 2
703 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
704 ; CHECK-P9-BE-NEXT: li r3, 3
705 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
706 ; CHECK-P9-BE-NEXT: vsldoi v2, v2, v2, 15
707 ; CHECK-P9-BE-NEXT: li r3, 4
708 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
709 ; CHECK-P9-BE-NEXT: blr
711 %vecext = extractelement <16 x i8> %a, i32 4
712 store i8 %vecext, i8* %b, align 1
713 %vecext1 = extractelement <16 x i8> %a, i32 12
714 %arrayidx2 = getelementptr inbounds i8, i8* %b, i64 1
715 store i8 %vecext1, i8* %arrayidx2, align 1
716 %vecext3 = extractelement <16 x i8> %a, i32 9
717 %arrayidx4 = getelementptr inbounds i8, i8* %b, i64 2
718 store i8 %vecext3, i8* %arrayidx4, align 1
719 %vecext5 = extractelement <16 x i8> %a, i32 7
720 %arrayidx6 = getelementptr inbounds i8, i8* %b, i64 3
721 store i8 %vecext5, i8* %arrayidx6, align 1
722 %vecext7 = extractelement <16 x i8> %a, i32 6
723 %arrayidx8 = getelementptr inbounds i8, i8* %b, i64 4
724 store i8 %vecext7, i8* %arrayidx8, align 1
728 define void @test_13_consecutive_stores_of_bytes(<16 x i8> %a, i8* nocapture %b) local_unnamed_addr #0 {
729 ; CHECK-LABEL: test_13_consecutive_stores_of_bytes:
730 ; CHECK: # %bb.0: # %entry
731 ; CHECK-NEXT: xxswapd vs0, vs34
732 ; CHECK-NEXT: mfvsrd r3, vs34
733 ; CHECK-NEXT: rldicl r4, r3, 32, 56
734 ; CHECK-NEXT: rldicl r6, r3, 56, 56
735 ; CHECK-NEXT: stb r4, 1(r5)
736 ; CHECK-NEXT: rldicl r4, r3, 40, 56
737 ; CHECK-NEXT: mfvsrd r7, f0
738 ; CHECK-NEXT: stb r6, 2(r5)
739 ; CHECK-NEXT: rldicl r6, r3, 24, 56
740 ; CHECK-NEXT: stb r4, 6(r5)
741 ; CHECK-NEXT: rldicl r4, r3, 8, 56
742 ; CHECK-NEXT: stb r6, 7(r5)
743 ; CHECK-NEXT: rldicl r3, r3, 16, 56
744 ; CHECK-NEXT: stb r4, 9(r5)
745 ; CHECK-NEXT: rldicl r4, r7, 32, 56
746 ; CHECK-NEXT: rldicl r6, r7, 8, 56
747 ; CHECK-NEXT: stb r3, 12(r5)
748 ; CHECK-NEXT: stb r4, 0(r5)
749 ; CHECK-NEXT: rldicl r4, r7, 16, 56
750 ; CHECK-NEXT: stb r6, 3(r5)
751 ; CHECK-NEXT: clrldi r6, r7, 56
752 ; CHECK-NEXT: stb r4, 4(r5)
753 ; CHECK-NEXT: rldicl r4, r7, 48, 56
754 ; CHECK-NEXT: stb r6, 5(r5)
755 ; CHECK-NEXT: rldicl r6, r7, 56, 56
756 ; CHECK-NEXT: stb r4, 8(r5)
757 ; CHECK-NEXT: rldicl r4, r7, 24, 56
758 ; CHECK-NEXT: stb r6, 10(r5)
759 ; CHECK-NEXT: stb r4, 11(r5)
762 ; CHECK-BE-LABEL: test_13_consecutive_stores_of_bytes:
763 ; CHECK-BE: # %bb.0: # %entry
764 ; CHECK-BE-NEXT: mfvsrd r3, vs34
765 ; CHECK-BE-NEXT: xxswapd vs0, vs34
766 ; CHECK-BE-NEXT: rldicl r4, r3, 40, 56
767 ; CHECK-BE-NEXT: clrldi r6, r3, 56
768 ; CHECK-BE-NEXT: stb r4, 0(r5)
769 ; CHECK-BE-NEXT: rldicl r4, r3, 56, 56
770 ; CHECK-BE-NEXT: mfvsrd r7, f0
771 ; CHECK-BE-NEXT: stb r6, 3(r5)
772 ; CHECK-BE-NEXT: rldicl r6, r3, 8, 56
773 ; CHECK-BE-NEXT: stb r4, 4(r5)
774 ; CHECK-BE-NEXT: rldicl r4, r3, 24, 56
775 ; CHECK-BE-NEXT: stb r6, 5(r5)
776 ; CHECK-BE-NEXT: rldicl r6, r3, 16, 56
777 ; CHECK-BE-NEXT: stb r4, 8(r5)
778 ; CHECK-BE-NEXT: rldicl r4, r7, 40, 56
779 ; CHECK-BE-NEXT: stb r6, 10(r5)
780 ; CHECK-BE-NEXT: rldicl r6, r7, 16, 56
781 ; CHECK-BE-NEXT: stb r4, 1(r5)
782 ; CHECK-BE-NEXT: rldicl r4, r7, 32, 56
783 ; CHECK-BE-NEXT: stb r6, 2(r5)
784 ; CHECK-BE-NEXT: rldicl r6, r7, 48, 56
785 ; CHECK-BE-NEXT: stb r4, 6(r5)
786 ; CHECK-BE-NEXT: clrldi r4, r7, 56
787 ; CHECK-BE-NEXT: stb r6, 7(r5)
788 ; CHECK-BE-NEXT: rldicl r3, r3, 48, 56
789 ; CHECK-BE-NEXT: rldicl r6, r7, 56, 56
790 ; CHECK-BE-NEXT: stb r4, 9(r5)
791 ; CHECK-BE-NEXT: stb r3, 11(r5)
792 ; CHECK-BE-NEXT: stb r6, 12(r5)
795 ; CHECK-P9-LABEL: test_13_consecutive_stores_of_bytes:
796 ; CHECK-P9: # %bb.0: # %entry
797 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 4
798 ; CHECK-P9-NEXT: stxsibx vs35, 0, r5
799 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 12
800 ; CHECK-P9-NEXT: li r3, 1
801 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
802 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 15
803 ; CHECK-P9-NEXT: li r3, 2
804 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
805 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 1
806 ; CHECK-P9-NEXT: li r3, 3
807 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
808 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 2
809 ; CHECK-P9-NEXT: li r3, 4
810 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
811 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 8
812 ; CHECK-P9-NEXT: li r3, 5
813 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
814 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 13
815 ; CHECK-P9-NEXT: li r3, 6
816 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
817 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 11
818 ; CHECK-P9-NEXT: li r3, 7
819 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
820 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 6
821 ; CHECK-P9-NEXT: li r3, 8
822 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
823 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 9
824 ; CHECK-P9-NEXT: li r3, 9
825 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
826 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 7
827 ; CHECK-P9-NEXT: li r3, 10
828 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
829 ; CHECK-P9-NEXT: vsldoi v3, v2, v2, 3
830 ; CHECK-P9-NEXT: li r3, 11
831 ; CHECK-P9-NEXT: vsldoi v2, v2, v2, 10
832 ; CHECK-P9-NEXT: stxsibx vs35, r5, r3
833 ; CHECK-P9-NEXT: li r3, 12
834 ; CHECK-P9-NEXT: stxsibx vs34, r5, r3
837 ; CHECK-P9-BE-LABEL: test_13_consecutive_stores_of_bytes:
838 ; CHECK-P9-BE: # %bb.0: # %entry
839 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 13
840 ; CHECK-P9-BE-NEXT: stxsibx vs35, 0, r5
841 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 5
842 ; CHECK-P9-BE-NEXT: li r3, 1
843 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
844 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 2
845 ; CHECK-P9-BE-NEXT: li r3, 2
846 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
847 ; CHECK-P9-BE-NEXT: li r3, 3
848 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 15
849 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
850 ; CHECK-P9-BE-NEXT: li r3, 4
851 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
852 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 9
853 ; CHECK-P9-BE-NEXT: li r3, 5
854 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
855 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 4
856 ; CHECK-P9-BE-NEXT: li r3, 6
857 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
858 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 6
859 ; CHECK-P9-BE-NEXT: li r3, 7
860 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
861 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 11
862 ; CHECK-P9-BE-NEXT: li r3, 8
863 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
864 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 8
865 ; CHECK-P9-BE-NEXT: li r3, 9
866 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
867 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 10
868 ; CHECK-P9-BE-NEXT: li r3, 10
869 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
870 ; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 14
871 ; CHECK-P9-BE-NEXT: li r3, 11
872 ; CHECK-P9-BE-NEXT: vsldoi v2, v2, v2, 7
873 ; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3
874 ; CHECK-P9-BE-NEXT: li r3, 12
875 ; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3
876 ; CHECK-P9-BE-NEXT: blr
878 %vecext = extractelement <16 x i8> %a, i32 4
879 store i8 %vecext, i8* %b, align 1
880 %vecext1 = extractelement <16 x i8> %a, i32 12
881 %arrayidx2 = getelementptr inbounds i8, i8* %b, i64 1
882 store i8 %vecext1, i8* %arrayidx2, align 1
883 %vecext3 = extractelement <16 x i8> %a, i32 9
884 %arrayidx4 = getelementptr inbounds i8, i8* %b, i64 2
885 store i8 %vecext3, i8* %arrayidx4, align 1
886 %vecext5 = extractelement <16 x i8> %a, i32 7
887 %arrayidx6 = getelementptr inbounds i8, i8* %b, i64 3
888 store i8 %vecext5, i8* %arrayidx6, align 1
889 %vecext7 = extractelement <16 x i8> %a, i32 6
890 %arrayidx8 = getelementptr inbounds i8, i8* %b, i64 4
891 store i8 %vecext7, i8* %arrayidx8, align 1
892 %vecext9 = extractelement <16 x i8> %a, i32 0
893 %arrayidx10 = getelementptr inbounds i8, i8* %b, i64 5
894 store i8 %vecext9, i8* %arrayidx10, align 1
895 %vecext11 = extractelement <16 x i8> %a, i32 11
896 %arrayidx12 = getelementptr inbounds i8, i8* %b, i64 6
897 store i8 %vecext11, i8* %arrayidx12, align 1
898 %vecext13 = extractelement <16 x i8> %a, i32 13
899 %arrayidx14 = getelementptr inbounds i8, i8* %b, i64 7
900 store i8 %vecext13, i8* %arrayidx14, align 1
901 %vecext15 = extractelement <16 x i8> %a, i32 2
902 %arrayidx16 = getelementptr inbounds i8, i8* %b, i64 8
903 store i8 %vecext15, i8* %arrayidx16, align 1
904 %vecext17 = extractelement <16 x i8> %a, i32 15
905 %arrayidx18 = getelementptr inbounds i8, i8* %b, i64 9
906 store i8 %vecext17, i8* %arrayidx18, align 1
907 %vecext19 = extractelement <16 x i8> %a, i32 1
908 %arrayidx20 = getelementptr inbounds i8, i8* %b, i64 10
909 store i8 %vecext19, i8* %arrayidx20, align 1
910 %vecext21 = extractelement <16 x i8> %a, i32 5
911 %arrayidx22 = getelementptr inbounds i8, i8* %b, i64 11
912 store i8 %vecext21, i8* %arrayidx22, align 1
913 %vecext23 = extractelement <16 x i8> %a, i32 14
914 %arrayidx24 = getelementptr inbounds i8, i8* %b, i64 12
915 store i8 %vecext23, i8* %arrayidx24, align 1
919 define void @test_elements_from_two_vec(<4 x i32> %a, <4 x i32> %b, i32* nocapture %c) local_unnamed_addr #0 {
920 ; CHECK-LABEL: test_elements_from_two_vec:
921 ; CHECK: # %bb.0: # %entry
922 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2
923 ; CHECK-NEXT: xxsldwi vs1, vs35, vs35, 1
924 ; CHECK-NEXT: li r3, 4
925 ; CHECK-NEXT: stfiwx f0, r7, r3
926 ; CHECK-NEXT: stfiwx f1, 0, r7
929 ; CHECK-BE-LABEL: test_elements_from_two_vec:
930 ; CHECK-BE: # %bb.0: # %entry
931 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
932 ; CHECK-BE-NEXT: li r3, 4
933 ; CHECK-BE-NEXT: stfiwx f0, r7, r3
934 ; CHECK-BE-NEXT: stxsiwx vs35, 0, r7
937 ; CHECK-P9-LABEL: test_elements_from_two_vec:
938 ; CHECK-P9: # %bb.0: # %entry
939 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2
940 ; CHECK-P9-NEXT: li r3, 4
941 ; CHECK-P9-NEXT: stfiwx f0, r7, r3
942 ; CHECK-P9-NEXT: xxsldwi vs0, vs35, vs35, 1
943 ; CHECK-P9-NEXT: stfiwx f0, 0, r7
946 ; CHECK-P9-BE-LABEL: test_elements_from_two_vec:
947 ; CHECK-P9-BE: # %bb.0: # %entry
948 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3
949 ; CHECK-P9-BE-NEXT: li r3, 4
950 ; CHECK-P9-BE-NEXT: stfiwx f0, r7, r3
951 ; CHECK-P9-BE-NEXT: stxsiwx vs35, 0, r7
952 ; CHECK-P9-BE-NEXT: blr
954 %vecext = extractelement <4 x i32> %a, i32 0
955 %arrayidx = getelementptr inbounds i32, i32* %c, i64 1
956 store i32 %vecext, i32* %arrayidx, align 4
957 %vecext1 = extractelement <4 x i32> %b, i32 1
958 store i32 %vecext1, i32* %c, align 4
962 define dso_local void @test_elements_from_three_vec(<4 x float> %a, <4 x float> %b, <4 x float> %c, float* nocapture %d) local_unnamed_addr #0 {
963 ; CHECK-LABEL: test_elements_from_three_vec:
964 ; CHECK: # %bb.0: # %entry
965 ; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 3
966 ; CHECK-NEXT: xxsldwi vs1, vs36, vs36, 1
967 ; CHECK-NEXT: li r3, 4
968 ; CHECK-NEXT: li r4, 8
969 ; CHECK-NEXT: stxsiwx vs35, r9, r3
970 ; CHECK-NEXT: stfiwx f0, 0, r9
971 ; CHECK-NEXT: stfiwx f1, r9, r4
974 ; CHECK-BE-LABEL: test_elements_from_three_vec:
975 ; CHECK-BE: # %bb.0: # %entry
976 ; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
977 ; CHECK-BE-NEXT: xxsldwi vs1, vs35, vs35, 1
978 ; CHECK-BE-NEXT: li r3, 4
979 ; CHECK-BE-NEXT: li r4, 8
980 ; CHECK-BE-NEXT: stfiwx f1, r9, r3
981 ; CHECK-BE-NEXT: stfiwx f0, 0, r9
982 ; CHECK-BE-NEXT: stxsiwx vs36, r9, r4
985 ; CHECK-P9-LABEL: test_elements_from_three_vec:
986 ; CHECK-P9: # %bb.0: # %entry
987 ; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3
988 ; CHECK-P9-NEXT: li r3, 4
989 ; CHECK-P9-NEXT: stfiwx f0, 0, r9
990 ; CHECK-P9-NEXT: xxsldwi vs0, vs36, vs36, 1
991 ; CHECK-P9-NEXT: stxsiwx vs35, r9, r3
992 ; CHECK-P9-NEXT: li r3, 8
993 ; CHECK-P9-NEXT: stfiwx f0, r9, r3
996 ; CHECK-P9-BE-LABEL: test_elements_from_three_vec:
997 ; CHECK-P9-BE: # %bb.0: # %entry
998 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2
999 ; CHECK-P9-BE-NEXT: stfiwx f0, 0, r9
1000 ; CHECK-P9-BE-NEXT: xxsldwi vs0, vs35, vs35, 1
1001 ; CHECK-P9-BE-NEXT: li r3, 4
1002 ; CHECK-P9-BE-NEXT: stfiwx f0, r9, r3
1003 ; CHECK-P9-BE-NEXT: li r3, 8
1004 ; CHECK-P9-BE-NEXT: stxsiwx vs36, r9, r3
1005 ; CHECK-P9-BE-NEXT: blr
1007 %vecext = extractelement <4 x float> %a, i32 3
1008 store float %vecext, float* %d, align 4
1009 %vecext1 = extractelement <4 x float> %b, i32 2
1010 %arrayidx2 = getelementptr inbounds float, float* %d, i64 1
1011 store float %vecext1, float* %arrayidx2, align 4
1012 %vecext3 = extractelement <4 x float> %c, i32 1
1013 %arrayidx4 = getelementptr inbounds float, float* %d, i64 2
1014 store float %vecext3, float* %arrayidx4, align 4