1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu \
3 ; RUN: -verify-machineinstrs -ppc-asm-full-reg-names -mcpu=pwr8 -relocation-model=pic \
5 ; RUN: llc < %s -ppc-vsr-nums-as-vr -mtriple=powerpc64le-unknown-linux-gnu \
6 ; RUN: -verify-machineinstrs -ppc-asm-full-reg-names -mcpu=pwr8 -relocation-model=pic \
7 ; RUN: | FileCheck %s -check-prefix=CHECK-LE
8 ; RUN: llc < %s -vec-extabi -mtriple=powerpc64-ibm-aix-xcoff \
9 ; RUN: -verify-machineinstrs -mcpu=pwr8 \
10 ; RUN: | FileCheck %s -check-prefix=CHECK-AIX
12 ; The build[csilf] functions simply test the scalar_to_vector handling with
13 ; direct moves. This corresponds to the "insertelement" instruction. Subsequent
14 ; to this, there will be a splat corresponding to the shufflevector.
16 @d = common global double 0.000000e+00, align 8
18 ; Function Attrs: norecurse nounwind readnone
19 define <16 x i8> @buildc(i8 zeroext %a) {
20 ; CHECK-LABEL: buildc:
21 ; CHECK: # %bb.0: # %entry
22 ; CHECK-NEXT: mtvsrwz v2, r3
23 ; CHECK-NEXT: vspltb v2, v2, 7
26 ; CHECK-LE-LABEL: buildc:
27 ; CHECK-LE: # %bb.0: # %entry
28 ; CHECK-LE-NEXT: mtvsrd v2, r3
29 ; CHECK-LE-NEXT: vspltb v2, v2, 7
32 ; CHECK-AIX-LABEL: buildc:
33 ; CHECK-AIX: # %bb.0: # %entry
34 ; CHECK-AIX-NEXT: mtvsrwz 34, 3
35 ; CHECK-AIX-NEXT: vspltb 2, 2, 7
38 %splat.splatinsert = insertelement <16 x i8> undef, i8 %a, i32 0
39 %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer
40 ret <16 x i8> %splat.splat
45 ; Function Attrs: norecurse nounwind readnone
46 define <8 x i16> @builds(i16 zeroext %a) {
47 ; CHECK-LABEL: builds:
48 ; CHECK: # %bb.0: # %entry
49 ; CHECK-NEXT: mtvsrwz v2, r3
50 ; CHECK-NEXT: vsplth v2, v2, 3
53 ; CHECK-LE-LABEL: builds:
54 ; CHECK-LE: # %bb.0: # %entry
55 ; CHECK-LE-NEXT: mtvsrd v2, r3
56 ; CHECK-LE-NEXT: vsplth v2, v2, 3
59 ; CHECK-AIX-LABEL: builds:
60 ; CHECK-AIX: # %bb.0: # %entry
61 ; CHECK-AIX-NEXT: mtvsrwz 34, 3
62 ; CHECK-AIX-NEXT: vsplth 2, 2, 3
65 %splat.splatinsert = insertelement <8 x i16> undef, i16 %a, i32 0
66 %splat.splat = shufflevector <8 x i16> %splat.splatinsert, <8 x i16> undef, <8 x i32> zeroinitializer
67 ret <8 x i16> %splat.splat
72 ; Function Attrs: norecurse nounwind readnone
73 define <4 x i32> @buildi(i32 zeroext %a) {
74 ; CHECK-LABEL: buildi:
75 ; CHECK: # %bb.0: # %entry
76 ; CHECK-NEXT: mtfprwz f0, r3
77 ; CHECK-NEXT: xxspltw v2, vs0, 1
80 ; CHECK-LE-LABEL: buildi:
81 ; CHECK-LE: # %bb.0: # %entry
82 ; CHECK-LE-NEXT: mtfprwz f0, r3
83 ; CHECK-LE-NEXT: xxspltw v2, vs0, 1
86 ; CHECK-AIX-LABEL: buildi:
87 ; CHECK-AIX: # %bb.0: # %entry
88 ; CHECK-AIX-NEXT: mtfprwz 0, 3
89 ; CHECK-AIX-NEXT: xxspltw 34, 0, 1
92 %splat.splatinsert = insertelement <4 x i32> undef, i32 %a, i32 0
93 %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
94 ret <4 x i32> %splat.splat
99 ; Function Attrs: norecurse nounwind readnone
100 define <2 x i64> @buildl(i64 %a) {
101 ; CHECK-LABEL: buildl:
102 ; CHECK: # %bb.0: # %entry
103 ; CHECK-NEXT: mtfprd f0, r3
104 ; CHECK-NEXT: xxspltd v2, vs0, 0
107 ; CHECK-LE-LABEL: buildl:
108 ; CHECK-LE: # %bb.0: # %entry
109 ; CHECK-LE-NEXT: mtfprd f0, r3
110 ; CHECK-LE-NEXT: xxspltd v2, vs0, 0
113 ; CHECK-AIX-LABEL: buildl:
114 ; CHECK-AIX: # %bb.0: # %entry
115 ; CHECK-AIX-NEXT: mtfprd 0, 3
116 ; CHECK-AIX-NEXT: xxmrghd 34, 0, 0
117 ; CHECK-AIX-NEXT: blr
119 %splat.splatinsert = insertelement <2 x i64> undef, i64 %a, i32 0
120 %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer
121 ret <2 x i64> %splat.splat
126 ; Function Attrs: norecurse nounwind readnone
127 define <4 x float> @buildf(float %a) {
128 ; CHECK-LABEL: buildf:
129 ; CHECK: # %bb.0: # %entry
130 ; CHECK-NEXT: xscvdpspn vs0, f1
131 ; CHECK-NEXT: xxspltw v2, vs0, 0
134 ; CHECK-LE-LABEL: buildf:
135 ; CHECK-LE: # %bb.0: # %entry
136 ; CHECK-LE-NEXT: xscvdpspn vs0, f1
137 ; CHECK-LE-NEXT: xxspltw v2, vs0, 0
140 ; CHECK-AIX-LABEL: buildf:
141 ; CHECK-AIX: # %bb.0: # %entry
142 ; CHECK-AIX-NEXT: xscvdpspn 0, 1
143 ; CHECK-AIX-NEXT: xxspltw 34, 0, 0
144 ; CHECK-AIX-NEXT: blr
146 %splat.splatinsert = insertelement <4 x float> undef, float %a, i32 0
147 %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
148 ret <4 x float> %splat.splat
153 ; The optimization to remove stack operations from PPCDAGToDAGISel::Select
154 ; should still trigger for v2f64, producing an lxvdsx.
155 ; Function Attrs: norecurse nounwind readonly
156 define <2 x double> @buildd() {
157 ; CHECK-LABEL: buildd:
158 ; CHECK: # %bb.0: # %entry
159 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
160 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
161 ; CHECK-NEXT: lxvdsx v2, 0, r3
164 ; CHECK-LE-LABEL: buildd:
165 ; CHECK-LE: # %bb.0: # %entry
166 ; CHECK-LE-NEXT: addis r3, r2, .LC0@toc@ha
167 ; CHECK-LE-NEXT: ld r3, .LC0@toc@l(r3)
168 ; CHECK-LE-NEXT: lxvdsx v2, 0, r3
171 ; CHECK-AIX-LABEL: buildd:
172 ; CHECK-AIX: # %bb.0: # %entry
173 ; CHECK-AIX-NEXT: ld 3, L..C0(2)
174 ; CHECK-AIX-NEXT: lxvdsx 34, 0, 3
175 ; CHECK-AIX-NEXT: blr
177 %0 = load double, double* @d, align 8
178 %splat.splatinsert = insertelement <2 x double> undef, double %0, i32 0
179 %splat.splat = shufflevector <2 x double> %splat.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer
180 ret <2 x double> %splat.splat
185 ; Function Attrs: norecurse nounwind readnone
186 define signext i8 @getsc0(<16 x i8> %vsc) {
187 ; CHECK-LABEL: getsc0:
188 ; CHECK: # %bb.0: # %entry
189 ; CHECK-NEXT: mfvsrd r3, v2
190 ; CHECK-NEXT: rldicl r3, r3, 8, 56
191 ; CHECK-NEXT: extsb r3, r3
194 ; CHECK-LE-LABEL: getsc0:
195 ; CHECK-LE: # %bb.0: # %entry
196 ; CHECK-LE-NEXT: xxswapd vs0, v2
197 ; CHECK-LE-NEXT: mffprd r3, f0
198 ; CHECK-LE-NEXT: clrldi r3, r3, 56
199 ; CHECK-LE-NEXT: extsb r3, r3
202 ; CHECK-AIX-LABEL: getsc0:
203 ; CHECK-AIX: # %bb.0: # %entry
204 ; CHECK-AIX-NEXT: mfvsrd 3, 34
205 ; CHECK-AIX-NEXT: rldicl 3, 3, 8, 56
206 ; CHECK-AIX-NEXT: extsb 3, 3
207 ; CHECK-AIX-NEXT: blr
209 %vecext = extractelement <16 x i8> %vsc, i32 0
215 ; Function Attrs: norecurse nounwind readnone
216 define signext i8 @getsc1(<16 x i8> %vsc) {
217 ; CHECK-LABEL: getsc1:
218 ; CHECK: # %bb.0: # %entry
219 ; CHECK-NEXT: mfvsrd r3, v2
220 ; CHECK-NEXT: rldicl r3, r3, 16, 56
221 ; CHECK-NEXT: extsb r3, r3
224 ; CHECK-LE-LABEL: getsc1:
225 ; CHECK-LE: # %bb.0: # %entry
226 ; CHECK-LE-NEXT: xxswapd vs0, v2
227 ; CHECK-LE-NEXT: mffprd r3, f0
228 ; CHECK-LE-NEXT: rldicl r3, r3, 56, 56
229 ; CHECK-LE-NEXT: extsb r3, r3
232 ; CHECK-AIX-LABEL: getsc1:
233 ; CHECK-AIX: # %bb.0: # %entry
234 ; CHECK-AIX-NEXT: mfvsrd 3, 34
235 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 56
236 ; CHECK-AIX-NEXT: extsb 3, 3
237 ; CHECK-AIX-NEXT: blr
239 %vecext = extractelement <16 x i8> %vsc, i32 1
245 ; Function Attrs: norecurse nounwind readnone
246 define signext i8 @getsc2(<16 x i8> %vsc) {
247 ; CHECK-LABEL: getsc2:
248 ; CHECK: # %bb.0: # %entry
249 ; CHECK-NEXT: mfvsrd r3, v2
250 ; CHECK-NEXT: rldicl r3, r3, 24, 56
251 ; CHECK-NEXT: extsb r3, r3
254 ; CHECK-LE-LABEL: getsc2:
255 ; CHECK-LE: # %bb.0: # %entry
256 ; CHECK-LE-NEXT: xxswapd vs0, v2
257 ; CHECK-LE-NEXT: mffprd r3, f0
258 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 56
259 ; CHECK-LE-NEXT: extsb r3, r3
262 ; CHECK-AIX-LABEL: getsc2:
263 ; CHECK-AIX: # %bb.0: # %entry
264 ; CHECK-AIX-NEXT: mfvsrd 3, 34
265 ; CHECK-AIX-NEXT: rldicl 3, 3, 24, 56
266 ; CHECK-AIX-NEXT: extsb 3, 3
267 ; CHECK-AIX-NEXT: blr
269 %vecext = extractelement <16 x i8> %vsc, i32 2
275 ; Function Attrs: norecurse nounwind readnone
276 define signext i8 @getsc3(<16 x i8> %vsc) {
277 ; CHECK-LABEL: getsc3:
278 ; CHECK: # %bb.0: # %entry
279 ; CHECK-NEXT: mfvsrd r3, v2
280 ; CHECK-NEXT: rldicl r3, r3, 32, 56
281 ; CHECK-NEXT: extsb r3, r3
284 ; CHECK-LE-LABEL: getsc3:
285 ; CHECK-LE: # %bb.0: # %entry
286 ; CHECK-LE-NEXT: xxswapd vs0, v2
287 ; CHECK-LE-NEXT: mffprd r3, f0
288 ; CHECK-LE-NEXT: rldicl r3, r3, 40, 56
289 ; CHECK-LE-NEXT: extsb r3, r3
292 ; CHECK-AIX-LABEL: getsc3:
293 ; CHECK-AIX: # %bb.0: # %entry
294 ; CHECK-AIX-NEXT: mfvsrd 3, 34
295 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 56
296 ; CHECK-AIX-NEXT: extsb 3, 3
297 ; CHECK-AIX-NEXT: blr
299 %vecext = extractelement <16 x i8> %vsc, i32 3
305 ; Function Attrs: norecurse nounwind readnone
306 define signext i8 @getsc4(<16 x i8> %vsc) {
307 ; CHECK-LABEL: getsc4:
308 ; CHECK: # %bb.0: # %entry
309 ; CHECK-NEXT: mfvsrd r3, v2
310 ; CHECK-NEXT: rldicl r3, r3, 40, 56
311 ; CHECK-NEXT: extsb r3, r3
314 ; CHECK-LE-LABEL: getsc4:
315 ; CHECK-LE: # %bb.0: # %entry
316 ; CHECK-LE-NEXT: xxswapd vs0, v2
317 ; CHECK-LE-NEXT: mffprd r3, f0
318 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 56
319 ; CHECK-LE-NEXT: extsb r3, r3
322 ; CHECK-AIX-LABEL: getsc4:
323 ; CHECK-AIX: # %bb.0: # %entry
324 ; CHECK-AIX-NEXT: mfvsrd 3, 34
325 ; CHECK-AIX-NEXT: rldicl 3, 3, 40, 56
326 ; CHECK-AIX-NEXT: extsb 3, 3
327 ; CHECK-AIX-NEXT: blr
329 %vecext = extractelement <16 x i8> %vsc, i32 4
335 ; Function Attrs: norecurse nounwind readnone
336 define signext i8 @getsc5(<16 x i8> %vsc) {
337 ; CHECK-LABEL: getsc5:
338 ; CHECK: # %bb.0: # %entry
339 ; CHECK-NEXT: mfvsrd r3, v2
340 ; CHECK-NEXT: rldicl r3, r3, 48, 56
341 ; CHECK-NEXT: extsb r3, r3
344 ; CHECK-LE-LABEL: getsc5:
345 ; CHECK-LE: # %bb.0: # %entry
346 ; CHECK-LE-NEXT: xxswapd vs0, v2
347 ; CHECK-LE-NEXT: mffprd r3, f0
348 ; CHECK-LE-NEXT: rldicl r3, r3, 24, 56
349 ; CHECK-LE-NEXT: extsb r3, r3
352 ; CHECK-AIX-LABEL: getsc5:
353 ; CHECK-AIX: # %bb.0: # %entry
354 ; CHECK-AIX-NEXT: mfvsrd 3, 34
355 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 56
356 ; CHECK-AIX-NEXT: extsb 3, 3
357 ; CHECK-AIX-NEXT: blr
359 %vecext = extractelement <16 x i8> %vsc, i32 5
365 ; Function Attrs: norecurse nounwind readnone
366 define signext i8 @getsc6(<16 x i8> %vsc) {
367 ; CHECK-LABEL: getsc6:
368 ; CHECK: # %bb.0: # %entry
369 ; CHECK-NEXT: mfvsrd r3, v2
370 ; CHECK-NEXT: rldicl r3, r3, 56, 56
371 ; CHECK-NEXT: extsb r3, r3
374 ; CHECK-LE-LABEL: getsc6:
375 ; CHECK-LE: # %bb.0: # %entry
376 ; CHECK-LE-NEXT: xxswapd vs0, v2
377 ; CHECK-LE-NEXT: mffprd r3, f0
378 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 56
379 ; CHECK-LE-NEXT: extsb r3, r3
382 ; CHECK-AIX-LABEL: getsc6:
383 ; CHECK-AIX: # %bb.0: # %entry
384 ; CHECK-AIX-NEXT: mfvsrd 3, 34
385 ; CHECK-AIX-NEXT: rldicl 3, 3, 56, 56
386 ; CHECK-AIX-NEXT: extsb 3, 3
387 ; CHECK-AIX-NEXT: blr
389 %vecext = extractelement <16 x i8> %vsc, i32 6
395 ; Function Attrs: norecurse nounwind readnone
396 define signext i8 @getsc7(<16 x i8> %vsc) {
397 ; CHECK-LABEL: getsc7:
398 ; CHECK: # %bb.0: # %entry
399 ; CHECK-NEXT: mfvsrd r3, v2
400 ; CHECK-NEXT: clrldi r3, r3, 56
401 ; CHECK-NEXT: extsb r3, r3
404 ; CHECK-LE-LABEL: getsc7:
405 ; CHECK-LE: # %bb.0: # %entry
406 ; CHECK-LE-NEXT: xxswapd vs0, v2
407 ; CHECK-LE-NEXT: mffprd r3, f0
408 ; CHECK-LE-NEXT: rldicl r3, r3, 8, 56
409 ; CHECK-LE-NEXT: extsb r3, r3
412 ; CHECK-AIX-LABEL: getsc7:
413 ; CHECK-AIX: # %bb.0: # %entry
414 ; CHECK-AIX-NEXT: mfvsrd 3, 34
415 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
416 ; CHECK-AIX-NEXT: extsb 3, 3
417 ; CHECK-AIX-NEXT: blr
419 %vecext = extractelement <16 x i8> %vsc, i32 7
425 ; Function Attrs: norecurse nounwind readnone
426 define signext i8 @getsc8(<16 x i8> %vsc) {
427 ; CHECK-LABEL: getsc8:
428 ; CHECK: # %bb.0: # %entry
429 ; CHECK-NEXT: xxswapd vs0, v2
430 ; CHECK-NEXT: mffprd r3, f0
431 ; CHECK-NEXT: rldicl r3, r3, 8, 56
432 ; CHECK-NEXT: extsb r3, r3
435 ; CHECK-LE-LABEL: getsc8:
436 ; CHECK-LE: # %bb.0: # %entry
437 ; CHECK-LE-NEXT: mfvsrd r3, v2
438 ; CHECK-LE-NEXT: clrldi r3, r3, 56
439 ; CHECK-LE-NEXT: extsb r3, r3
442 ; CHECK-AIX-LABEL: getsc8:
443 ; CHECK-AIX: # %bb.0: # %entry
444 ; CHECK-AIX-NEXT: xxswapd 0, 34
445 ; CHECK-AIX-NEXT: mffprd 3, 0
446 ; CHECK-AIX-NEXT: rldicl 3, 3, 8, 56
447 ; CHECK-AIX-NEXT: extsb 3, 3
448 ; CHECK-AIX-NEXT: blr
450 %vecext = extractelement <16 x i8> %vsc, i32 8
456 ; Function Attrs: norecurse nounwind readnone
457 define signext i8 @getsc9(<16 x i8> %vsc) {
458 ; CHECK-LABEL: getsc9:
459 ; CHECK: # %bb.0: # %entry
460 ; CHECK-NEXT: xxswapd vs0, v2
461 ; CHECK-NEXT: mffprd r3, f0
462 ; CHECK-NEXT: rldicl r3, r3, 16, 56
463 ; CHECK-NEXT: extsb r3, r3
466 ; CHECK-LE-LABEL: getsc9:
467 ; CHECK-LE: # %bb.0: # %entry
468 ; CHECK-LE-NEXT: mfvsrd r3, v2
469 ; CHECK-LE-NEXT: rldicl r3, r3, 56, 56
470 ; CHECK-LE-NEXT: extsb r3, r3
473 ; CHECK-AIX-LABEL: getsc9:
474 ; CHECK-AIX: # %bb.0: # %entry
475 ; CHECK-AIX-NEXT: xxswapd 0, 34
476 ; CHECK-AIX-NEXT: mffprd 3, 0
477 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 56
478 ; CHECK-AIX-NEXT: extsb 3, 3
479 ; CHECK-AIX-NEXT: blr
481 %vecext = extractelement <16 x i8> %vsc, i32 9
487 ; Function Attrs: norecurse nounwind readnone
488 define signext i8 @getsc10(<16 x i8> %vsc) {
489 ; CHECK-LABEL: getsc10:
490 ; CHECK: # %bb.0: # %entry
491 ; CHECK-NEXT: xxswapd vs0, v2
492 ; CHECK-NEXT: mffprd r3, f0
493 ; CHECK-NEXT: rldicl r3, r3, 24, 56
494 ; CHECK-NEXT: extsb r3, r3
497 ; CHECK-LE-LABEL: getsc10:
498 ; CHECK-LE: # %bb.0: # %entry
499 ; CHECK-LE-NEXT: mfvsrd r3, v2
500 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 56
501 ; CHECK-LE-NEXT: extsb r3, r3
504 ; CHECK-AIX-LABEL: getsc10:
505 ; CHECK-AIX: # %bb.0: # %entry
506 ; CHECK-AIX-NEXT: xxswapd 0, 34
507 ; CHECK-AIX-NEXT: mffprd 3, 0
508 ; CHECK-AIX-NEXT: rldicl 3, 3, 24, 56
509 ; CHECK-AIX-NEXT: extsb 3, 3
510 ; CHECK-AIX-NEXT: blr
512 %vecext = extractelement <16 x i8> %vsc, i32 10
518 ; Function Attrs: norecurse nounwind readnone
519 define signext i8 @getsc11(<16 x i8> %vsc) {
520 ; CHECK-LABEL: getsc11:
521 ; CHECK: # %bb.0: # %entry
522 ; CHECK-NEXT: xxswapd vs0, v2
523 ; CHECK-NEXT: mffprd r3, f0
524 ; CHECK-NEXT: rldicl r3, r3, 32, 56
525 ; CHECK-NEXT: extsb r3, r3
528 ; CHECK-LE-LABEL: getsc11:
529 ; CHECK-LE: # %bb.0: # %entry
530 ; CHECK-LE-NEXT: mfvsrd r3, v2
531 ; CHECK-LE-NEXT: rldicl r3, r3, 40, 56
532 ; CHECK-LE-NEXT: extsb r3, r3
535 ; CHECK-AIX-LABEL: getsc11:
536 ; CHECK-AIX: # %bb.0: # %entry
537 ; CHECK-AIX-NEXT: xxswapd 0, 34
538 ; CHECK-AIX-NEXT: mffprd 3, 0
539 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 56
540 ; CHECK-AIX-NEXT: extsb 3, 3
541 ; CHECK-AIX-NEXT: blr
543 %vecext = extractelement <16 x i8> %vsc, i32 11
549 ; Function Attrs: norecurse nounwind readnone
550 define signext i8 @getsc12(<16 x i8> %vsc) {
551 ; CHECK-LABEL: getsc12:
552 ; CHECK: # %bb.0: # %entry
553 ; CHECK-NEXT: xxswapd vs0, v2
554 ; CHECK-NEXT: mffprd r3, f0
555 ; CHECK-NEXT: rldicl r3, r3, 40, 56
556 ; CHECK-NEXT: extsb r3, r3
559 ; CHECK-LE-LABEL: getsc12:
560 ; CHECK-LE: # %bb.0: # %entry
561 ; CHECK-LE-NEXT: mfvsrd r3, v2
562 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 56
563 ; CHECK-LE-NEXT: extsb r3, r3
566 ; CHECK-AIX-LABEL: getsc12:
567 ; CHECK-AIX: # %bb.0: # %entry
568 ; CHECK-AIX-NEXT: xxswapd 0, 34
569 ; CHECK-AIX-NEXT: mffprd 3, 0
570 ; CHECK-AIX-NEXT: rldicl 3, 3, 40, 56
571 ; CHECK-AIX-NEXT: extsb 3, 3
572 ; CHECK-AIX-NEXT: blr
574 %vecext = extractelement <16 x i8> %vsc, i32 12
580 ; Function Attrs: norecurse nounwind readnone
581 define signext i8 @getsc13(<16 x i8> %vsc) {
582 ; CHECK-LABEL: getsc13:
583 ; CHECK: # %bb.0: # %entry
584 ; CHECK-NEXT: xxswapd vs0, v2
585 ; CHECK-NEXT: mffprd r3, f0
586 ; CHECK-NEXT: rldicl r3, r3, 48, 56
587 ; CHECK-NEXT: extsb r3, r3
590 ; CHECK-LE-LABEL: getsc13:
591 ; CHECK-LE: # %bb.0: # %entry
592 ; CHECK-LE-NEXT: mfvsrd r3, v2
593 ; CHECK-LE-NEXT: rldicl r3, r3, 24, 56
594 ; CHECK-LE-NEXT: extsb r3, r3
597 ; CHECK-AIX-LABEL: getsc13:
598 ; CHECK-AIX: # %bb.0: # %entry
599 ; CHECK-AIX-NEXT: xxswapd 0, 34
600 ; CHECK-AIX-NEXT: mffprd 3, 0
601 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 56
602 ; CHECK-AIX-NEXT: extsb 3, 3
603 ; CHECK-AIX-NEXT: blr
605 %vecext = extractelement <16 x i8> %vsc, i32 13
611 ; Function Attrs: norecurse nounwind readnone
612 define signext i8 @getsc14(<16 x i8> %vsc) {
613 ; CHECK-LABEL: getsc14:
614 ; CHECK: # %bb.0: # %entry
615 ; CHECK-NEXT: xxswapd vs0, v2
616 ; CHECK-NEXT: mffprd r3, f0
617 ; CHECK-NEXT: rldicl r3, r3, 56, 56
618 ; CHECK-NEXT: extsb r3, r3
621 ; CHECK-LE-LABEL: getsc14:
622 ; CHECK-LE: # %bb.0: # %entry
623 ; CHECK-LE-NEXT: mfvsrd r3, v2
624 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 56
625 ; CHECK-LE-NEXT: extsb r3, r3
628 ; CHECK-AIX-LABEL: getsc14:
629 ; CHECK-AIX: # %bb.0: # %entry
630 ; CHECK-AIX-NEXT: xxswapd 0, 34
631 ; CHECK-AIX-NEXT: mffprd 3, 0
632 ; CHECK-AIX-NEXT: rldicl 3, 3, 56, 56
633 ; CHECK-AIX-NEXT: extsb 3, 3
634 ; CHECK-AIX-NEXT: blr
636 %vecext = extractelement <16 x i8> %vsc, i32 14
642 ; Function Attrs: norecurse nounwind readnone
643 define signext i8 @getsc15(<16 x i8> %vsc) {
644 ; CHECK-LABEL: getsc15:
645 ; CHECK: # %bb.0: # %entry
646 ; CHECK-NEXT: xxswapd vs0, v2
647 ; CHECK-NEXT: mffprd r3, f0
648 ; CHECK-NEXT: clrldi r3, r3, 56
649 ; CHECK-NEXT: extsb r3, r3
652 ; CHECK-LE-LABEL: getsc15:
653 ; CHECK-LE: # %bb.0: # %entry
654 ; CHECK-LE-NEXT: mfvsrd r3, v2
655 ; CHECK-LE-NEXT: rldicl r3, r3, 8, 56
656 ; CHECK-LE-NEXT: extsb r3, r3
659 ; CHECK-AIX-LABEL: getsc15:
660 ; CHECK-AIX: # %bb.0: # %entry
661 ; CHECK-AIX-NEXT: xxswapd 0, 34
662 ; CHECK-AIX-NEXT: mffprd 3, 0
663 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
664 ; CHECK-AIX-NEXT: extsb 3, 3
665 ; CHECK-AIX-NEXT: blr
667 %vecext = extractelement <16 x i8> %vsc, i32 15
673 ; Function Attrs: norecurse nounwind readnone
674 define zeroext i8 @getuc0(<16 x i8> %vuc) {
675 ; CHECK-LABEL: getuc0:
676 ; CHECK: # %bb.0: # %entry
677 ; CHECK-NEXT: mfvsrd r3, v2
678 ; CHECK-NEXT: rldicl r3, r3, 8, 56
679 ; CHECK-NEXT: clrldi r3, r3, 56
682 ; CHECK-LE-LABEL: getuc0:
683 ; CHECK-LE: # %bb.0: # %entry
684 ; CHECK-LE-NEXT: xxswapd vs0, v2
685 ; CHECK-LE-NEXT: mffprd r3, f0
686 ; CHECK-LE-NEXT: clrldi r3, r3, 56
687 ; CHECK-LE-NEXT: clrldi r3, r3, 56
690 ; CHECK-AIX-LABEL: getuc0:
691 ; CHECK-AIX: # %bb.0: # %entry
692 ; CHECK-AIX-NEXT: mfvsrd 3, 34
693 ; CHECK-AIX-NEXT: rldicl 3, 3, 8, 56
694 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
695 ; CHECK-AIX-NEXT: blr
697 %vecext = extractelement <16 x i8> %vuc, i32 0
703 ; Function Attrs: norecurse nounwind readnone
704 define zeroext i8 @getuc1(<16 x i8> %vuc) {
705 ; CHECK-LABEL: getuc1:
706 ; CHECK: # %bb.0: # %entry
707 ; CHECK-NEXT: mfvsrd r3, v2
708 ; CHECK-NEXT: rldicl r3, r3, 16, 56
709 ; CHECK-NEXT: clrldi r3, r3, 56
712 ; CHECK-LE-LABEL: getuc1:
713 ; CHECK-LE: # %bb.0: # %entry
714 ; CHECK-LE-NEXT: xxswapd vs0, v2
715 ; CHECK-LE-NEXT: mffprd r3, f0
716 ; CHECK-LE-NEXT: rldicl r3, r3, 56, 56
717 ; CHECK-LE-NEXT: clrldi r3, r3, 56
720 ; CHECK-AIX-LABEL: getuc1:
721 ; CHECK-AIX: # %bb.0: # %entry
722 ; CHECK-AIX-NEXT: mfvsrd 3, 34
723 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 56
724 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
725 ; CHECK-AIX-NEXT: blr
727 %vecext = extractelement <16 x i8> %vuc, i32 1
733 ; Function Attrs: norecurse nounwind readnone
734 define zeroext i8 @getuc2(<16 x i8> %vuc) {
735 ; CHECK-LABEL: getuc2:
736 ; CHECK: # %bb.0: # %entry
737 ; CHECK-NEXT: mfvsrd r3, v2
738 ; CHECK-NEXT: rldicl r3, r3, 24, 56
739 ; CHECK-NEXT: clrldi r3, r3, 56
742 ; CHECK-LE-LABEL: getuc2:
743 ; CHECK-LE: # %bb.0: # %entry
744 ; CHECK-LE-NEXT: xxswapd vs0, v2
745 ; CHECK-LE-NEXT: mffprd r3, f0
746 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 56
747 ; CHECK-LE-NEXT: clrldi r3, r3, 56
750 ; CHECK-AIX-LABEL: getuc2:
751 ; CHECK-AIX: # %bb.0: # %entry
752 ; CHECK-AIX-NEXT: mfvsrd 3, 34
753 ; CHECK-AIX-NEXT: rldicl 3, 3, 24, 56
754 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
755 ; CHECK-AIX-NEXT: blr
757 %vecext = extractelement <16 x i8> %vuc, i32 2
761 ; CHECK-AIX mfvsrd 3, 34
762 ; CHECK-AIX rldicl 3, 3, 24, 56
763 ; CHECK-AIX clrldi 3, 3, 56
766 ; Function Attrs: norecurse nounwind readnone
767 define zeroext i8 @getuc3(<16 x i8> %vuc) {
768 ; CHECK-LABEL: getuc3:
769 ; CHECK: # %bb.0: # %entry
770 ; CHECK-NEXT: mfvsrd r3, v2
771 ; CHECK-NEXT: rldicl r3, r3, 32, 56
772 ; CHECK-NEXT: clrldi r3, r3, 56
775 ; CHECK-LE-LABEL: getuc3:
776 ; CHECK-LE: # %bb.0: # %entry
777 ; CHECK-LE-NEXT: xxswapd vs0, v2
778 ; CHECK-LE-NEXT: mffprd r3, f0
779 ; CHECK-LE-NEXT: rldicl r3, r3, 40, 56
780 ; CHECK-LE-NEXT: clrldi r3, r3, 56
783 ; CHECK-AIX-LABEL: getuc3:
784 ; CHECK-AIX: # %bb.0: # %entry
785 ; CHECK-AIX-NEXT: mfvsrd 3, 34
786 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 56
787 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
788 ; CHECK-AIX-NEXT: blr
790 %vecext = extractelement <16 x i8> %vuc, i32 3
796 ; Function Attrs: norecurse nounwind readnone
797 define zeroext i8 @getuc4(<16 x i8> %vuc) {
798 ; CHECK-LABEL: getuc4:
799 ; CHECK: # %bb.0: # %entry
800 ; CHECK-NEXT: mfvsrd r3, v2
801 ; CHECK-NEXT: rldicl r3, r3, 40, 56
802 ; CHECK-NEXT: clrldi r3, r3, 56
805 ; CHECK-LE-LABEL: getuc4:
806 ; CHECK-LE: # %bb.0: # %entry
807 ; CHECK-LE-NEXT: xxswapd vs0, v2
808 ; CHECK-LE-NEXT: mffprd r3, f0
809 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 56
810 ; CHECK-LE-NEXT: clrldi r3, r3, 56
813 ; CHECK-AIX-LABEL: getuc4:
814 ; CHECK-AIX: # %bb.0: # %entry
815 ; CHECK-AIX-NEXT: mfvsrd 3, 34
816 ; CHECK-AIX-NEXT: rldicl 3, 3, 40, 56
817 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
818 ; CHECK-AIX-NEXT: blr
820 %vecext = extractelement <16 x i8> %vuc, i32 4
826 ; Function Attrs: norecurse nounwind readnone
827 define zeroext i8 @getuc5(<16 x i8> %vuc) {
828 ; CHECK-LABEL: getuc5:
829 ; CHECK: # %bb.0: # %entry
830 ; CHECK-NEXT: mfvsrd r3, v2
831 ; CHECK-NEXT: rldicl r3, r3, 48, 56
832 ; CHECK-NEXT: clrldi r3, r3, 56
835 ; CHECK-LE-LABEL: getuc5:
836 ; CHECK-LE: # %bb.0: # %entry
837 ; CHECK-LE-NEXT: xxswapd vs0, v2
838 ; CHECK-LE-NEXT: mffprd r3, f0
839 ; CHECK-LE-NEXT: rldicl r3, r3, 24, 56
840 ; CHECK-LE-NEXT: clrldi r3, r3, 56
843 ; CHECK-AIX-LABEL: getuc5:
844 ; CHECK-AIX: # %bb.0: # %entry
845 ; CHECK-AIX-NEXT: mfvsrd 3, 34
846 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 56
847 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
848 ; CHECK-AIX-NEXT: blr
850 %vecext = extractelement <16 x i8> %vuc, i32 5
856 ; Function Attrs: norecurse nounwind readnone
857 define zeroext i8 @getuc6(<16 x i8> %vuc) {
858 ; CHECK-LABEL: getuc6:
859 ; CHECK: # %bb.0: # %entry
860 ; CHECK-NEXT: mfvsrd r3, v2
861 ; CHECK-NEXT: rldicl r3, r3, 56, 56
862 ; CHECK-NEXT: clrldi r3, r3, 56
865 ; CHECK-LE-LABEL: getuc6:
866 ; CHECK-LE: # %bb.0: # %entry
867 ; CHECK-LE-NEXT: xxswapd vs0, v2
868 ; CHECK-LE-NEXT: mffprd r3, f0
869 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 56
870 ; CHECK-LE-NEXT: clrldi r3, r3, 56
873 ; CHECK-AIX-LABEL: getuc6:
874 ; CHECK-AIX: # %bb.0: # %entry
875 ; CHECK-AIX-NEXT: mfvsrd 3, 34
876 ; CHECK-AIX-NEXT: rldicl 3, 3, 56, 56
877 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
878 ; CHECK-AIX-NEXT: blr
880 %vecext = extractelement <16 x i8> %vuc, i32 6
886 ; Function Attrs: norecurse nounwind readnone
887 define zeroext i8 @getuc7(<16 x i8> %vuc) {
888 ; CHECK-LABEL: getuc7:
889 ; CHECK: # %bb.0: # %entry
890 ; CHECK-NEXT: mfvsrd r3, v2
891 ; CHECK-NEXT: clrldi r3, r3, 56
892 ; CHECK-NEXT: clrldi r3, r3, 56
895 ; CHECK-LE-LABEL: getuc7:
896 ; CHECK-LE: # %bb.0: # %entry
897 ; CHECK-LE-NEXT: xxswapd vs0, v2
898 ; CHECK-LE-NEXT: mffprd r3, f0
899 ; CHECK-LE-NEXT: rldicl r3, r3, 8, 56
900 ; CHECK-LE-NEXT: clrldi r3, r3, 56
903 ; CHECK-AIX-LABEL: getuc7:
904 ; CHECK-AIX: # %bb.0: # %entry
905 ; CHECK-AIX-NEXT: mfvsrd 3, 34
906 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
907 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
908 ; CHECK-AIX-NEXT: blr
910 %vecext = extractelement <16 x i8> %vuc, i32 7
916 ; Function Attrs: norecurse nounwind readnone
917 define zeroext i8 @getuc8(<16 x i8> %vuc) {
918 ; CHECK-LABEL: getuc8:
919 ; CHECK: # %bb.0: # %entry
920 ; CHECK-NEXT: xxswapd vs0, v2
921 ; CHECK-NEXT: mffprd r3, f0
922 ; CHECK-NEXT: rldicl r3, r3, 8, 56
923 ; CHECK-NEXT: clrldi r3, r3, 56
926 ; CHECK-LE-LABEL: getuc8:
927 ; CHECK-LE: # %bb.0: # %entry
928 ; CHECK-LE-NEXT: mfvsrd r3, v2
929 ; CHECK-LE-NEXT: clrldi r3, r3, 56
930 ; CHECK-LE-NEXT: clrldi r3, r3, 56
933 ; CHECK-AIX-LABEL: getuc8:
934 ; CHECK-AIX: # %bb.0: # %entry
935 ; CHECK-AIX-NEXT: xxswapd 0, 34
936 ; CHECK-AIX-NEXT: mffprd 3, 0
937 ; CHECK-AIX-NEXT: rldicl 3, 3, 8, 56
938 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
939 ; CHECK-AIX-NEXT: blr
941 %vecext = extractelement <16 x i8> %vuc, i32 8
947 ; Function Attrs: norecurse nounwind readnone
948 define zeroext i8 @getuc9(<16 x i8> %vuc) {
949 ; CHECK-LABEL: getuc9:
950 ; CHECK: # %bb.0: # %entry
951 ; CHECK-NEXT: xxswapd vs0, v2
952 ; CHECK-NEXT: mffprd r3, f0
953 ; CHECK-NEXT: rldicl r3, r3, 16, 56
954 ; CHECK-NEXT: clrldi r3, r3, 56
957 ; CHECK-LE-LABEL: getuc9:
958 ; CHECK-LE: # %bb.0: # %entry
959 ; CHECK-LE-NEXT: mfvsrd r3, v2
960 ; CHECK-LE-NEXT: rldicl r3, r3, 56, 56
961 ; CHECK-LE-NEXT: clrldi r3, r3, 56
964 ; CHECK-AIX-LABEL: getuc9:
965 ; CHECK-AIX: # %bb.0: # %entry
966 ; CHECK-AIX-NEXT: xxswapd 0, 34
967 ; CHECK-AIX-NEXT: mffprd 3, 0
968 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 56
969 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
970 ; CHECK-AIX-NEXT: blr
972 %vecext = extractelement <16 x i8> %vuc, i32 9
978 ; Function Attrs: norecurse nounwind readnone
979 define zeroext i8 @getuc10(<16 x i8> %vuc) {
980 ; CHECK-LABEL: getuc10:
981 ; CHECK: # %bb.0: # %entry
982 ; CHECK-NEXT: xxswapd vs0, v2
983 ; CHECK-NEXT: mffprd r3, f0
984 ; CHECK-NEXT: rldicl r3, r3, 24, 56
985 ; CHECK-NEXT: clrldi r3, r3, 56
988 ; CHECK-LE-LABEL: getuc10:
989 ; CHECK-LE: # %bb.0: # %entry
990 ; CHECK-LE-NEXT: mfvsrd r3, v2
991 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 56
992 ; CHECK-LE-NEXT: clrldi r3, r3, 56
995 ; CHECK-AIX-LABEL: getuc10:
996 ; CHECK-AIX: # %bb.0: # %entry
997 ; CHECK-AIX-NEXT: xxswapd 0, 34
998 ; CHECK-AIX-NEXT: mffprd 3, 0
999 ; CHECK-AIX-NEXT: rldicl 3, 3, 24, 56
1000 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1001 ; CHECK-AIX-NEXT: blr
1003 %vecext = extractelement <16 x i8> %vuc, i32 10
1009 ; Function Attrs: norecurse nounwind readnone
1010 define zeroext i8 @getuc11(<16 x i8> %vuc) {
1011 ; CHECK-LABEL: getuc11:
1012 ; CHECK: # %bb.0: # %entry
1013 ; CHECK-NEXT: xxswapd vs0, v2
1014 ; CHECK-NEXT: mffprd r3, f0
1015 ; CHECK-NEXT: rldicl r3, r3, 32, 56
1016 ; CHECK-NEXT: clrldi r3, r3, 56
1019 ; CHECK-LE-LABEL: getuc11:
1020 ; CHECK-LE: # %bb.0: # %entry
1021 ; CHECK-LE-NEXT: mfvsrd r3, v2
1022 ; CHECK-LE-NEXT: rldicl r3, r3, 40, 56
1023 ; CHECK-LE-NEXT: clrldi r3, r3, 56
1024 ; CHECK-LE-NEXT: blr
1026 ; CHECK-AIX-LABEL: getuc11:
1027 ; CHECK-AIX: # %bb.0: # %entry
1028 ; CHECK-AIX-NEXT: xxswapd 0, 34
1029 ; CHECK-AIX-NEXT: mffprd 3, 0
1030 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 56
1031 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1032 ; CHECK-AIX-NEXT: blr
1034 %vecext = extractelement <16 x i8> %vuc, i32 11
1040 ; Function Attrs: norecurse nounwind readnone
1041 define zeroext i8 @getuc12(<16 x i8> %vuc) {
1042 ; CHECK-LABEL: getuc12:
1043 ; CHECK: # %bb.0: # %entry
1044 ; CHECK-NEXT: xxswapd vs0, v2
1045 ; CHECK-NEXT: mffprd r3, f0
1046 ; CHECK-NEXT: rldicl r3, r3, 40, 56
1047 ; CHECK-NEXT: clrldi r3, r3, 56
1050 ; CHECK-LE-LABEL: getuc12:
1051 ; CHECK-LE: # %bb.0: # %entry
1052 ; CHECK-LE-NEXT: mfvsrd r3, v2
1053 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 56
1054 ; CHECK-LE-NEXT: clrldi r3, r3, 56
1055 ; CHECK-LE-NEXT: blr
1057 ; CHECK-AIX-LABEL: getuc12:
1058 ; CHECK-AIX: # %bb.0: # %entry
1059 ; CHECK-AIX-NEXT: xxswapd 0, 34
1060 ; CHECK-AIX-NEXT: mffprd 3, 0
1061 ; CHECK-AIX-NEXT: rldicl 3, 3, 40, 56
1062 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1063 ; CHECK-AIX-NEXT: blr
1065 %vecext = extractelement <16 x i8> %vuc, i32 12
1071 ; Function Attrs: norecurse nounwind readnone
1072 define zeroext i8 @getuc13(<16 x i8> %vuc) {
1073 ; CHECK-LABEL: getuc13:
1074 ; CHECK: # %bb.0: # %entry
1075 ; CHECK-NEXT: xxswapd vs0, v2
1076 ; CHECK-NEXT: mffprd r3, f0
1077 ; CHECK-NEXT: rldicl r3, r3, 48, 56
1078 ; CHECK-NEXT: clrldi r3, r3, 56
1081 ; CHECK-LE-LABEL: getuc13:
1082 ; CHECK-LE: # %bb.0: # %entry
1083 ; CHECK-LE-NEXT: mfvsrd r3, v2
1084 ; CHECK-LE-NEXT: rldicl r3, r3, 24, 56
1085 ; CHECK-LE-NEXT: clrldi r3, r3, 56
1086 ; CHECK-LE-NEXT: blr
1088 ; CHECK-AIX-LABEL: getuc13:
1089 ; CHECK-AIX: # %bb.0: # %entry
1090 ; CHECK-AIX-NEXT: xxswapd 0, 34
1091 ; CHECK-AIX-NEXT: mffprd 3, 0
1092 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 56
1093 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1094 ; CHECK-AIX-NEXT: blr
1096 %vecext = extractelement <16 x i8> %vuc, i32 13
1102 ; Function Attrs: norecurse nounwind readnone
1103 define zeroext i8 @getuc14(<16 x i8> %vuc) {
1104 ; CHECK-LABEL: getuc14:
1105 ; CHECK: # %bb.0: # %entry
1106 ; CHECK-NEXT: xxswapd vs0, v2
1107 ; CHECK-NEXT: mffprd r3, f0
1108 ; CHECK-NEXT: rldicl r3, r3, 56, 56
1109 ; CHECK-NEXT: clrldi r3, r3, 56
1112 ; CHECK-LE-LABEL: getuc14:
1113 ; CHECK-LE: # %bb.0: # %entry
1114 ; CHECK-LE-NEXT: mfvsrd r3, v2
1115 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 56
1116 ; CHECK-LE-NEXT: clrldi r3, r3, 56
1117 ; CHECK-LE-NEXT: blr
1119 ; CHECK-AIX-LABEL: getuc14:
1120 ; CHECK-AIX: # %bb.0: # %entry
1121 ; CHECK-AIX-NEXT: xxswapd 0, 34
1122 ; CHECK-AIX-NEXT: mffprd 3, 0
1123 ; CHECK-AIX-NEXT: rldicl 3, 3, 56, 56
1124 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1125 ; CHECK-AIX-NEXT: blr
1127 %vecext = extractelement <16 x i8> %vuc, i32 14
1133 ; Function Attrs: norecurse nounwind readnone
1134 define zeroext i8 @getuc15(<16 x i8> %vuc) {
1135 ; CHECK-LABEL: getuc15:
1136 ; CHECK: # %bb.0: # %entry
1137 ; CHECK-NEXT: xxswapd vs0, v2
1138 ; CHECK-NEXT: mffprd r3, f0
1139 ; CHECK-NEXT: clrldi r3, r3, 56
1140 ; CHECK-NEXT: clrldi r3, r3, 56
1143 ; CHECK-LE-LABEL: getuc15:
1144 ; CHECK-LE: # %bb.0: # %entry
1145 ; CHECK-LE-NEXT: mfvsrd r3, v2
1146 ; CHECK-LE-NEXT: rldicl r3, r3, 8, 56
1147 ; CHECK-LE-NEXT: clrldi r3, r3, 56
1148 ; CHECK-LE-NEXT: blr
1150 ; CHECK-AIX-LABEL: getuc15:
1151 ; CHECK-AIX: # %bb.0: # %entry
1152 ; CHECK-AIX-NEXT: xxswapd 0, 34
1153 ; CHECK-AIX-NEXT: mffprd 3, 0
1154 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1155 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1156 ; CHECK-AIX-NEXT: blr
1158 %vecext = extractelement <16 x i8> %vuc, i32 15
1164 ; Function Attrs: norecurse nounwind readnone
1165 define signext i8 @getvelsc(<16 x i8> %vsc, i32 signext %i) {
1166 ; CHECK-LABEL: getvelsc:
1167 ; CHECK: # %bb.0: # %entry
1168 ; CHECK-NEXT: andi. r4, r5, 8
1169 ; CHECK-NEXT: li r3, 7
1170 ; CHECK-NEXT: lvsl v3, 0, r4
1171 ; CHECK-NEXT: andc r3, r3, r5
1172 ; CHECK-NEXT: sldi r3, r3, 3
1173 ; CHECK-NEXT: vperm v2, v2, v2, v3
1174 ; CHECK-NEXT: mfvsrd r4, v2
1175 ; CHECK-NEXT: srd r3, r4, r3
1176 ; CHECK-NEXT: extsb r3, r3
1179 ; CHECK-LE-LABEL: getvelsc:
1180 ; CHECK-LE: # %bb.0: # %entry
1181 ; CHECK-LE-NEXT: li r3, 8
1182 ; CHECK-LE-NEXT: andc r3, r3, r5
1183 ; CHECK-LE-NEXT: lvsl v3, 0, r3
1184 ; CHECK-LE-NEXT: li r3, 7
1185 ; CHECK-LE-NEXT: and r3, r3, r5
1186 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1187 ; CHECK-LE-NEXT: sldi r3, r3, 3
1188 ; CHECK-LE-NEXT: mfvsrd r4, v2
1189 ; CHECK-LE-NEXT: srd r3, r4, r3
1190 ; CHECK-LE-NEXT: extsb r3, r3
1191 ; CHECK-LE-NEXT: blr
1193 ; CHECK-AIX-LABEL: getvelsc:
1194 ; CHECK-AIX: # %bb.0: # %entry
1195 ; CHECK-AIX-NEXT: andi. 5, 3, 8
1196 ; CHECK-AIX-NEXT: li 4, 7
1197 ; CHECK-AIX-NEXT: lvsl 3, 0, 5
1198 ; CHECK-AIX-NEXT: andc 3, 4, 3
1199 ; CHECK-AIX-NEXT: sldi 3, 3, 3
1200 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1201 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1202 ; CHECK-AIX-NEXT: srd 3, 4, 3
1203 ; CHECK-AIX-NEXT: extsb 3, 3
1204 ; CHECK-AIX-NEXT: blr
1208 %vecext = extractelement <16 x i8> %vsc, i32 %i
1212 ; Function Attrs: norecurse nounwind readnone
1213 define zeroext i8 @getveluc(<16 x i8> %vuc, i32 signext %i) {
1214 ; CHECK-LABEL: getveluc:
1215 ; CHECK: # %bb.0: # %entry
1216 ; CHECK-NEXT: andi. r4, r5, 8
1217 ; CHECK-NEXT: li r3, 7
1218 ; CHECK-NEXT: lvsl v3, 0, r4
1219 ; CHECK-NEXT: andc r3, r3, r5
1220 ; CHECK-NEXT: sldi r3, r3, 3
1221 ; CHECK-NEXT: vperm v2, v2, v2, v3
1222 ; CHECK-NEXT: mfvsrd r4, v2
1223 ; CHECK-NEXT: srd r3, r4, r3
1224 ; CHECK-NEXT: clrldi r3, r3, 56
1227 ; CHECK-LE-LABEL: getveluc:
1228 ; CHECK-LE: # %bb.0: # %entry
1229 ; CHECK-LE-NEXT: li r3, 8
1230 ; CHECK-LE-NEXT: andc r3, r3, r5
1231 ; CHECK-LE-NEXT: lvsl v3, 0, r3
1232 ; CHECK-LE-NEXT: li r3, 7
1233 ; CHECK-LE-NEXT: and r3, r3, r5
1234 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1235 ; CHECK-LE-NEXT: sldi r3, r3, 3
1236 ; CHECK-LE-NEXT: mfvsrd r4, v2
1237 ; CHECK-LE-NEXT: srd r3, r4, r3
1238 ; CHECK-LE-NEXT: clrldi r3, r3, 56
1239 ; CHECK-LE-NEXT: blr
1241 ; CHECK-AIX-LABEL: getveluc:
1242 ; CHECK-AIX: # %bb.0: # %entry
1243 ; CHECK-AIX-NEXT: andi. 5, 3, 8
1244 ; CHECK-AIX-NEXT: li 4, 7
1245 ; CHECK-AIX-NEXT: lvsl 3, 0, 5
1246 ; CHECK-AIX-NEXT: andc 3, 4, 3
1247 ; CHECK-AIX-NEXT: sldi 3, 3, 3
1248 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1249 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1250 ; CHECK-AIX-NEXT: srd 3, 4, 3
1251 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1252 ; CHECK-AIX-NEXT: blr
1256 %vecext = extractelement <16 x i8> %vuc, i32 %i
1260 ; Function Attrs: norecurse nounwind readnone
1261 define signext i16 @getss0(<8 x i16> %vss) {
1262 ; CHECK-LABEL: getss0:
1263 ; CHECK: # %bb.0: # %entry
1264 ; CHECK-NEXT: mfvsrd r3, v2
1265 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1266 ; CHECK-NEXT: extsh r3, r3
1269 ; CHECK-LE-LABEL: getss0:
1270 ; CHECK-LE: # %bb.0: # %entry
1271 ; CHECK-LE-NEXT: xxswapd vs0, v2
1272 ; CHECK-LE-NEXT: mffprd r3, f0
1273 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1274 ; CHECK-LE-NEXT: extsh r3, r3
1275 ; CHECK-LE-NEXT: blr
1277 ; CHECK-AIX-LABEL: getss0:
1278 ; CHECK-AIX: # %bb.0: # %entry
1279 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1280 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1281 ; CHECK-AIX-NEXT: extsh 3, 3
1282 ; CHECK-AIX-NEXT: blr
1284 %vecext = extractelement <8 x i16> %vss, i32 0
1290 ; Function Attrs: norecurse nounwind readnone
1291 define signext i16 @getss1(<8 x i16> %vss) {
1292 ; CHECK-LABEL: getss1:
1293 ; CHECK: # %bb.0: # %entry
1294 ; CHECK-NEXT: mfvsrd r3, v2
1295 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1296 ; CHECK-NEXT: extsh r3, r3
1299 ; CHECK-LE-LABEL: getss1:
1300 ; CHECK-LE: # %bb.0: # %entry
1301 ; CHECK-LE-NEXT: xxswapd vs0, v2
1302 ; CHECK-LE-NEXT: mffprd r3, f0
1303 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1304 ; CHECK-LE-NEXT: extsh r3, r3
1305 ; CHECK-LE-NEXT: blr
1307 ; CHECK-AIX-LABEL: getss1:
1308 ; CHECK-AIX: # %bb.0: # %entry
1309 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1310 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1311 ; CHECK-AIX-NEXT: extsh 3, 3
1312 ; CHECK-AIX-NEXT: blr
1314 %vecext = extractelement <8 x i16> %vss, i32 1
1320 ; Function Attrs: norecurse nounwind readnone
1321 define signext i16 @getss2(<8 x i16> %vss) {
1322 ; CHECK-LABEL: getss2:
1323 ; CHECK: # %bb.0: # %entry
1324 ; CHECK-NEXT: mfvsrd r3, v2
1325 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1326 ; CHECK-NEXT: extsh r3, r3
1329 ; CHECK-LE-LABEL: getss2:
1330 ; CHECK-LE: # %bb.0: # %entry
1331 ; CHECK-LE-NEXT: xxswapd vs0, v2
1332 ; CHECK-LE-NEXT: mffprd r3, f0
1333 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1334 ; CHECK-LE-NEXT: extsh r3, r3
1335 ; CHECK-LE-NEXT: blr
1337 ; CHECK-AIX-LABEL: getss2:
1338 ; CHECK-AIX: # %bb.0: # %entry
1339 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1340 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1341 ; CHECK-AIX-NEXT: extsh 3, 3
1342 ; CHECK-AIX-NEXT: blr
1344 %vecext = extractelement <8 x i16> %vss, i32 2
1350 ; Function Attrs: norecurse nounwind readnone
1351 define signext i16 @getss3(<8 x i16> %vss) {
1352 ; CHECK-LABEL: getss3:
1353 ; CHECK: # %bb.0: # %entry
1354 ; CHECK-NEXT: mfvsrd r3, v2
1355 ; CHECK-NEXT: clrldi r3, r3, 48
1356 ; CHECK-NEXT: extsh r3, r3
1359 ; CHECK-LE-LABEL: getss3:
1360 ; CHECK-LE: # %bb.0: # %entry
1361 ; CHECK-LE-NEXT: xxswapd vs0, v2
1362 ; CHECK-LE-NEXT: mffprd r3, f0
1363 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1364 ; CHECK-LE-NEXT: extsh r3, r3
1365 ; CHECK-LE-NEXT: blr
1367 ; CHECK-AIX-LABEL: getss3:
1368 ; CHECK-AIX: # %bb.0: # %entry
1369 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1370 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1371 ; CHECK-AIX-NEXT: extsh 3, 3
1372 ; CHECK-AIX-NEXT: blr
1374 %vecext = extractelement <8 x i16> %vss, i32 3
1380 ; Function Attrs: norecurse nounwind readnone
1381 define signext i16 @getss4(<8 x i16> %vss) {
1382 ; CHECK-LABEL: getss4:
1383 ; CHECK: # %bb.0: # %entry
1384 ; CHECK-NEXT: xxswapd vs0, v2
1385 ; CHECK-NEXT: mffprd r3, f0
1386 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1387 ; CHECK-NEXT: extsh r3, r3
1390 ; CHECK-LE-LABEL: getss4:
1391 ; CHECK-LE: # %bb.0: # %entry
1392 ; CHECK-LE-NEXT: mfvsrd r3, v2
1393 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1394 ; CHECK-LE-NEXT: extsh r3, r3
1395 ; CHECK-LE-NEXT: blr
1397 ; CHECK-AIX-LABEL: getss4:
1398 ; CHECK-AIX: # %bb.0: # %entry
1399 ; CHECK-AIX-NEXT: xxswapd 0, 34
1400 ; CHECK-AIX-NEXT: mffprd 3, 0
1401 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1402 ; CHECK-AIX-NEXT: extsh 3, 3
1403 ; CHECK-AIX-NEXT: blr
1405 %vecext = extractelement <8 x i16> %vss, i32 4
1411 ; Function Attrs: norecurse nounwind readnone
1412 define signext i16 @getss5(<8 x i16> %vss) {
1413 ; CHECK-LABEL: getss5:
1414 ; CHECK: # %bb.0: # %entry
1415 ; CHECK-NEXT: xxswapd vs0, v2
1416 ; CHECK-NEXT: mffprd r3, f0
1417 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1418 ; CHECK-NEXT: extsh r3, r3
1421 ; CHECK-LE-LABEL: getss5:
1422 ; CHECK-LE: # %bb.0: # %entry
1423 ; CHECK-LE-NEXT: mfvsrd r3, v2
1424 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1425 ; CHECK-LE-NEXT: extsh r3, r3
1426 ; CHECK-LE-NEXT: blr
1428 ; CHECK-AIX-LABEL: getss5:
1429 ; CHECK-AIX: # %bb.0: # %entry
1430 ; CHECK-AIX-NEXT: xxswapd 0, 34
1431 ; CHECK-AIX-NEXT: mffprd 3, 0
1432 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1433 ; CHECK-AIX-NEXT: extsh 3, 3
1434 ; CHECK-AIX-NEXT: blr
1436 %vecext = extractelement <8 x i16> %vss, i32 5
1442 ; Function Attrs: norecurse nounwind readnone
1443 define signext i16 @getss6(<8 x i16> %vss) {
1444 ; CHECK-LABEL: getss6:
1445 ; CHECK: # %bb.0: # %entry
1446 ; CHECK-NEXT: xxswapd vs0, v2
1447 ; CHECK-NEXT: mffprd r3, f0
1448 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1449 ; CHECK-NEXT: extsh r3, r3
1452 ; CHECK-LE-LABEL: getss6:
1453 ; CHECK-LE: # %bb.0: # %entry
1454 ; CHECK-LE-NEXT: mfvsrd r3, v2
1455 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1456 ; CHECK-LE-NEXT: extsh r3, r3
1457 ; CHECK-LE-NEXT: blr
1459 ; CHECK-AIX-LABEL: getss6:
1460 ; CHECK-AIX: # %bb.0: # %entry
1461 ; CHECK-AIX-NEXT: xxswapd 0, 34
1462 ; CHECK-AIX-NEXT: mffprd 3, 0
1463 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1464 ; CHECK-AIX-NEXT: extsh 3, 3
1465 ; CHECK-AIX-NEXT: blr
1467 %vecext = extractelement <8 x i16> %vss, i32 6
1473 ; Function Attrs: norecurse nounwind readnone
1474 define signext i16 @getss7(<8 x i16> %vss) {
1475 ; CHECK-LABEL: getss7:
1476 ; CHECK: # %bb.0: # %entry
1477 ; CHECK-NEXT: xxswapd vs0, v2
1478 ; CHECK-NEXT: mffprd r3, f0
1479 ; CHECK-NEXT: clrldi r3, r3, 48
1480 ; CHECK-NEXT: extsh r3, r3
1483 ; CHECK-LE-LABEL: getss7:
1484 ; CHECK-LE: # %bb.0: # %entry
1485 ; CHECK-LE-NEXT: mfvsrd r3, v2
1486 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1487 ; CHECK-LE-NEXT: extsh r3, r3
1488 ; CHECK-LE-NEXT: blr
1490 ; CHECK-AIX-LABEL: getss7:
1491 ; CHECK-AIX: # %bb.0: # %entry
1492 ; CHECK-AIX-NEXT: xxswapd 0, 34
1493 ; CHECK-AIX-NEXT: mffprd 3, 0
1494 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1495 ; CHECK-AIX-NEXT: extsh 3, 3
1496 ; CHECK-AIX-NEXT: blr
1498 %vecext = extractelement <8 x i16> %vss, i32 7
1504 ; Function Attrs: norecurse nounwind readnone
1505 define zeroext i16 @getus0(<8 x i16> %vus) {
1506 ; CHECK-LABEL: getus0:
1507 ; CHECK: # %bb.0: # %entry
1508 ; CHECK-NEXT: mfvsrd r3, v2
1509 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1510 ; CHECK-NEXT: clrldi r3, r3, 48
1513 ; CHECK-LE-LABEL: getus0:
1514 ; CHECK-LE: # %bb.0: # %entry
1515 ; CHECK-LE-NEXT: xxswapd vs0, v2
1516 ; CHECK-LE-NEXT: mffprd r3, f0
1517 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1518 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1519 ; CHECK-LE-NEXT: blr
1521 ; CHECK-AIX-LABEL: getus0:
1522 ; CHECK-AIX: # %bb.0: # %entry
1523 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1524 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1525 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1526 ; CHECK-AIX-NEXT: blr
1528 %vecext = extractelement <8 x i16> %vus, i32 0
1534 ; Function Attrs: norecurse nounwind readnone
1535 define zeroext i16 @getus1(<8 x i16> %vus) {
1536 ; CHECK-LABEL: getus1:
1537 ; CHECK: # %bb.0: # %entry
1538 ; CHECK-NEXT: mfvsrd r3, v2
1539 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1540 ; CHECK-NEXT: clrldi r3, r3, 48
1543 ; CHECK-LE-LABEL: getus1:
1544 ; CHECK-LE: # %bb.0: # %entry
1545 ; CHECK-LE-NEXT: xxswapd vs0, v2
1546 ; CHECK-LE-NEXT: mffprd r3, f0
1547 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1548 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1549 ; CHECK-LE-NEXT: blr
1551 ; CHECK-AIX-LABEL: getus1:
1552 ; CHECK-AIX: # %bb.0: # %entry
1553 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1554 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1555 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1556 ; CHECK-AIX-NEXT: blr
1558 %vecext = extractelement <8 x i16> %vus, i32 1
1564 ; Function Attrs: norecurse nounwind readnone
1565 define zeroext i16 @getus2(<8 x i16> %vus) {
1566 ; CHECK-LABEL: getus2:
1567 ; CHECK: # %bb.0: # %entry
1568 ; CHECK-NEXT: mfvsrd r3, v2
1569 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1570 ; CHECK-NEXT: clrldi r3, r3, 48
1573 ; CHECK-LE-LABEL: getus2:
1574 ; CHECK-LE: # %bb.0: # %entry
1575 ; CHECK-LE-NEXT: xxswapd vs0, v2
1576 ; CHECK-LE-NEXT: mffprd r3, f0
1577 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1578 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1579 ; CHECK-LE-NEXT: blr
1581 ; CHECK-AIX-LABEL: getus2:
1582 ; CHECK-AIX: # %bb.0: # %entry
1583 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1584 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1585 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1586 ; CHECK-AIX-NEXT: blr
1588 %vecext = extractelement <8 x i16> %vus, i32 2
1594 ; Function Attrs: norecurse nounwind readnone
1595 define zeroext i16 @getus3(<8 x i16> %vus) {
1596 ; CHECK-LABEL: getus3:
1597 ; CHECK: # %bb.0: # %entry
1598 ; CHECK-NEXT: mfvsrd r3, v2
1599 ; CHECK-NEXT: clrldi r3, r3, 48
1600 ; CHECK-NEXT: clrldi r3, r3, 48
1603 ; CHECK-LE-LABEL: getus3:
1604 ; CHECK-LE: # %bb.0: # %entry
1605 ; CHECK-LE-NEXT: xxswapd vs0, v2
1606 ; CHECK-LE-NEXT: mffprd r3, f0
1607 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1608 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1609 ; CHECK-LE-NEXT: blr
1611 ; CHECK-AIX-LABEL: getus3:
1612 ; CHECK-AIX: # %bb.0: # %entry
1613 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1614 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1615 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1616 ; CHECK-AIX-NEXT: blr
1618 %vecext = extractelement <8 x i16> %vus, i32 3
1624 ; Function Attrs: norecurse nounwind readnone
1625 define zeroext i16 @getus4(<8 x i16> %vus) {
1626 ; CHECK-LABEL: getus4:
1627 ; CHECK: # %bb.0: # %entry
1628 ; CHECK-NEXT: xxswapd vs0, v2
1629 ; CHECK-NEXT: mffprd r3, f0
1630 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1631 ; CHECK-NEXT: clrldi r3, r3, 48
1634 ; CHECK-LE-LABEL: getus4:
1635 ; CHECK-LE: # %bb.0: # %entry
1636 ; CHECK-LE-NEXT: mfvsrd r3, v2
1637 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1638 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1639 ; CHECK-LE-NEXT: blr
1641 ; CHECK-AIX-LABEL: getus4:
1642 ; CHECK-AIX: # %bb.0: # %entry
1643 ; CHECK-AIX-NEXT: xxswapd 0, 34
1644 ; CHECK-AIX-NEXT: mffprd 3, 0
1645 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1646 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1647 ; CHECK-AIX-NEXT: blr
1649 %vecext = extractelement <8 x i16> %vus, i32 4
1655 ; Function Attrs: norecurse nounwind readnone
1656 define zeroext i16 @getus5(<8 x i16> %vus) {
1657 ; CHECK-LABEL: getus5:
1658 ; CHECK: # %bb.0: # %entry
1659 ; CHECK-NEXT: xxswapd vs0, v2
1660 ; CHECK-NEXT: mffprd r3, f0
1661 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1662 ; CHECK-NEXT: clrldi r3, r3, 48
1665 ; CHECK-LE-LABEL: getus5:
1666 ; CHECK-LE: # %bb.0: # %entry
1667 ; CHECK-LE-NEXT: mfvsrd r3, v2
1668 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1669 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1670 ; CHECK-LE-NEXT: blr
1672 ; CHECK-AIX-LABEL: getus5:
1673 ; CHECK-AIX: # %bb.0: # %entry
1674 ; CHECK-AIX-NEXT: xxswapd 0, 34
1675 ; CHECK-AIX-NEXT: mffprd 3, 0
1676 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1677 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1678 ; CHECK-AIX-NEXT: blr
1680 %vecext = extractelement <8 x i16> %vus, i32 5
1686 ; Function Attrs: norecurse nounwind readnone
1687 define zeroext i16 @getus6(<8 x i16> %vus) {
1688 ; CHECK-LABEL: getus6:
1689 ; CHECK: # %bb.0: # %entry
1690 ; CHECK-NEXT: xxswapd vs0, v2
1691 ; CHECK-NEXT: mffprd r3, f0
1692 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1693 ; CHECK-NEXT: clrldi r3, r3, 48
1696 ; CHECK-LE-LABEL: getus6:
1697 ; CHECK-LE: # %bb.0: # %entry
1698 ; CHECK-LE-NEXT: mfvsrd r3, v2
1699 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1700 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1701 ; CHECK-LE-NEXT: blr
1703 ; CHECK-AIX-LABEL: getus6:
1704 ; CHECK-AIX: # %bb.0: # %entry
1705 ; CHECK-AIX-NEXT: xxswapd 0, 34
1706 ; CHECK-AIX-NEXT: mffprd 3, 0
1707 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1708 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1709 ; CHECK-AIX-NEXT: blr
1711 %vecext = extractelement <8 x i16> %vus, i32 6
1717 ; Function Attrs: norecurse nounwind readnone
1718 define zeroext i16 @getus7(<8 x i16> %vus) {
1719 ; CHECK-LABEL: getus7:
1720 ; CHECK: # %bb.0: # %entry
1721 ; CHECK-NEXT: xxswapd vs0, v2
1722 ; CHECK-NEXT: mffprd r3, f0
1723 ; CHECK-NEXT: clrldi r3, r3, 48
1724 ; CHECK-NEXT: clrldi r3, r3, 48
1727 ; CHECK-LE-LABEL: getus7:
1728 ; CHECK-LE: # %bb.0: # %entry
1729 ; CHECK-LE-NEXT: mfvsrd r3, v2
1730 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1731 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1732 ; CHECK-LE-NEXT: blr
1734 ; CHECK-AIX-LABEL: getus7:
1735 ; CHECK-AIX: # %bb.0: # %entry
1736 ; CHECK-AIX-NEXT: xxswapd 0, 34
1737 ; CHECK-AIX-NEXT: mffprd 3, 0
1738 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1739 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1740 ; CHECK-AIX-NEXT: blr
1742 %vecext = extractelement <8 x i16> %vus, i32 7
1748 ; Function Attrs: norecurse nounwind readnone
1749 define signext i16 @getvelss(<8 x i16> %vss, i32 signext %i) {
1750 ; CHECK-LABEL: getvelss:
1751 ; CHECK: # %bb.0: # %entry
1752 ; CHECK-NEXT: andi. r4, r5, 4
1753 ; CHECK-NEXT: li r3, 3
1754 ; CHECK-NEXT: sldi r4, r4, 1
1755 ; CHECK-NEXT: andc r3, r3, r5
1756 ; CHECK-NEXT: lvsl v3, 0, r4
1757 ; CHECK-NEXT: sldi r3, r3, 4
1758 ; CHECK-NEXT: vperm v2, v2, v2, v3
1759 ; CHECK-NEXT: mfvsrd r4, v2
1760 ; CHECK-NEXT: srd r3, r4, r3
1761 ; CHECK-NEXT: extsh r3, r3
1764 ; CHECK-LE-LABEL: getvelss:
1765 ; CHECK-LE: # %bb.0: # %entry
1766 ; CHECK-LE-NEXT: li r3, 4
1767 ; CHECK-LE-NEXT: andc r3, r3, r5
1768 ; CHECK-LE-NEXT: sldi r3, r3, 1
1769 ; CHECK-LE-NEXT: lvsl v3, 0, r3
1770 ; CHECK-LE-NEXT: li r3, 3
1771 ; CHECK-LE-NEXT: and r3, r3, r5
1772 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1773 ; CHECK-LE-NEXT: sldi r3, r3, 4
1774 ; CHECK-LE-NEXT: mfvsrd r4, v2
1775 ; CHECK-LE-NEXT: srd r3, r4, r3
1776 ; CHECK-LE-NEXT: extsh r3, r3
1777 ; CHECK-LE-NEXT: blr
1779 ; CHECK-AIX-LABEL: getvelss:
1780 ; CHECK-AIX: # %bb.0: # %entry
1781 ; CHECK-AIX-NEXT: andi. 5, 3, 4
1782 ; CHECK-AIX-NEXT: li 4, 3
1783 ; CHECK-AIX-NEXT: sldi 5, 5, 1
1784 ; CHECK-AIX-NEXT: andc 3, 4, 3
1785 ; CHECK-AIX-NEXT: lvsl 3, 0, 5
1786 ; CHECK-AIX-NEXT: sldi 3, 3, 4
1787 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1788 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1789 ; CHECK-AIX-NEXT: srd 3, 4, 3
1790 ; CHECK-AIX-NEXT: extsh 3, 3
1791 ; CHECK-AIX-NEXT: blr
1795 %vecext = extractelement <8 x i16> %vss, i32 %i
1799 ; Function Attrs: norecurse nounwind readnone
1800 define zeroext i16 @getvelus(<8 x i16> %vus, i32 signext %i) {
1801 ; CHECK-LABEL: getvelus:
1802 ; CHECK: # %bb.0: # %entry
1803 ; CHECK-NEXT: andi. r4, r5, 4
1804 ; CHECK-NEXT: li r3, 3
1805 ; CHECK-NEXT: sldi r4, r4, 1
1806 ; CHECK-NEXT: andc r3, r3, r5
1807 ; CHECK-NEXT: lvsl v3, 0, r4
1808 ; CHECK-NEXT: sldi r3, r3, 4
1809 ; CHECK-NEXT: vperm v2, v2, v2, v3
1810 ; CHECK-NEXT: mfvsrd r4, v2
1811 ; CHECK-NEXT: srd r3, r4, r3
1812 ; CHECK-NEXT: clrldi r3, r3, 48
1815 ; CHECK-LE-LABEL: getvelus:
1816 ; CHECK-LE: # %bb.0: # %entry
1817 ; CHECK-LE-NEXT: li r3, 4
1818 ; CHECK-LE-NEXT: andc r3, r3, r5
1819 ; CHECK-LE-NEXT: sldi r3, r3, 1
1820 ; CHECK-LE-NEXT: lvsl v3, 0, r3
1821 ; CHECK-LE-NEXT: li r3, 3
1822 ; CHECK-LE-NEXT: and r3, r3, r5
1823 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1824 ; CHECK-LE-NEXT: sldi r3, r3, 4
1825 ; CHECK-LE-NEXT: mfvsrd r4, v2
1826 ; CHECK-LE-NEXT: srd r3, r4, r3
1827 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1828 ; CHECK-LE-NEXT: blr
1830 ; CHECK-AIX-LABEL: getvelus:
1831 ; CHECK-AIX: # %bb.0: # %entry
1832 ; CHECK-AIX-NEXT: andi. 5, 3, 4
1833 ; CHECK-AIX-NEXT: li 4, 3
1834 ; CHECK-AIX-NEXT: sldi 5, 5, 1
1835 ; CHECK-AIX-NEXT: andc 3, 4, 3
1836 ; CHECK-AIX-NEXT: lvsl 3, 0, 5
1837 ; CHECK-AIX-NEXT: sldi 3, 3, 4
1838 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1839 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1840 ; CHECK-AIX-NEXT: srd 3, 4, 3
1841 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1842 ; CHECK-AIX-NEXT: blr
1846 %vecext = extractelement <8 x i16> %vus, i32 %i
1850 ; Function Attrs: norecurse nounwind readnone
1851 define signext i32 @getsi0(<4 x i32> %vsi) {
1852 ; CHECK-LABEL: getsi0:
1853 ; CHECK: # %bb.0: # %entry
1854 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 3
1855 ; CHECK-NEXT: mffprwz r3, f0
1856 ; CHECK-NEXT: extsw r3, r3
1859 ; CHECK-LE-LABEL: getsi0:
1860 ; CHECK-LE: # %bb.0: # %entry
1861 ; CHECK-LE-NEXT: xxswapd vs0, v2
1862 ; CHECK-LE-NEXT: mffprwz r3, f0
1863 ; CHECK-LE-NEXT: extsw r3, r3
1864 ; CHECK-LE-NEXT: blr
1866 ; CHECK-AIX-LABEL: getsi0:
1867 ; CHECK-AIX: # %bb.0: # %entry
1868 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 3
1869 ; CHECK-AIX-NEXT: mffprwz 3, 0
1870 ; CHECK-AIX-NEXT: extsw 3, 3
1871 ; CHECK-AIX-NEXT: blr
1873 %vecext = extractelement <4 x i32> %vsi, i32 0
1879 ; Function Attrs: norecurse nounwind readnone
1880 define signext i32 @getsi1(<4 x i32> %vsi) {
1881 ; CHECK-LABEL: getsi1:
1882 ; CHECK: # %bb.0: # %entry
1883 ; CHECK-NEXT: mfvsrwz r3, v2
1884 ; CHECK-NEXT: extsw r3, r3
1887 ; CHECK-LE-LABEL: getsi1:
1888 ; CHECK-LE: # %bb.0: # %entry
1889 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 1
1890 ; CHECK-LE-NEXT: mffprwz r3, f0
1891 ; CHECK-LE-NEXT: extsw r3, r3
1892 ; CHECK-LE-NEXT: blr
1894 ; CHECK-AIX-LABEL: getsi1:
1895 ; CHECK-AIX: # %bb.0: # %entry
1896 ; CHECK-AIX-NEXT: mfvsrwz 3, 34
1897 ; CHECK-AIX-NEXT: extsw 3, 3
1898 ; CHECK-AIX-NEXT: blr
1900 %vecext = extractelement <4 x i32> %vsi, i32 1
1906 ; Function Attrs: norecurse nounwind readnone
1907 define signext i32 @getsi2(<4 x i32> %vsi) {
1908 ; CHECK-LABEL: getsi2:
1909 ; CHECK: # %bb.0: # %entry
1910 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 1
1911 ; CHECK-NEXT: mffprwz r3, f0
1912 ; CHECK-NEXT: extsw r3, r3
1915 ; CHECK-LE-LABEL: getsi2:
1916 ; CHECK-LE: # %bb.0: # %entry
1917 ; CHECK-LE-NEXT: mfvsrwz r3, v2
1918 ; CHECK-LE-NEXT: extsw r3, r3
1919 ; CHECK-LE-NEXT: blr
1921 ; CHECK-AIX-LABEL: getsi2:
1922 ; CHECK-AIX: # %bb.0: # %entry
1923 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 1
1924 ; CHECK-AIX-NEXT: mffprwz 3, 0
1925 ; CHECK-AIX-NEXT: extsw 3, 3
1926 ; CHECK-AIX-NEXT: blr
1928 %vecext = extractelement <4 x i32> %vsi, i32 2
1934 ; Function Attrs: norecurse nounwind readnone
1935 define signext i32 @getsi3(<4 x i32> %vsi) {
1936 ; CHECK-LABEL: getsi3:
1937 ; CHECK: # %bb.0: # %entry
1938 ; CHECK-NEXT: xxswapd vs0, v2
1939 ; CHECK-NEXT: mffprwz r3, f0
1940 ; CHECK-NEXT: extsw r3, r3
1943 ; CHECK-LE-LABEL: getsi3:
1944 ; CHECK-LE: # %bb.0: # %entry
1945 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
1946 ; CHECK-LE-NEXT: mffprwz r3, f0
1947 ; CHECK-LE-NEXT: extsw r3, r3
1948 ; CHECK-LE-NEXT: blr
1950 ; CHECK-AIX-LABEL: getsi3:
1951 ; CHECK-AIX: # %bb.0: # %entry
1952 ; CHECK-AIX-NEXT: xxswapd 0, 34
1953 ; CHECK-AIX-NEXT: mffprwz 3, 0
1954 ; CHECK-AIX-NEXT: extsw 3, 3
1955 ; CHECK-AIX-NEXT: blr
1957 %vecext = extractelement <4 x i32> %vsi, i32 3
1963 ; Function Attrs: norecurse nounwind readnone
1964 define zeroext i32 @getui0(<4 x i32> %vui) {
1965 ; CHECK-LABEL: getui0:
1966 ; CHECK: # %bb.0: # %entry
1967 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 3
1968 ; CHECK-NEXT: mffprwz r3, f0
1969 ; CHECK-NEXT: clrldi r3, r3, 32
1972 ; CHECK-LE-LABEL: getui0:
1973 ; CHECK-LE: # %bb.0: # %entry
1974 ; CHECK-LE-NEXT: xxswapd vs0, v2
1975 ; CHECK-LE-NEXT: mffprwz r3, f0
1976 ; CHECK-LE-NEXT: clrldi r3, r3, 32
1977 ; CHECK-LE-NEXT: blr
1979 ; CHECK-AIX-LABEL: getui0:
1980 ; CHECK-AIX: # %bb.0: # %entry
1981 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 3
1982 ; CHECK-AIX-NEXT: mffprwz 3, 0
1983 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
1984 ; CHECK-AIX-NEXT: blr
1986 %vecext = extractelement <4 x i32> %vui, i32 0
1992 ; Function Attrs: norecurse nounwind readnone
1993 define zeroext i32 @getui1(<4 x i32> %vui) {
1994 ; CHECK-LABEL: getui1:
1995 ; CHECK: # %bb.0: # %entry
1996 ; CHECK-NEXT: mfvsrwz r3, v2
1997 ; CHECK-NEXT: clrldi r3, r3, 32
2000 ; CHECK-LE-LABEL: getui1:
2001 ; CHECK-LE: # %bb.0: # %entry
2002 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 1
2003 ; CHECK-LE-NEXT: mffprwz r3, f0
2004 ; CHECK-LE-NEXT: clrldi r3, r3, 32
2005 ; CHECK-LE-NEXT: blr
2007 ; CHECK-AIX-LABEL: getui1:
2008 ; CHECK-AIX: # %bb.0: # %entry
2009 ; CHECK-AIX-NEXT: mfvsrwz 3, 34
2010 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2011 ; CHECK-AIX-NEXT: blr
2013 %vecext = extractelement <4 x i32> %vui, i32 1
2019 ; Function Attrs: norecurse nounwind readnone
2020 define zeroext i32 @getui2(<4 x i32> %vui) {
2021 ; CHECK-LABEL: getui2:
2022 ; CHECK: # %bb.0: # %entry
2023 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 1
2024 ; CHECK-NEXT: mffprwz r3, f0
2025 ; CHECK-NEXT: clrldi r3, r3, 32
2028 ; CHECK-LE-LABEL: getui2:
2029 ; CHECK-LE: # %bb.0: # %entry
2030 ; CHECK-LE-NEXT: mfvsrwz r3, v2
2031 ; CHECK-LE-NEXT: clrldi r3, r3, 32
2032 ; CHECK-LE-NEXT: blr
2034 ; CHECK-AIX-LABEL: getui2:
2035 ; CHECK-AIX: # %bb.0: # %entry
2036 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 1
2037 ; CHECK-AIX-NEXT: mffprwz 3, 0
2038 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2039 ; CHECK-AIX-NEXT: blr
2041 %vecext = extractelement <4 x i32> %vui, i32 2
2047 ; Function Attrs: norecurse nounwind readnone
2048 define zeroext i32 @getui3(<4 x i32> %vui) {
2049 ; CHECK-LABEL: getui3:
2050 ; CHECK: # %bb.0: # %entry
2051 ; CHECK-NEXT: xxswapd vs0, v2
2052 ; CHECK-NEXT: mffprwz r3, f0
2053 ; CHECK-NEXT: clrldi r3, r3, 32
2056 ; CHECK-LE-LABEL: getui3:
2057 ; CHECK-LE: # %bb.0: # %entry
2058 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
2059 ; CHECK-LE-NEXT: mffprwz r3, f0
2060 ; CHECK-LE-NEXT: clrldi r3, r3, 32
2061 ; CHECK-LE-NEXT: blr
2063 ; CHECK-AIX-LABEL: getui3:
2064 ; CHECK-AIX: # %bb.0: # %entry
2065 ; CHECK-AIX-NEXT: xxswapd 0, 34
2066 ; CHECK-AIX-NEXT: mffprwz 3, 0
2067 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2068 ; CHECK-AIX-NEXT: blr
2070 %vecext = extractelement <4 x i32> %vui, i32 3
2076 ; Function Attrs: norecurse nounwind readnone
2077 define signext i32 @getvelsi(<4 x i32> %vsi, i32 signext %i) {
2078 ; CHECK-LABEL: getvelsi:
2079 ; CHECK: # %bb.0: # %entry
2080 ; CHECK-NEXT: andi. r4, r5, 2
2081 ; CHECK-NEXT: li r3, 1
2082 ; CHECK-NEXT: sldi r4, r4, 2
2083 ; CHECK-NEXT: andc r3, r3, r5
2084 ; CHECK-NEXT: lvsl v3, 0, r4
2085 ; CHECK-NEXT: sldi r3, r3, 5
2086 ; CHECK-NEXT: vperm v2, v2, v2, v3
2087 ; CHECK-NEXT: mfvsrd r4, v2
2088 ; CHECK-NEXT: srd r3, r4, r3
2089 ; CHECK-NEXT: extsw r3, r3
2092 ; CHECK-LE-LABEL: getvelsi:
2093 ; CHECK-LE: # %bb.0: # %entry
2094 ; CHECK-LE-NEXT: li r3, 2
2095 ; CHECK-LE-NEXT: andc r3, r3, r5
2096 ; CHECK-LE-NEXT: sldi r3, r3, 2
2097 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2098 ; CHECK-LE-NEXT: li r3, 1
2099 ; CHECK-LE-NEXT: and r3, r3, r5
2100 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2101 ; CHECK-LE-NEXT: sldi r3, r3, 5
2102 ; CHECK-LE-NEXT: mfvsrd r4, v2
2103 ; CHECK-LE-NEXT: srd r3, r4, r3
2104 ; CHECK-LE-NEXT: extsw r3, r3
2105 ; CHECK-LE-NEXT: blr
2107 ; CHECK-AIX-LABEL: getvelsi:
2108 ; CHECK-AIX: # %bb.0: # %entry
2109 ; CHECK-AIX-NEXT: andi. 5, 3, 2
2110 ; CHECK-AIX-NEXT: li 4, 1
2111 ; CHECK-AIX-NEXT: sldi 5, 5, 2
2112 ; CHECK-AIX-NEXT: andc 3, 4, 3
2113 ; CHECK-AIX-NEXT: lvsl 3, 0, 5
2114 ; CHECK-AIX-NEXT: sldi 3, 3, 5
2115 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2116 ; CHECK-AIX-NEXT: mfvsrd 4, 34
2117 ; CHECK-AIX-NEXT: srd 3, 4, 3
2118 ; CHECK-AIX-NEXT: extsw 3, 3
2119 ; CHECK-AIX-NEXT: blr
2121 %vecext = extractelement <4 x i32> %vsi, i32 %i
2123 ; FIXME: add check patterns when variable element extraction is implemented
2126 ; Function Attrs: norecurse nounwind readnone
2127 define zeroext i32 @getvelui(<4 x i32> %vui, i32 signext %i) {
2128 ; CHECK-LABEL: getvelui:
2129 ; CHECK: # %bb.0: # %entry
2130 ; CHECK-NEXT: andi. r4, r5, 2
2131 ; CHECK-NEXT: li r3, 1
2132 ; CHECK-NEXT: sldi r4, r4, 2
2133 ; CHECK-NEXT: andc r3, r3, r5
2134 ; CHECK-NEXT: lvsl v3, 0, r4
2135 ; CHECK-NEXT: sldi r3, r3, 5
2136 ; CHECK-NEXT: vperm v2, v2, v2, v3
2137 ; CHECK-NEXT: mfvsrd r4, v2
2138 ; CHECK-NEXT: srd r3, r4, r3
2139 ; CHECK-NEXT: clrldi r3, r3, 32
2142 ; CHECK-LE-LABEL: getvelui:
2143 ; CHECK-LE: # %bb.0: # %entry
2144 ; CHECK-LE-NEXT: li r3, 2
2145 ; CHECK-LE-NEXT: andc r3, r3, r5
2146 ; CHECK-LE-NEXT: sldi r3, r3, 2
2147 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2148 ; CHECK-LE-NEXT: li r3, 1
2149 ; CHECK-LE-NEXT: and r3, r3, r5
2150 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2151 ; CHECK-LE-NEXT: sldi r3, r3, 5
2152 ; CHECK-LE-NEXT: mfvsrd r4, v2
2153 ; CHECK-LE-NEXT: srd r3, r4, r3
2154 ; CHECK-LE-NEXT: clrldi r3, r3, 32
2155 ; CHECK-LE-NEXT: blr
2157 ; CHECK-AIX-LABEL: getvelui:
2158 ; CHECK-AIX: # %bb.0: # %entry
2159 ; CHECK-AIX-NEXT: andi. 5, 3, 2
2160 ; CHECK-AIX-NEXT: li 4, 1
2161 ; CHECK-AIX-NEXT: sldi 5, 5, 2
2162 ; CHECK-AIX-NEXT: andc 3, 4, 3
2163 ; CHECK-AIX-NEXT: lvsl 3, 0, 5
2164 ; CHECK-AIX-NEXT: sldi 3, 3, 5
2165 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2166 ; CHECK-AIX-NEXT: mfvsrd 4, 34
2167 ; CHECK-AIX-NEXT: srd 3, 4, 3
2168 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2169 ; CHECK-AIX-NEXT: blr
2171 %vecext = extractelement <4 x i32> %vui, i32 %i
2173 ; FIXME: add check patterns when variable element extraction is implemented
2176 ; Function Attrs: norecurse nounwind readnone
2177 define i64 @getsl0(<2 x i64> %vsl) {
2178 ; CHECK-LABEL: getsl0:
2179 ; CHECK: # %bb.0: # %entry
2180 ; CHECK-NEXT: mfvsrd r3, v2
2183 ; CHECK-LE-LABEL: getsl0:
2184 ; CHECK-LE: # %bb.0: # %entry
2185 ; CHECK-LE-NEXT: xxswapd vs0, v2
2186 ; CHECK-LE-NEXT: mffprd r3, f0
2187 ; CHECK-LE-NEXT: blr
2189 ; CHECK-AIX-LABEL: getsl0:
2190 ; CHECK-AIX: # %bb.0: # %entry
2191 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2192 ; CHECK-AIX-NEXT: blr
2194 %vecext = extractelement <2 x i64> %vsl, i32 0
2200 ; Function Attrs: norecurse nounwind readnone
2201 define i64 @getsl1(<2 x i64> %vsl) {
2202 ; CHECK-LABEL: getsl1:
2203 ; CHECK: # %bb.0: # %entry
2204 ; CHECK-NEXT: xxswapd vs0, v2
2205 ; CHECK-NEXT: mffprd r3, f0
2208 ; CHECK-LE-LABEL: getsl1:
2209 ; CHECK-LE: # %bb.0: # %entry
2210 ; CHECK-LE-NEXT: mfvsrd r3, v2
2211 ; CHECK-LE-NEXT: blr
2213 ; CHECK-AIX-LABEL: getsl1:
2214 ; CHECK-AIX: # %bb.0: # %entry
2215 ; CHECK-AIX-NEXT: xxswapd 0, 34
2216 ; CHECK-AIX-NEXT: mffprd 3, 0
2217 ; CHECK-AIX-NEXT: blr
2219 %vecext = extractelement <2 x i64> %vsl, i32 1
2225 ; Function Attrs: norecurse nounwind readnone
2226 define i64 @getul0(<2 x i64> %vul) {
2227 ; CHECK-LABEL: getul0:
2228 ; CHECK: # %bb.0: # %entry
2229 ; CHECK-NEXT: mfvsrd r3, v2
2232 ; CHECK-LE-LABEL: getul0:
2233 ; CHECK-LE: # %bb.0: # %entry
2234 ; CHECK-LE-NEXT: xxswapd vs0, v2
2235 ; CHECK-LE-NEXT: mffprd r3, f0
2236 ; CHECK-LE-NEXT: blr
2238 ; CHECK-AIX-LABEL: getul0:
2239 ; CHECK-AIX: # %bb.0: # %entry
2240 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2241 ; CHECK-AIX-NEXT: blr
2243 %vecext = extractelement <2 x i64> %vul, i32 0
2249 ; Function Attrs: norecurse nounwind readnone
2250 define i64 @getul1(<2 x i64> %vul) {
2251 ; CHECK-LABEL: getul1:
2252 ; CHECK: # %bb.0: # %entry
2253 ; CHECK-NEXT: xxswapd vs0, v2
2254 ; CHECK-NEXT: mffprd r3, f0
2257 ; CHECK-LE-LABEL: getul1:
2258 ; CHECK-LE: # %bb.0: # %entry
2259 ; CHECK-LE-NEXT: mfvsrd r3, v2
2260 ; CHECK-LE-NEXT: blr
2262 ; CHECK-AIX-LABEL: getul1:
2263 ; CHECK-AIX: # %bb.0: # %entry
2264 ; CHECK-AIX-NEXT: xxswapd 0, 34
2265 ; CHECK-AIX-NEXT: mffprd 3, 0
2266 ; CHECK-AIX-NEXT: blr
2268 %vecext = extractelement <2 x i64> %vul, i32 1
2274 ; Function Attrs: norecurse nounwind readnone
2275 define i64 @getvelsl(<2 x i64> %vsl, i32 signext %i) {
2276 ; CHECK-LABEL: getvelsl:
2277 ; CHECK: # %bb.0: # %entry
2278 ; CHECK-NEXT: andi. r3, r5, 1
2279 ; CHECK-NEXT: sldi r3, r3, 3
2280 ; CHECK-NEXT: lvsl v3, 0, r3
2281 ; CHECK-NEXT: vperm v2, v2, v2, v3
2282 ; CHECK-NEXT: mfvsrd r3, v2
2285 ; CHECK-LE-LABEL: getvelsl:
2286 ; CHECK-LE: # %bb.0: # %entry
2287 ; CHECK-LE-NEXT: li r3, 1
2288 ; CHECK-LE-NEXT: andc r3, r3, r5
2289 ; CHECK-LE-NEXT: sldi r3, r3, 3
2290 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2291 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2292 ; CHECK-LE-NEXT: mfvsrd r3, v2
2293 ; CHECK-LE-NEXT: blr
2295 ; CHECK-AIX-LABEL: getvelsl:
2296 ; CHECK-AIX: # %bb.0: # %entry
2297 ; CHECK-AIX-NEXT: andi. 3, 3, 1
2298 ; CHECK-AIX-NEXT: sldi 3, 3, 3
2299 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2300 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2301 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2302 ; CHECK-AIX-NEXT: blr
2304 %vecext = extractelement <2 x i64> %vsl, i32 %i
2306 ; FIXME: add check patterns when variable element extraction is implemented
2309 ; Function Attrs: norecurse nounwind readnone
2310 define i64 @getvelul(<2 x i64> %vul, i32 signext %i) {
2311 ; CHECK-LABEL: getvelul:
2312 ; CHECK: # %bb.0: # %entry
2313 ; CHECK-NEXT: andi. r3, r5, 1
2314 ; CHECK-NEXT: sldi r3, r3, 3
2315 ; CHECK-NEXT: lvsl v3, 0, r3
2316 ; CHECK-NEXT: vperm v2, v2, v2, v3
2317 ; CHECK-NEXT: mfvsrd r3, v2
2320 ; CHECK-LE-LABEL: getvelul:
2321 ; CHECK-LE: # %bb.0: # %entry
2322 ; CHECK-LE-NEXT: li r3, 1
2323 ; CHECK-LE-NEXT: andc r3, r3, r5
2324 ; CHECK-LE-NEXT: sldi r3, r3, 3
2325 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2326 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2327 ; CHECK-LE-NEXT: mfvsrd r3, v2
2328 ; CHECK-LE-NEXT: blr
2330 ; CHECK-AIX-LABEL: getvelul:
2331 ; CHECK-AIX: # %bb.0: # %entry
2332 ; CHECK-AIX-NEXT: andi. 3, 3, 1
2333 ; CHECK-AIX-NEXT: sldi 3, 3, 3
2334 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2335 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2336 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2337 ; CHECK-AIX-NEXT: blr
2339 %vecext = extractelement <2 x i64> %vul, i32 %i
2341 ; FIXME: add check patterns when variable element extraction is implemented
2344 ; Function Attrs: norecurse nounwind readnone
2345 define float @getf0(<4 x float> %vf) {
2346 ; CHECK-LABEL: getf0:
2347 ; CHECK: # %bb.0: # %entry
2348 ; CHECK-NEXT: xscvspdpn f1, v2
2351 ; CHECK-LE-LABEL: getf0:
2352 ; CHECK-LE: # %bb.0: # %entry
2353 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
2354 ; CHECK-LE-NEXT: xscvspdpn f1, vs0
2355 ; CHECK-LE-NEXT: blr
2357 ; CHECK-AIX-LABEL: getf0:
2358 ; CHECK-AIX: # %bb.0: # %entry
2359 ; CHECK-AIX-NEXT: xscvspdpn 1, 34
2360 ; CHECK-AIX-NEXT: blr
2362 %vecext = extractelement <4 x float> %vf, i32 0
2368 ; Function Attrs: norecurse nounwind readnone
2369 define float @getf1(<4 x float> %vf) {
2370 ; CHECK-LABEL: getf1:
2371 ; CHECK: # %bb.0: # %entry
2372 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 1
2373 ; CHECK-NEXT: xscvspdpn f1, vs0
2376 ; CHECK-LE-LABEL: getf1:
2377 ; CHECK-LE: # %bb.0: # %entry
2378 ; CHECK-LE-NEXT: xxswapd vs0, v2
2379 ; CHECK-LE-NEXT: xscvspdpn f1, vs0
2380 ; CHECK-LE-NEXT: blr
2382 ; CHECK-AIX-LABEL: getf1:
2383 ; CHECK-AIX: # %bb.0: # %entry
2384 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 1
2385 ; CHECK-AIX-NEXT: xscvspdpn 1, 0
2386 ; CHECK-AIX-NEXT: blr
2388 %vecext = extractelement <4 x float> %vf, i32 1
2394 ; Function Attrs: norecurse nounwind readnone
2395 define float @getf2(<4 x float> %vf) {
2396 ; CHECK-LABEL: getf2:
2397 ; CHECK: # %bb.0: # %entry
2398 ; CHECK-NEXT: xxswapd vs0, v2
2399 ; CHECK-NEXT: xscvspdpn f1, vs0
2402 ; CHECK-LE-LABEL: getf2:
2403 ; CHECK-LE: # %bb.0: # %entry
2404 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 1
2405 ; CHECK-LE-NEXT: xscvspdpn f1, vs0
2406 ; CHECK-LE-NEXT: blr
2408 ; CHECK-AIX-LABEL: getf2:
2409 ; CHECK-AIX: # %bb.0: # %entry
2410 ; CHECK-AIX-NEXT: xxswapd 0, 34
2411 ; CHECK-AIX-NEXT: xscvspdpn 1, 0
2412 ; CHECK-AIX-NEXT: blr
2414 %vecext = extractelement <4 x float> %vf, i32 2
2420 ; Function Attrs: norecurse nounwind readnone
2421 define float @getf3(<4 x float> %vf) {
2422 ; CHECK-LABEL: getf3:
2423 ; CHECK: # %bb.0: # %entry
2424 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 3
2425 ; CHECK-NEXT: xscvspdpn f1, vs0
2428 ; CHECK-LE-LABEL: getf3:
2429 ; CHECK-LE: # %bb.0: # %entry
2430 ; CHECK-LE-NEXT: xscvspdpn f1, v2
2431 ; CHECK-LE-NEXT: blr
2433 ; CHECK-AIX-LABEL: getf3:
2434 ; CHECK-AIX: # %bb.0: # %entry
2435 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 3
2436 ; CHECK-AIX-NEXT: xscvspdpn 1, 0
2437 ; CHECK-AIX-NEXT: blr
2439 %vecext = extractelement <4 x float> %vf, i32 3
2445 ; Function Attrs: norecurse nounwind readnone
2446 define float @getvelf(<4 x float> %vf, i32 signext %i) {
2447 ; CHECK-LABEL: getvelf:
2448 ; CHECK: # %bb.0: # %entry
2449 ; CHECK-NEXT: sldi r3, r5, 2
2450 ; CHECK-NEXT: lvsl v3, 0, r3
2451 ; CHECK-NEXT: vperm v2, v2, v2, v3
2452 ; CHECK-NEXT: xscvspdpn f1, v2
2455 ; CHECK-LE-LABEL: getvelf:
2456 ; CHECK-LE: # %bb.0: # %entry
2457 ; CHECK-LE-NEXT: xori r3, r5, 3
2458 ; CHECK-LE-NEXT: sldi r3, r3, 2
2459 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2460 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2461 ; CHECK-LE-NEXT: xscvspdpn f1, v2
2462 ; CHECK-LE-NEXT: blr
2464 ; CHECK-AIX-LABEL: getvelf:
2465 ; CHECK-AIX: # %bb.0: # %entry
2466 ; CHECK-AIX-NEXT: sldi 3, 3, 2
2467 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2468 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2469 ; CHECK-AIX-NEXT: xscvspdpn 1, 34
2470 ; CHECK-AIX-NEXT: blr
2472 %vecext = extractelement <4 x float> %vf, i32 %i
2474 ; FIXME: add check patterns when variable element extraction is implemented
2477 ; Function Attrs: norecurse nounwind readnone
2478 define double @getd0(<2 x double> %vd) {
2479 ; CHECK-LABEL: getd0:
2480 ; CHECK: # %bb.0: # %entry
2481 ; CHECK-NEXT: xxlor f1, v2, v2
2484 ; CHECK-LE-LABEL: getd0:
2485 ; CHECK-LE: # %bb.0: # %entry
2486 ; CHECK-LE-NEXT: xxswapd vs1, v2
2487 ; CHECK-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2488 ; CHECK-LE-NEXT: blr
2490 ; CHECK-AIX-LABEL: getd0:
2491 ; CHECK-AIX: # %bb.0: # %entry
2492 ; CHECK-AIX-NEXT: xxlor 1, 34, 34
2493 ; CHECK-AIX-NEXT: blr
2495 %vecext = extractelement <2 x double> %vd, i32 0
2499 ; CHECK-AIXT: xxlor 1, 34, 34
2502 ; Function Attrs: norecurse nounwind readnone
2503 define double @getd1(<2 x double> %vd) {
2504 ; CHECK-LABEL: getd1:
2505 ; CHECK: # %bb.0: # %entry
2506 ; CHECK-NEXT: xxswapd vs1, v2
2507 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2510 ; CHECK-LE-LABEL: getd1:
2511 ; CHECK-LE: # %bb.0: # %entry
2512 ; CHECK-LE-NEXT: xxlor f1, v2, v2
2513 ; CHECK-LE-NEXT: blr
2515 ; CHECK-AIX-LABEL: getd1:
2516 ; CHECK-AIX: # %bb.0: # %entry
2517 ; CHECK-AIX-NEXT: xxswapd 1, 34
2518 ; CHECK-AIX-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2519 ; CHECK-AIX-NEXT: blr
2521 %vecext = extractelement <2 x double> %vd, i32 1
2527 ; Function Attrs: norecurse nounwind readnone
2528 define double @getveld(<2 x double> %vd, i32 signext %i) {
2529 ; CHECK-LABEL: getveld:
2530 ; CHECK: # %bb.0: # %entry
2531 ; CHECK-NEXT: andi. r3, r5, 1
2532 ; CHECK-NEXT: sldi r3, r3, 3
2533 ; CHECK-NEXT: lvsl v3, 0, r3
2534 ; CHECK-NEXT: vperm v2, v2, v2, v3
2535 ; CHECK-NEXT: xxlor vs1, v2, v2
2536 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2539 ; CHECK-LE-LABEL: getveld:
2540 ; CHECK-LE: # %bb.0: # %entry
2541 ; CHECK-LE-NEXT: li r3, 1
2542 ; CHECK-LE-NEXT: andc r3, r3, r5
2543 ; CHECK-LE-NEXT: sldi r3, r3, 3
2544 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2545 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2546 ; CHECK-LE-NEXT: xxlor vs1, v2, v2
2547 ; CHECK-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2548 ; CHECK-LE-NEXT: blr
2550 ; CHECK-AIX-LABEL: getveld:
2551 ; CHECK-AIX: # %bb.0: # %entry
2552 ; CHECK-AIX-NEXT: andi. 3, 3, 1
2553 ; CHECK-AIX-NEXT: sldi 3, 3, 3
2554 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2555 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2556 ; CHECK-AIX-NEXT: xxlor 1, 34, 34
2557 ; CHECK-AIX-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2558 ; CHECK-AIX-NEXT: blr
2560 %vecext = extractelement <2 x double> %vd, i32 %i
2562 ; FIXME: add check patterns when variable element extraction is implemented
2565 ; To check when LHS is i32 to vector and RHS is i64 to vector,
2566 ; the combination should be skipped properly.
2567 define <2 x i64> @buildi2(i64 %arg, i32 %arg1) {
2568 ; CHECK-LABEL: buildi2:
2569 ; CHECK: # %bb.0: # %entry
2570 ; CHECK-NEXT: sldi r4, r4, 32
2571 ; CHECK-NEXT: mtfprd f1, r3
2572 ; CHECK-NEXT: mtfprd f0, r4
2573 ; CHECK-NEXT: xxmrghd v2, vs0, vs1
2576 ; CHECK-LE-LABEL: buildi2:
2577 ; CHECK-LE: # %bb.0: # %entry
2578 ; CHECK-LE-NEXT: mtfprwz f0, r4
2579 ; CHECK-LE-NEXT: mtfprd f1, r3
2580 ; CHECK-LE-NEXT: xxmrgld v2, vs1, vs0
2581 ; CHECK-LE-NEXT: blr
2583 ; CHECK-AIX-LABEL: buildi2:
2584 ; CHECK-AIX: # %bb.0: # %entry
2585 ; CHECK-AIX-NEXT: sldi 4, 4, 32
2586 ; CHECK-AIX-NEXT: mtfprd 1, 3
2587 ; CHECK-AIX-NEXT: mtfprd 0, 4
2588 ; CHECK-AIX-NEXT: xxmrghd 34, 0, 1
2589 ; CHECK-AIX-NEXT: blr
2591 %lhs.i32 = insertelement <4 x i32> undef, i32 %arg1, i32 0
2592 %rhs = insertelement <2 x i64> undef, i64 %arg, i32 0
2593 %lhs = bitcast <4 x i32> %lhs.i32 to <2 x i64>
2594 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
2595 ret <2 x i64> %shuffle