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) # @d
174 ; CHECK-AIX-NEXT: lxvdsx 34, 0, 3
175 ; CHECK-AIX-NEXT: blr
177 %0 = load double, ptr @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
681 ; CHECK-LE-LABEL: getuc0:
682 ; CHECK-LE: # %bb.0: # %entry
683 ; CHECK-LE-NEXT: xxswapd vs0, v2
684 ; CHECK-LE-NEXT: mffprd r3, f0
685 ; CHECK-LE-NEXT: clrldi r3, r3, 56
688 ; CHECK-AIX-LABEL: getuc0:
689 ; CHECK-AIX: # %bb.0: # %entry
690 ; CHECK-AIX-NEXT: mfvsrd 3, 34
691 ; CHECK-AIX-NEXT: rldicl 3, 3, 8, 56
692 ; CHECK-AIX-NEXT: blr
694 %vecext = extractelement <16 x i8> %vuc, i32 0
700 ; Function Attrs: norecurse nounwind readnone
701 define zeroext i8 @getuc1(<16 x i8> %vuc) {
702 ; CHECK-LABEL: getuc1:
703 ; CHECK: # %bb.0: # %entry
704 ; CHECK-NEXT: mfvsrd r3, v2
705 ; CHECK-NEXT: rldicl r3, r3, 16, 56
708 ; CHECK-LE-LABEL: getuc1:
709 ; CHECK-LE: # %bb.0: # %entry
710 ; CHECK-LE-NEXT: xxswapd vs0, v2
711 ; CHECK-LE-NEXT: mffprd r3, f0
712 ; CHECK-LE-NEXT: rldicl r3, r3, 56, 56
715 ; CHECK-AIX-LABEL: getuc1:
716 ; CHECK-AIX: # %bb.0: # %entry
717 ; CHECK-AIX-NEXT: mfvsrd 3, 34
718 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 56
719 ; CHECK-AIX-NEXT: blr
721 %vecext = extractelement <16 x i8> %vuc, i32 1
727 ; Function Attrs: norecurse nounwind readnone
728 define zeroext i8 @getuc2(<16 x i8> %vuc) {
729 ; CHECK-LABEL: getuc2:
730 ; CHECK: # %bb.0: # %entry
731 ; CHECK-NEXT: mfvsrd r3, v2
732 ; CHECK-NEXT: rldicl r3, r3, 24, 56
735 ; CHECK-LE-LABEL: getuc2:
736 ; CHECK-LE: # %bb.0: # %entry
737 ; CHECK-LE-NEXT: xxswapd vs0, v2
738 ; CHECK-LE-NEXT: mffprd r3, f0
739 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 56
742 ; CHECK-AIX-LABEL: getuc2:
743 ; CHECK-AIX: # %bb.0: # %entry
744 ; CHECK-AIX-NEXT: mfvsrd 3, 34
745 ; CHECK-AIX-NEXT: rldicl 3, 3, 24, 56
746 ; CHECK-AIX-NEXT: blr
748 %vecext = extractelement <16 x i8> %vuc, i32 2
752 ; Function Attrs: norecurse nounwind readnone
753 define zeroext i8 @getuc3(<16 x i8> %vuc) {
754 ; CHECK-LABEL: getuc3:
755 ; CHECK: # %bb.0: # %entry
756 ; CHECK-NEXT: mfvsrd r3, v2
757 ; CHECK-NEXT: rldicl r3, r3, 32, 56
760 ; CHECK-LE-LABEL: getuc3:
761 ; CHECK-LE: # %bb.0: # %entry
762 ; CHECK-LE-NEXT: xxswapd vs0, v2
763 ; CHECK-LE-NEXT: mffprd r3, f0
764 ; CHECK-LE-NEXT: rldicl r3, r3, 40, 56
767 ; CHECK-AIX-LABEL: getuc3:
768 ; CHECK-AIX: # %bb.0: # %entry
769 ; CHECK-AIX-NEXT: mfvsrd 3, 34
770 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 56
771 ; CHECK-AIX-NEXT: blr
773 %vecext = extractelement <16 x i8> %vuc, i32 3
779 ; Function Attrs: norecurse nounwind readnone
780 define zeroext i8 @getuc4(<16 x i8> %vuc) {
781 ; CHECK-LABEL: getuc4:
782 ; CHECK: # %bb.0: # %entry
783 ; CHECK-NEXT: mfvsrd r3, v2
784 ; CHECK-NEXT: rldicl r3, r3, 40, 56
787 ; CHECK-LE-LABEL: getuc4:
788 ; CHECK-LE: # %bb.0: # %entry
789 ; CHECK-LE-NEXT: xxswapd vs0, v2
790 ; CHECK-LE-NEXT: mffprd r3, f0
791 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 56
794 ; CHECK-AIX-LABEL: getuc4:
795 ; CHECK-AIX: # %bb.0: # %entry
796 ; CHECK-AIX-NEXT: mfvsrd 3, 34
797 ; CHECK-AIX-NEXT: rldicl 3, 3, 40, 56
798 ; CHECK-AIX-NEXT: blr
800 %vecext = extractelement <16 x i8> %vuc, i32 4
806 ; Function Attrs: norecurse nounwind readnone
807 define zeroext i8 @getuc5(<16 x i8> %vuc) {
808 ; CHECK-LABEL: getuc5:
809 ; CHECK: # %bb.0: # %entry
810 ; CHECK-NEXT: mfvsrd r3, v2
811 ; CHECK-NEXT: rldicl r3, r3, 48, 56
814 ; CHECK-LE-LABEL: getuc5:
815 ; CHECK-LE: # %bb.0: # %entry
816 ; CHECK-LE-NEXT: xxswapd vs0, v2
817 ; CHECK-LE-NEXT: mffprd r3, f0
818 ; CHECK-LE-NEXT: rldicl r3, r3, 24, 56
821 ; CHECK-AIX-LABEL: getuc5:
822 ; CHECK-AIX: # %bb.0: # %entry
823 ; CHECK-AIX-NEXT: mfvsrd 3, 34
824 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 56
825 ; CHECK-AIX-NEXT: blr
827 %vecext = extractelement <16 x i8> %vuc, i32 5
833 ; Function Attrs: norecurse nounwind readnone
834 define zeroext i8 @getuc6(<16 x i8> %vuc) {
835 ; CHECK-LABEL: getuc6:
836 ; CHECK: # %bb.0: # %entry
837 ; CHECK-NEXT: mfvsrd r3, v2
838 ; CHECK-NEXT: rldicl r3, r3, 56, 56
841 ; CHECK-LE-LABEL: getuc6:
842 ; CHECK-LE: # %bb.0: # %entry
843 ; CHECK-LE-NEXT: xxswapd vs0, v2
844 ; CHECK-LE-NEXT: mffprd r3, f0
845 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 56
848 ; CHECK-AIX-LABEL: getuc6:
849 ; CHECK-AIX: # %bb.0: # %entry
850 ; CHECK-AIX-NEXT: mfvsrd 3, 34
851 ; CHECK-AIX-NEXT: rldicl 3, 3, 56, 56
852 ; CHECK-AIX-NEXT: blr
854 %vecext = extractelement <16 x i8> %vuc, i32 6
860 ; Function Attrs: norecurse nounwind readnone
861 define zeroext i8 @getuc7(<16 x i8> %vuc) {
862 ; CHECK-LABEL: getuc7:
863 ; CHECK: # %bb.0: # %entry
864 ; CHECK-NEXT: mfvsrd r3, v2
865 ; CHECK-NEXT: clrldi r3, r3, 56
868 ; CHECK-LE-LABEL: getuc7:
869 ; CHECK-LE: # %bb.0: # %entry
870 ; CHECK-LE-NEXT: xxswapd vs0, v2
871 ; CHECK-LE-NEXT: mffprd r3, f0
872 ; CHECK-LE-NEXT: rldicl r3, r3, 8, 56
875 ; CHECK-AIX-LABEL: getuc7:
876 ; CHECK-AIX: # %bb.0: # %entry
877 ; CHECK-AIX-NEXT: mfvsrd 3, 34
878 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
879 ; CHECK-AIX-NEXT: blr
881 %vecext = extractelement <16 x i8> %vuc, i32 7
887 ; Function Attrs: norecurse nounwind readnone
888 define zeroext i8 @getuc8(<16 x i8> %vuc) {
889 ; CHECK-LABEL: getuc8:
890 ; CHECK: # %bb.0: # %entry
891 ; CHECK-NEXT: xxswapd vs0, v2
892 ; CHECK-NEXT: mffprd r3, f0
893 ; CHECK-NEXT: rldicl r3, r3, 8, 56
896 ; CHECK-LE-LABEL: getuc8:
897 ; CHECK-LE: # %bb.0: # %entry
898 ; CHECK-LE-NEXT: mfvsrd r3, v2
899 ; CHECK-LE-NEXT: clrldi r3, r3, 56
902 ; CHECK-AIX-LABEL: getuc8:
903 ; CHECK-AIX: # %bb.0: # %entry
904 ; CHECK-AIX-NEXT: xxswapd 0, 34
905 ; CHECK-AIX-NEXT: mffprd 3, 0
906 ; CHECK-AIX-NEXT: rldicl 3, 3, 8, 56
907 ; CHECK-AIX-NEXT: blr
909 %vecext = extractelement <16 x i8> %vuc, i32 8
915 ; Function Attrs: norecurse nounwind readnone
916 define zeroext i8 @getuc9(<16 x i8> %vuc) {
917 ; CHECK-LABEL: getuc9:
918 ; CHECK: # %bb.0: # %entry
919 ; CHECK-NEXT: xxswapd vs0, v2
920 ; CHECK-NEXT: mffprd r3, f0
921 ; CHECK-NEXT: rldicl r3, r3, 16, 56
924 ; CHECK-LE-LABEL: getuc9:
925 ; CHECK-LE: # %bb.0: # %entry
926 ; CHECK-LE-NEXT: mfvsrd r3, v2
927 ; CHECK-LE-NEXT: rldicl r3, r3, 56, 56
930 ; CHECK-AIX-LABEL: getuc9:
931 ; CHECK-AIX: # %bb.0: # %entry
932 ; CHECK-AIX-NEXT: xxswapd 0, 34
933 ; CHECK-AIX-NEXT: mffprd 3, 0
934 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 56
935 ; CHECK-AIX-NEXT: blr
937 %vecext = extractelement <16 x i8> %vuc, i32 9
943 ; Function Attrs: norecurse nounwind readnone
944 define zeroext i8 @getuc10(<16 x i8> %vuc) {
945 ; CHECK-LABEL: getuc10:
946 ; CHECK: # %bb.0: # %entry
947 ; CHECK-NEXT: xxswapd vs0, v2
948 ; CHECK-NEXT: mffprd r3, f0
949 ; CHECK-NEXT: rldicl r3, r3, 24, 56
952 ; CHECK-LE-LABEL: getuc10:
953 ; CHECK-LE: # %bb.0: # %entry
954 ; CHECK-LE-NEXT: mfvsrd r3, v2
955 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 56
958 ; CHECK-AIX-LABEL: getuc10:
959 ; CHECK-AIX: # %bb.0: # %entry
960 ; CHECK-AIX-NEXT: xxswapd 0, 34
961 ; CHECK-AIX-NEXT: mffprd 3, 0
962 ; CHECK-AIX-NEXT: rldicl 3, 3, 24, 56
963 ; CHECK-AIX-NEXT: blr
965 %vecext = extractelement <16 x i8> %vuc, i32 10
971 ; Function Attrs: norecurse nounwind readnone
972 define zeroext i8 @getuc11(<16 x i8> %vuc) {
973 ; CHECK-LABEL: getuc11:
974 ; CHECK: # %bb.0: # %entry
975 ; CHECK-NEXT: xxswapd vs0, v2
976 ; CHECK-NEXT: mffprd r3, f0
977 ; CHECK-NEXT: rldicl r3, r3, 32, 56
980 ; CHECK-LE-LABEL: getuc11:
981 ; CHECK-LE: # %bb.0: # %entry
982 ; CHECK-LE-NEXT: mfvsrd r3, v2
983 ; CHECK-LE-NEXT: rldicl r3, r3, 40, 56
986 ; CHECK-AIX-LABEL: getuc11:
987 ; CHECK-AIX: # %bb.0: # %entry
988 ; CHECK-AIX-NEXT: xxswapd 0, 34
989 ; CHECK-AIX-NEXT: mffprd 3, 0
990 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 56
991 ; CHECK-AIX-NEXT: blr
993 %vecext = extractelement <16 x i8> %vuc, i32 11
999 ; Function Attrs: norecurse nounwind readnone
1000 define zeroext i8 @getuc12(<16 x i8> %vuc) {
1001 ; CHECK-LABEL: getuc12:
1002 ; CHECK: # %bb.0: # %entry
1003 ; CHECK-NEXT: xxswapd vs0, v2
1004 ; CHECK-NEXT: mffprd r3, f0
1005 ; CHECK-NEXT: rldicl r3, r3, 40, 56
1008 ; CHECK-LE-LABEL: getuc12:
1009 ; CHECK-LE: # %bb.0: # %entry
1010 ; CHECK-LE-NEXT: mfvsrd r3, v2
1011 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 56
1012 ; CHECK-LE-NEXT: blr
1014 ; CHECK-AIX-LABEL: getuc12:
1015 ; CHECK-AIX: # %bb.0: # %entry
1016 ; CHECK-AIX-NEXT: xxswapd 0, 34
1017 ; CHECK-AIX-NEXT: mffprd 3, 0
1018 ; CHECK-AIX-NEXT: rldicl 3, 3, 40, 56
1019 ; CHECK-AIX-NEXT: blr
1021 %vecext = extractelement <16 x i8> %vuc, i32 12
1027 ; Function Attrs: norecurse nounwind readnone
1028 define zeroext i8 @getuc13(<16 x i8> %vuc) {
1029 ; CHECK-LABEL: getuc13:
1030 ; CHECK: # %bb.0: # %entry
1031 ; CHECK-NEXT: xxswapd vs0, v2
1032 ; CHECK-NEXT: mffprd r3, f0
1033 ; CHECK-NEXT: rldicl r3, r3, 48, 56
1036 ; CHECK-LE-LABEL: getuc13:
1037 ; CHECK-LE: # %bb.0: # %entry
1038 ; CHECK-LE-NEXT: mfvsrd r3, v2
1039 ; CHECK-LE-NEXT: rldicl r3, r3, 24, 56
1040 ; CHECK-LE-NEXT: blr
1042 ; CHECK-AIX-LABEL: getuc13:
1043 ; CHECK-AIX: # %bb.0: # %entry
1044 ; CHECK-AIX-NEXT: xxswapd 0, 34
1045 ; CHECK-AIX-NEXT: mffprd 3, 0
1046 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 56
1047 ; CHECK-AIX-NEXT: blr
1049 %vecext = extractelement <16 x i8> %vuc, i32 13
1055 ; Function Attrs: norecurse nounwind readnone
1056 define zeroext i8 @getuc14(<16 x i8> %vuc) {
1057 ; CHECK-LABEL: getuc14:
1058 ; CHECK: # %bb.0: # %entry
1059 ; CHECK-NEXT: xxswapd vs0, v2
1060 ; CHECK-NEXT: mffprd r3, f0
1061 ; CHECK-NEXT: rldicl r3, r3, 56, 56
1064 ; CHECK-LE-LABEL: getuc14:
1065 ; CHECK-LE: # %bb.0: # %entry
1066 ; CHECK-LE-NEXT: mfvsrd r3, v2
1067 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 56
1068 ; CHECK-LE-NEXT: blr
1070 ; CHECK-AIX-LABEL: getuc14:
1071 ; CHECK-AIX: # %bb.0: # %entry
1072 ; CHECK-AIX-NEXT: xxswapd 0, 34
1073 ; CHECK-AIX-NEXT: mffprd 3, 0
1074 ; CHECK-AIX-NEXT: rldicl 3, 3, 56, 56
1075 ; CHECK-AIX-NEXT: blr
1077 %vecext = extractelement <16 x i8> %vuc, i32 14
1083 ; Function Attrs: norecurse nounwind readnone
1084 define zeroext i8 @getuc15(<16 x i8> %vuc) {
1085 ; CHECK-LABEL: getuc15:
1086 ; CHECK: # %bb.0: # %entry
1087 ; CHECK-NEXT: xxswapd vs0, v2
1088 ; CHECK-NEXT: mffprd r3, f0
1089 ; CHECK-NEXT: clrldi r3, r3, 56
1092 ; CHECK-LE-LABEL: getuc15:
1093 ; CHECK-LE: # %bb.0: # %entry
1094 ; CHECK-LE-NEXT: mfvsrd r3, v2
1095 ; CHECK-LE-NEXT: rldicl r3, r3, 8, 56
1096 ; CHECK-LE-NEXT: blr
1098 ; CHECK-AIX-LABEL: getuc15:
1099 ; CHECK-AIX: # %bb.0: # %entry
1100 ; CHECK-AIX-NEXT: xxswapd 0, 34
1101 ; CHECK-AIX-NEXT: mffprd 3, 0
1102 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1103 ; CHECK-AIX-NEXT: blr
1105 %vecext = extractelement <16 x i8> %vuc, i32 15
1111 ; Function Attrs: norecurse nounwind readnone
1112 define signext i8 @getvelsc(<16 x i8> %vsc, i32 signext %i) {
1113 ; CHECK-LABEL: getvelsc:
1114 ; CHECK: # %bb.0: # %entry
1115 ; CHECK-NEXT: clrldi r3, r5, 32
1116 ; CHECK-NEXT: andi. r4, r3, 8
1117 ; CHECK-NEXT: lvsl v3, 0, r4
1118 ; CHECK-NEXT: li r4, 7
1119 ; CHECK-NEXT: andc r3, r4, r3
1120 ; CHECK-NEXT: sldi r3, r3, 3
1121 ; CHECK-NEXT: vperm v2, v2, v2, v3
1122 ; CHECK-NEXT: mfvsrd r4, v2
1123 ; CHECK-NEXT: srd r3, r4, r3
1124 ; CHECK-NEXT: extsb r3, r3
1127 ; CHECK-LE-LABEL: getvelsc:
1128 ; CHECK-LE: # %bb.0: # %entry
1129 ; CHECK-LE-NEXT: clrldi r3, r5, 32
1130 ; CHECK-LE-NEXT: li r4, 8
1131 ; CHECK-LE-NEXT: andc r4, r4, r3
1132 ; CHECK-LE-NEXT: lvsl v3, 0, r4
1133 ; CHECK-LE-NEXT: li r4, 7
1134 ; CHECK-LE-NEXT: and r3, r4, r3
1135 ; CHECK-LE-NEXT: sldi r3, r3, 3
1136 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1137 ; CHECK-LE-NEXT: mfvsrd r4, v2
1138 ; CHECK-LE-NEXT: srd r3, r4, r3
1139 ; CHECK-LE-NEXT: extsb r3, r3
1140 ; CHECK-LE-NEXT: blr
1142 ; CHECK-AIX-LABEL: getvelsc:
1143 ; CHECK-AIX: # %bb.0: # %entry
1144 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
1145 ; CHECK-AIX-NEXT: andi. 4, 3, 8
1146 ; CHECK-AIX-NEXT: lvsl 3, 0, 4
1147 ; CHECK-AIX-NEXT: li 4, 7
1148 ; CHECK-AIX-NEXT: andc 3, 4, 3
1149 ; CHECK-AIX-NEXT: sldi 3, 3, 3
1150 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1151 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1152 ; CHECK-AIX-NEXT: srd 3, 4, 3
1153 ; CHECK-AIX-NEXT: extsb 3, 3
1154 ; CHECK-AIX-NEXT: blr
1158 %vecext = extractelement <16 x i8> %vsc, i32 %i
1162 ; Function Attrs: norecurse nounwind readnone
1163 define zeroext i8 @getveluc(<16 x i8> %vuc, i32 signext %i) {
1164 ; CHECK-LABEL: getveluc:
1165 ; CHECK: # %bb.0: # %entry
1166 ; CHECK-NEXT: clrldi r3, r5, 32
1167 ; CHECK-NEXT: andi. r4, r3, 8
1168 ; CHECK-NEXT: lvsl v3, 0, r4
1169 ; CHECK-NEXT: li r4, 7
1170 ; CHECK-NEXT: andc r3, r4, r3
1171 ; CHECK-NEXT: sldi r3, r3, 3
1172 ; CHECK-NEXT: vperm v2, v2, v2, v3
1173 ; CHECK-NEXT: mfvsrd r4, v2
1174 ; CHECK-NEXT: srd r3, r4, r3
1175 ; CHECK-NEXT: clrldi r3, r3, 56
1178 ; CHECK-LE-LABEL: getveluc:
1179 ; CHECK-LE: # %bb.0: # %entry
1180 ; CHECK-LE-NEXT: clrldi r3, r5, 32
1181 ; CHECK-LE-NEXT: li r4, 8
1182 ; CHECK-LE-NEXT: andc r4, r4, r3
1183 ; CHECK-LE-NEXT: lvsl v3, 0, r4
1184 ; CHECK-LE-NEXT: li r4, 7
1185 ; CHECK-LE-NEXT: and r3, r4, r3
1186 ; CHECK-LE-NEXT: sldi r3, r3, 3
1187 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1188 ; CHECK-LE-NEXT: mfvsrd r4, v2
1189 ; CHECK-LE-NEXT: srd r3, r4, r3
1190 ; CHECK-LE-NEXT: clrldi r3, r3, 56
1191 ; CHECK-LE-NEXT: blr
1193 ; CHECK-AIX-LABEL: getveluc:
1194 ; CHECK-AIX: # %bb.0: # %entry
1195 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
1196 ; CHECK-AIX-NEXT: andi. 4, 3, 8
1197 ; CHECK-AIX-NEXT: lvsl 3, 0, 4
1198 ; CHECK-AIX-NEXT: li 4, 7
1199 ; CHECK-AIX-NEXT: andc 3, 4, 3
1200 ; CHECK-AIX-NEXT: sldi 3, 3, 3
1201 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1202 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1203 ; CHECK-AIX-NEXT: srd 3, 4, 3
1204 ; CHECK-AIX-NEXT: clrldi 3, 3, 56
1205 ; CHECK-AIX-NEXT: blr
1209 %vecext = extractelement <16 x i8> %vuc, i32 %i
1213 ; Function Attrs: norecurse nounwind readnone
1214 define signext i16 @getss0(<8 x i16> %vss) {
1215 ; CHECK-LABEL: getss0:
1216 ; CHECK: # %bb.0: # %entry
1217 ; CHECK-NEXT: mfvsrd r3, v2
1218 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1219 ; CHECK-NEXT: extsh r3, r3
1222 ; CHECK-LE-LABEL: getss0:
1223 ; CHECK-LE: # %bb.0: # %entry
1224 ; CHECK-LE-NEXT: xxswapd vs0, v2
1225 ; CHECK-LE-NEXT: mffprd r3, f0
1226 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1227 ; CHECK-LE-NEXT: extsh r3, r3
1228 ; CHECK-LE-NEXT: blr
1230 ; CHECK-AIX-LABEL: getss0:
1231 ; CHECK-AIX: # %bb.0: # %entry
1232 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1233 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1234 ; CHECK-AIX-NEXT: extsh 3, 3
1235 ; CHECK-AIX-NEXT: blr
1237 %vecext = extractelement <8 x i16> %vss, i32 0
1243 ; Function Attrs: norecurse nounwind readnone
1244 define signext i16 @getss1(<8 x i16> %vss) {
1245 ; CHECK-LABEL: getss1:
1246 ; CHECK: # %bb.0: # %entry
1247 ; CHECK-NEXT: mfvsrd r3, v2
1248 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1249 ; CHECK-NEXT: extsh r3, r3
1252 ; CHECK-LE-LABEL: getss1:
1253 ; CHECK-LE: # %bb.0: # %entry
1254 ; CHECK-LE-NEXT: xxswapd vs0, v2
1255 ; CHECK-LE-NEXT: mffprd r3, f0
1256 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1257 ; CHECK-LE-NEXT: extsh r3, r3
1258 ; CHECK-LE-NEXT: blr
1260 ; CHECK-AIX-LABEL: getss1:
1261 ; CHECK-AIX: # %bb.0: # %entry
1262 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1263 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1264 ; CHECK-AIX-NEXT: extsh 3, 3
1265 ; CHECK-AIX-NEXT: blr
1267 %vecext = extractelement <8 x i16> %vss, i32 1
1273 ; Function Attrs: norecurse nounwind readnone
1274 define signext i16 @getss2(<8 x i16> %vss) {
1275 ; CHECK-LABEL: getss2:
1276 ; CHECK: # %bb.0: # %entry
1277 ; CHECK-NEXT: mfvsrd r3, v2
1278 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1279 ; CHECK-NEXT: extsh r3, r3
1282 ; CHECK-LE-LABEL: getss2:
1283 ; CHECK-LE: # %bb.0: # %entry
1284 ; CHECK-LE-NEXT: xxswapd vs0, v2
1285 ; CHECK-LE-NEXT: mffprd r3, f0
1286 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1287 ; CHECK-LE-NEXT: extsh r3, r3
1288 ; CHECK-LE-NEXT: blr
1290 ; CHECK-AIX-LABEL: getss2:
1291 ; CHECK-AIX: # %bb.0: # %entry
1292 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1293 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1294 ; CHECK-AIX-NEXT: extsh 3, 3
1295 ; CHECK-AIX-NEXT: blr
1297 %vecext = extractelement <8 x i16> %vss, i32 2
1303 ; Function Attrs: norecurse nounwind readnone
1304 define signext i16 @getss3(<8 x i16> %vss) {
1305 ; CHECK-LABEL: getss3:
1306 ; CHECK: # %bb.0: # %entry
1307 ; CHECK-NEXT: mfvsrd r3, v2
1308 ; CHECK-NEXT: clrldi r3, r3, 48
1309 ; CHECK-NEXT: extsh r3, r3
1312 ; CHECK-LE-LABEL: getss3:
1313 ; CHECK-LE: # %bb.0: # %entry
1314 ; CHECK-LE-NEXT: xxswapd vs0, v2
1315 ; CHECK-LE-NEXT: mffprd r3, f0
1316 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1317 ; CHECK-LE-NEXT: extsh r3, r3
1318 ; CHECK-LE-NEXT: blr
1320 ; CHECK-AIX-LABEL: getss3:
1321 ; CHECK-AIX: # %bb.0: # %entry
1322 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1323 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1324 ; CHECK-AIX-NEXT: extsh 3, 3
1325 ; CHECK-AIX-NEXT: blr
1327 %vecext = extractelement <8 x i16> %vss, i32 3
1333 ; Function Attrs: norecurse nounwind readnone
1334 define signext i16 @getss4(<8 x i16> %vss) {
1335 ; CHECK-LABEL: getss4:
1336 ; CHECK: # %bb.0: # %entry
1337 ; CHECK-NEXT: xxswapd vs0, v2
1338 ; CHECK-NEXT: mffprd r3, f0
1339 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1340 ; CHECK-NEXT: extsh r3, r3
1343 ; CHECK-LE-LABEL: getss4:
1344 ; CHECK-LE: # %bb.0: # %entry
1345 ; CHECK-LE-NEXT: mfvsrd r3, v2
1346 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1347 ; CHECK-LE-NEXT: extsh r3, r3
1348 ; CHECK-LE-NEXT: blr
1350 ; CHECK-AIX-LABEL: getss4:
1351 ; CHECK-AIX: # %bb.0: # %entry
1352 ; CHECK-AIX-NEXT: xxswapd 0, 34
1353 ; CHECK-AIX-NEXT: mffprd 3, 0
1354 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1355 ; CHECK-AIX-NEXT: extsh 3, 3
1356 ; CHECK-AIX-NEXT: blr
1358 %vecext = extractelement <8 x i16> %vss, i32 4
1364 ; Function Attrs: norecurse nounwind readnone
1365 define signext i16 @getss5(<8 x i16> %vss) {
1366 ; CHECK-LABEL: getss5:
1367 ; CHECK: # %bb.0: # %entry
1368 ; CHECK-NEXT: xxswapd vs0, v2
1369 ; CHECK-NEXT: mffprd r3, f0
1370 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1371 ; CHECK-NEXT: extsh r3, r3
1374 ; CHECK-LE-LABEL: getss5:
1375 ; CHECK-LE: # %bb.0: # %entry
1376 ; CHECK-LE-NEXT: mfvsrd r3, v2
1377 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1378 ; CHECK-LE-NEXT: extsh r3, r3
1379 ; CHECK-LE-NEXT: blr
1381 ; CHECK-AIX-LABEL: getss5:
1382 ; CHECK-AIX: # %bb.0: # %entry
1383 ; CHECK-AIX-NEXT: xxswapd 0, 34
1384 ; CHECK-AIX-NEXT: mffprd 3, 0
1385 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1386 ; CHECK-AIX-NEXT: extsh 3, 3
1387 ; CHECK-AIX-NEXT: blr
1389 %vecext = extractelement <8 x i16> %vss, i32 5
1395 ; Function Attrs: norecurse nounwind readnone
1396 define signext i16 @getss6(<8 x i16> %vss) {
1397 ; CHECK-LABEL: getss6:
1398 ; CHECK: # %bb.0: # %entry
1399 ; CHECK-NEXT: xxswapd vs0, v2
1400 ; CHECK-NEXT: mffprd r3, f0
1401 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1402 ; CHECK-NEXT: extsh r3, r3
1405 ; CHECK-LE-LABEL: getss6:
1406 ; CHECK-LE: # %bb.0: # %entry
1407 ; CHECK-LE-NEXT: mfvsrd r3, v2
1408 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1409 ; CHECK-LE-NEXT: extsh r3, r3
1410 ; CHECK-LE-NEXT: blr
1412 ; CHECK-AIX-LABEL: getss6:
1413 ; CHECK-AIX: # %bb.0: # %entry
1414 ; CHECK-AIX-NEXT: xxswapd 0, 34
1415 ; CHECK-AIX-NEXT: mffprd 3, 0
1416 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1417 ; CHECK-AIX-NEXT: extsh 3, 3
1418 ; CHECK-AIX-NEXT: blr
1420 %vecext = extractelement <8 x i16> %vss, i32 6
1426 ; Function Attrs: norecurse nounwind readnone
1427 define signext i16 @getss7(<8 x i16> %vss) {
1428 ; CHECK-LABEL: getss7:
1429 ; CHECK: # %bb.0: # %entry
1430 ; CHECK-NEXT: xxswapd vs0, v2
1431 ; CHECK-NEXT: mffprd r3, f0
1432 ; CHECK-NEXT: clrldi r3, r3, 48
1433 ; CHECK-NEXT: extsh r3, r3
1436 ; CHECK-LE-LABEL: getss7:
1437 ; CHECK-LE: # %bb.0: # %entry
1438 ; CHECK-LE-NEXT: mfvsrd r3, v2
1439 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1440 ; CHECK-LE-NEXT: extsh r3, r3
1441 ; CHECK-LE-NEXT: blr
1443 ; CHECK-AIX-LABEL: getss7:
1444 ; CHECK-AIX: # %bb.0: # %entry
1445 ; CHECK-AIX-NEXT: xxswapd 0, 34
1446 ; CHECK-AIX-NEXT: mffprd 3, 0
1447 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1448 ; CHECK-AIX-NEXT: extsh 3, 3
1449 ; CHECK-AIX-NEXT: blr
1451 %vecext = extractelement <8 x i16> %vss, i32 7
1457 ; Function Attrs: norecurse nounwind readnone
1458 define zeroext i16 @getus0(<8 x i16> %vus) {
1459 ; CHECK-LABEL: getus0:
1460 ; CHECK: # %bb.0: # %entry
1461 ; CHECK-NEXT: mfvsrd r3, v2
1462 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1465 ; CHECK-LE-LABEL: getus0:
1466 ; CHECK-LE: # %bb.0: # %entry
1467 ; CHECK-LE-NEXT: xxswapd vs0, v2
1468 ; CHECK-LE-NEXT: mffprd r3, f0
1469 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1470 ; CHECK-LE-NEXT: blr
1472 ; CHECK-AIX-LABEL: getus0:
1473 ; CHECK-AIX: # %bb.0: # %entry
1474 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1475 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1476 ; CHECK-AIX-NEXT: blr
1478 %vecext = extractelement <8 x i16> %vus, i32 0
1484 ; Function Attrs: norecurse nounwind readnone
1485 define zeroext i16 @getus1(<8 x i16> %vus) {
1486 ; CHECK-LABEL: getus1:
1487 ; CHECK: # %bb.0: # %entry
1488 ; CHECK-NEXT: mfvsrd r3, v2
1489 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1492 ; CHECK-LE-LABEL: getus1:
1493 ; CHECK-LE: # %bb.0: # %entry
1494 ; CHECK-LE-NEXT: xxswapd vs0, v2
1495 ; CHECK-LE-NEXT: mffprd r3, f0
1496 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1497 ; CHECK-LE-NEXT: blr
1499 ; CHECK-AIX-LABEL: getus1:
1500 ; CHECK-AIX: # %bb.0: # %entry
1501 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1502 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1503 ; CHECK-AIX-NEXT: blr
1505 %vecext = extractelement <8 x i16> %vus, i32 1
1511 ; Function Attrs: norecurse nounwind readnone
1512 define zeroext i16 @getus2(<8 x i16> %vus) {
1513 ; CHECK-LABEL: getus2:
1514 ; CHECK: # %bb.0: # %entry
1515 ; CHECK-NEXT: mfvsrd r3, v2
1516 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1519 ; CHECK-LE-LABEL: getus2:
1520 ; CHECK-LE: # %bb.0: # %entry
1521 ; CHECK-LE-NEXT: xxswapd vs0, v2
1522 ; CHECK-LE-NEXT: mffprd r3, f0
1523 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1524 ; CHECK-LE-NEXT: blr
1526 ; CHECK-AIX-LABEL: getus2:
1527 ; CHECK-AIX: # %bb.0: # %entry
1528 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1529 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1530 ; CHECK-AIX-NEXT: blr
1532 %vecext = extractelement <8 x i16> %vus, i32 2
1538 ; Function Attrs: norecurse nounwind readnone
1539 define zeroext i16 @getus3(<8 x i16> %vus) {
1540 ; CHECK-LABEL: getus3:
1541 ; CHECK: # %bb.0: # %entry
1542 ; CHECK-NEXT: mfvsrd r3, v2
1543 ; CHECK-NEXT: clrldi r3, r3, 48
1546 ; CHECK-LE-LABEL: getus3:
1547 ; CHECK-LE: # %bb.0: # %entry
1548 ; CHECK-LE-NEXT: xxswapd vs0, v2
1549 ; CHECK-LE-NEXT: mffprd r3, f0
1550 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1551 ; CHECK-LE-NEXT: blr
1553 ; CHECK-AIX-LABEL: getus3:
1554 ; CHECK-AIX: # %bb.0: # %entry
1555 ; CHECK-AIX-NEXT: mfvsrd 3, 34
1556 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1557 ; CHECK-AIX-NEXT: blr
1559 %vecext = extractelement <8 x i16> %vus, i32 3
1565 ; Function Attrs: norecurse nounwind readnone
1566 define zeroext i16 @getus4(<8 x i16> %vus) {
1567 ; CHECK-LABEL: getus4:
1568 ; CHECK: # %bb.0: # %entry
1569 ; CHECK-NEXT: xxswapd vs0, v2
1570 ; CHECK-NEXT: mffprd r3, f0
1571 ; CHECK-NEXT: rldicl r3, r3, 16, 48
1574 ; CHECK-LE-LABEL: getus4:
1575 ; CHECK-LE: # %bb.0: # %entry
1576 ; CHECK-LE-NEXT: mfvsrd r3, v2
1577 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1578 ; CHECK-LE-NEXT: blr
1580 ; CHECK-AIX-LABEL: getus4:
1581 ; CHECK-AIX: # %bb.0: # %entry
1582 ; CHECK-AIX-NEXT: xxswapd 0, 34
1583 ; CHECK-AIX-NEXT: mffprd 3, 0
1584 ; CHECK-AIX-NEXT: rldicl 3, 3, 16, 48
1585 ; CHECK-AIX-NEXT: blr
1587 %vecext = extractelement <8 x i16> %vus, i32 4
1593 ; Function Attrs: norecurse nounwind readnone
1594 define zeroext i16 @getus5(<8 x i16> %vus) {
1595 ; CHECK-LABEL: getus5:
1596 ; CHECK: # %bb.0: # %entry
1597 ; CHECK-NEXT: xxswapd vs0, v2
1598 ; CHECK-NEXT: mffprd r3, f0
1599 ; CHECK-NEXT: rldicl r3, r3, 32, 48
1602 ; CHECK-LE-LABEL: getus5:
1603 ; CHECK-LE: # %bb.0: # %entry
1604 ; CHECK-LE-NEXT: mfvsrd r3, v2
1605 ; CHECK-LE-NEXT: rldicl r3, r3, 48, 48
1606 ; CHECK-LE-NEXT: blr
1608 ; CHECK-AIX-LABEL: getus5:
1609 ; CHECK-AIX: # %bb.0: # %entry
1610 ; CHECK-AIX-NEXT: xxswapd 0, 34
1611 ; CHECK-AIX-NEXT: mffprd 3, 0
1612 ; CHECK-AIX-NEXT: rldicl 3, 3, 32, 48
1613 ; CHECK-AIX-NEXT: blr
1615 %vecext = extractelement <8 x i16> %vus, i32 5
1621 ; Function Attrs: norecurse nounwind readnone
1622 define zeroext i16 @getus6(<8 x i16> %vus) {
1623 ; CHECK-LABEL: getus6:
1624 ; CHECK: # %bb.0: # %entry
1625 ; CHECK-NEXT: xxswapd vs0, v2
1626 ; CHECK-NEXT: mffprd r3, f0
1627 ; CHECK-NEXT: rldicl r3, r3, 48, 48
1630 ; CHECK-LE-LABEL: getus6:
1631 ; CHECK-LE: # %bb.0: # %entry
1632 ; CHECK-LE-NEXT: mfvsrd r3, v2
1633 ; CHECK-LE-NEXT: rldicl r3, r3, 32, 48
1634 ; CHECK-LE-NEXT: blr
1636 ; CHECK-AIX-LABEL: getus6:
1637 ; CHECK-AIX: # %bb.0: # %entry
1638 ; CHECK-AIX-NEXT: xxswapd 0, 34
1639 ; CHECK-AIX-NEXT: mffprd 3, 0
1640 ; CHECK-AIX-NEXT: rldicl 3, 3, 48, 48
1641 ; CHECK-AIX-NEXT: blr
1643 %vecext = extractelement <8 x i16> %vus, i32 6
1649 ; Function Attrs: norecurse nounwind readnone
1650 define zeroext i16 @getus7(<8 x i16> %vus) {
1651 ; CHECK-LABEL: getus7:
1652 ; CHECK: # %bb.0: # %entry
1653 ; CHECK-NEXT: xxswapd vs0, v2
1654 ; CHECK-NEXT: mffprd r3, f0
1655 ; CHECK-NEXT: clrldi r3, r3, 48
1658 ; CHECK-LE-LABEL: getus7:
1659 ; CHECK-LE: # %bb.0: # %entry
1660 ; CHECK-LE-NEXT: mfvsrd r3, v2
1661 ; CHECK-LE-NEXT: rldicl r3, r3, 16, 48
1662 ; CHECK-LE-NEXT: blr
1664 ; CHECK-AIX-LABEL: getus7:
1665 ; CHECK-AIX: # %bb.0: # %entry
1666 ; CHECK-AIX-NEXT: xxswapd 0, 34
1667 ; CHECK-AIX-NEXT: mffprd 3, 0
1668 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1669 ; CHECK-AIX-NEXT: blr
1671 %vecext = extractelement <8 x i16> %vus, i32 7
1677 ; Function Attrs: norecurse nounwind readnone
1678 define signext i16 @getvelss(<8 x i16> %vss, i32 signext %i) {
1679 ; CHECK-LABEL: getvelss:
1680 ; CHECK: # %bb.0: # %entry
1681 ; CHECK-NEXT: clrldi r3, r5, 32
1682 ; CHECK-NEXT: andi. r4, r3, 4
1683 ; CHECK-NEXT: sldi r4, r4, 1
1684 ; CHECK-NEXT: lvsl v3, 0, r4
1685 ; CHECK-NEXT: li r4, 3
1686 ; CHECK-NEXT: andc r3, r4, r3
1687 ; CHECK-NEXT: sldi r3, r3, 4
1688 ; CHECK-NEXT: vperm v2, v2, v2, v3
1689 ; CHECK-NEXT: mfvsrd r4, v2
1690 ; CHECK-NEXT: srd r3, r4, r3
1691 ; CHECK-NEXT: extsh r3, r3
1694 ; CHECK-LE-LABEL: getvelss:
1695 ; CHECK-LE: # %bb.0: # %entry
1696 ; CHECK-LE-NEXT: clrldi r3, r5, 32
1697 ; CHECK-LE-NEXT: li r4, 4
1698 ; CHECK-LE-NEXT: andc r4, r4, r3
1699 ; CHECK-LE-NEXT: sldi r4, r4, 1
1700 ; CHECK-LE-NEXT: lvsl v3, 0, r4
1701 ; CHECK-LE-NEXT: li r4, 3
1702 ; CHECK-LE-NEXT: and r3, r4, r3
1703 ; CHECK-LE-NEXT: sldi r3, r3, 4
1704 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1705 ; CHECK-LE-NEXT: mfvsrd r4, v2
1706 ; CHECK-LE-NEXT: srd r3, r4, r3
1707 ; CHECK-LE-NEXT: extsh r3, r3
1708 ; CHECK-LE-NEXT: blr
1710 ; CHECK-AIX-LABEL: getvelss:
1711 ; CHECK-AIX: # %bb.0: # %entry
1712 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
1713 ; CHECK-AIX-NEXT: andi. 4, 3, 4
1714 ; CHECK-AIX-NEXT: sldi 4, 4, 1
1715 ; CHECK-AIX-NEXT: lvsl 3, 0, 4
1716 ; CHECK-AIX-NEXT: li 4, 3
1717 ; CHECK-AIX-NEXT: andc 3, 4, 3
1718 ; CHECK-AIX-NEXT: sldi 3, 3, 4
1719 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1720 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1721 ; CHECK-AIX-NEXT: srd 3, 4, 3
1722 ; CHECK-AIX-NEXT: extsh 3, 3
1723 ; CHECK-AIX-NEXT: blr
1727 %vecext = extractelement <8 x i16> %vss, i32 %i
1731 ; Function Attrs: norecurse nounwind readnone
1732 define zeroext i16 @getvelus(<8 x i16> %vus, i32 signext %i) {
1733 ; CHECK-LABEL: getvelus:
1734 ; CHECK: # %bb.0: # %entry
1735 ; CHECK-NEXT: clrldi r3, r5, 32
1736 ; CHECK-NEXT: andi. r4, r3, 4
1737 ; CHECK-NEXT: sldi r4, r4, 1
1738 ; CHECK-NEXT: lvsl v3, 0, r4
1739 ; CHECK-NEXT: li r4, 3
1740 ; CHECK-NEXT: andc r3, r4, r3
1741 ; CHECK-NEXT: sldi r3, r3, 4
1742 ; CHECK-NEXT: vperm v2, v2, v2, v3
1743 ; CHECK-NEXT: mfvsrd r4, v2
1744 ; CHECK-NEXT: srd r3, r4, r3
1745 ; CHECK-NEXT: clrldi r3, r3, 48
1748 ; CHECK-LE-LABEL: getvelus:
1749 ; CHECK-LE: # %bb.0: # %entry
1750 ; CHECK-LE-NEXT: clrldi r3, r5, 32
1751 ; CHECK-LE-NEXT: li r4, 4
1752 ; CHECK-LE-NEXT: andc r4, r4, r3
1753 ; CHECK-LE-NEXT: sldi r4, r4, 1
1754 ; CHECK-LE-NEXT: lvsl v3, 0, r4
1755 ; CHECK-LE-NEXT: li r4, 3
1756 ; CHECK-LE-NEXT: and r3, r4, r3
1757 ; CHECK-LE-NEXT: sldi r3, r3, 4
1758 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
1759 ; CHECK-LE-NEXT: mfvsrd r4, v2
1760 ; CHECK-LE-NEXT: srd r3, r4, r3
1761 ; CHECK-LE-NEXT: clrldi r3, r3, 48
1762 ; CHECK-LE-NEXT: blr
1764 ; CHECK-AIX-LABEL: getvelus:
1765 ; CHECK-AIX: # %bb.0: # %entry
1766 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
1767 ; CHECK-AIX-NEXT: andi. 4, 3, 4
1768 ; CHECK-AIX-NEXT: sldi 4, 4, 1
1769 ; CHECK-AIX-NEXT: lvsl 3, 0, 4
1770 ; CHECK-AIX-NEXT: li 4, 3
1771 ; CHECK-AIX-NEXT: andc 3, 4, 3
1772 ; CHECK-AIX-NEXT: sldi 3, 3, 4
1773 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
1774 ; CHECK-AIX-NEXT: mfvsrd 4, 34
1775 ; CHECK-AIX-NEXT: srd 3, 4, 3
1776 ; CHECK-AIX-NEXT: clrldi 3, 3, 48
1777 ; CHECK-AIX-NEXT: blr
1781 %vecext = extractelement <8 x i16> %vus, i32 %i
1785 ; Function Attrs: norecurse nounwind readnone
1786 define signext i32 @getsi0(<4 x i32> %vsi) {
1787 ; CHECK-LABEL: getsi0:
1788 ; CHECK: # %bb.0: # %entry
1789 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 3
1790 ; CHECK-NEXT: mffprwz r3, f0
1791 ; CHECK-NEXT: extsw r3, r3
1794 ; CHECK-LE-LABEL: getsi0:
1795 ; CHECK-LE: # %bb.0: # %entry
1796 ; CHECK-LE-NEXT: xxswapd vs0, v2
1797 ; CHECK-LE-NEXT: mffprwz r3, f0
1798 ; CHECK-LE-NEXT: extsw r3, r3
1799 ; CHECK-LE-NEXT: blr
1801 ; CHECK-AIX-LABEL: getsi0:
1802 ; CHECK-AIX: # %bb.0: # %entry
1803 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 3
1804 ; CHECK-AIX-NEXT: mffprwz 3, 0
1805 ; CHECK-AIX-NEXT: extsw 3, 3
1806 ; CHECK-AIX-NEXT: blr
1808 %vecext = extractelement <4 x i32> %vsi, i32 0
1814 ; Function Attrs: norecurse nounwind readnone
1815 define signext i32 @getsi1(<4 x i32> %vsi) {
1816 ; CHECK-LABEL: getsi1:
1817 ; CHECK: # %bb.0: # %entry
1818 ; CHECK-NEXT: mfvsrwz r3, v2
1819 ; CHECK-NEXT: extsw r3, r3
1822 ; CHECK-LE-LABEL: getsi1:
1823 ; CHECK-LE: # %bb.0: # %entry
1824 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 1
1825 ; CHECK-LE-NEXT: mffprwz r3, f0
1826 ; CHECK-LE-NEXT: extsw r3, r3
1827 ; CHECK-LE-NEXT: blr
1829 ; CHECK-AIX-LABEL: getsi1:
1830 ; CHECK-AIX: # %bb.0: # %entry
1831 ; CHECK-AIX-NEXT: mfvsrwz 3, 34
1832 ; CHECK-AIX-NEXT: extsw 3, 3
1833 ; CHECK-AIX-NEXT: blr
1835 %vecext = extractelement <4 x i32> %vsi, i32 1
1841 ; Function Attrs: norecurse nounwind readnone
1842 define signext i32 @getsi2(<4 x i32> %vsi) {
1843 ; CHECK-LABEL: getsi2:
1844 ; CHECK: # %bb.0: # %entry
1845 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 1
1846 ; CHECK-NEXT: mffprwz r3, f0
1847 ; CHECK-NEXT: extsw r3, r3
1850 ; CHECK-LE-LABEL: getsi2:
1851 ; CHECK-LE: # %bb.0: # %entry
1852 ; CHECK-LE-NEXT: mfvsrwz r3, v2
1853 ; CHECK-LE-NEXT: extsw r3, r3
1854 ; CHECK-LE-NEXT: blr
1856 ; CHECK-AIX-LABEL: getsi2:
1857 ; CHECK-AIX: # %bb.0: # %entry
1858 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 1
1859 ; CHECK-AIX-NEXT: mffprwz 3, 0
1860 ; CHECK-AIX-NEXT: extsw 3, 3
1861 ; CHECK-AIX-NEXT: blr
1863 %vecext = extractelement <4 x i32> %vsi, i32 2
1869 ; Function Attrs: norecurse nounwind readnone
1870 define signext i32 @getsi3(<4 x i32> %vsi) {
1871 ; CHECK-LABEL: getsi3:
1872 ; CHECK: # %bb.0: # %entry
1873 ; CHECK-NEXT: xxswapd vs0, v2
1874 ; CHECK-NEXT: mffprwz r3, f0
1875 ; CHECK-NEXT: extsw r3, r3
1878 ; CHECK-LE-LABEL: getsi3:
1879 ; CHECK-LE: # %bb.0: # %entry
1880 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
1881 ; CHECK-LE-NEXT: mffprwz r3, f0
1882 ; CHECK-LE-NEXT: extsw r3, r3
1883 ; CHECK-LE-NEXT: blr
1885 ; CHECK-AIX-LABEL: getsi3:
1886 ; CHECK-AIX: # %bb.0: # %entry
1887 ; CHECK-AIX-NEXT: xxswapd 0, 34
1888 ; CHECK-AIX-NEXT: mffprwz 3, 0
1889 ; CHECK-AIX-NEXT: extsw 3, 3
1890 ; CHECK-AIX-NEXT: blr
1892 %vecext = extractelement <4 x i32> %vsi, i32 3
1898 ; Function Attrs: norecurse nounwind readnone
1899 define zeroext i32 @getui0(<4 x i32> %vui) {
1900 ; CHECK-LABEL: getui0:
1901 ; CHECK: # %bb.0: # %entry
1902 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 3
1903 ; CHECK-NEXT: mffprwz r3, f0
1906 ; CHECK-LE-LABEL: getui0:
1907 ; CHECK-LE: # %bb.0: # %entry
1908 ; CHECK-LE-NEXT: xxswapd vs0, v2
1909 ; CHECK-LE-NEXT: mffprwz r3, f0
1910 ; CHECK-LE-NEXT: blr
1912 ; CHECK-AIX-LABEL: getui0:
1913 ; CHECK-AIX: # %bb.0: # %entry
1914 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 3
1915 ; CHECK-AIX-NEXT: mffprwz 3, 0
1916 ; CHECK-AIX-NEXT: blr
1918 %vecext = extractelement <4 x i32> %vui, i32 0
1924 ; Function Attrs: norecurse nounwind readnone
1925 define zeroext i32 @getui1(<4 x i32> %vui) {
1926 ; CHECK-LABEL: getui1:
1927 ; CHECK: # %bb.0: # %entry
1928 ; CHECK-NEXT: mfvsrwz r3, v2
1931 ; CHECK-LE-LABEL: getui1:
1932 ; CHECK-LE: # %bb.0: # %entry
1933 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 1
1934 ; CHECK-LE-NEXT: mffprwz r3, f0
1935 ; CHECK-LE-NEXT: blr
1937 ; CHECK-AIX-LABEL: getui1:
1938 ; CHECK-AIX: # %bb.0: # %entry
1939 ; CHECK-AIX-NEXT: mfvsrwz 3, 34
1940 ; CHECK-AIX-NEXT: blr
1942 %vecext = extractelement <4 x i32> %vui, i32 1
1948 ; Function Attrs: norecurse nounwind readnone
1949 define zeroext i32 @getui2(<4 x i32> %vui) {
1950 ; CHECK-LABEL: getui2:
1951 ; CHECK: # %bb.0: # %entry
1952 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 1
1953 ; CHECK-NEXT: mffprwz r3, f0
1956 ; CHECK-LE-LABEL: getui2:
1957 ; CHECK-LE: # %bb.0: # %entry
1958 ; CHECK-LE-NEXT: mfvsrwz r3, v2
1959 ; CHECK-LE-NEXT: blr
1961 ; CHECK-AIX-LABEL: getui2:
1962 ; CHECK-AIX: # %bb.0: # %entry
1963 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 1
1964 ; CHECK-AIX-NEXT: mffprwz 3, 0
1965 ; CHECK-AIX-NEXT: blr
1967 %vecext = extractelement <4 x i32> %vui, i32 2
1973 ; Function Attrs: norecurse nounwind readnone
1974 define zeroext i32 @getui3(<4 x i32> %vui) {
1975 ; CHECK-LABEL: getui3:
1976 ; CHECK: # %bb.0: # %entry
1977 ; CHECK-NEXT: xxswapd vs0, v2
1978 ; CHECK-NEXT: mffprwz r3, f0
1981 ; CHECK-LE-LABEL: getui3:
1982 ; CHECK-LE: # %bb.0: # %entry
1983 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
1984 ; CHECK-LE-NEXT: mffprwz r3, f0
1985 ; CHECK-LE-NEXT: blr
1987 ; CHECK-AIX-LABEL: getui3:
1988 ; CHECK-AIX: # %bb.0: # %entry
1989 ; CHECK-AIX-NEXT: xxswapd 0, 34
1990 ; CHECK-AIX-NEXT: mffprwz 3, 0
1991 ; CHECK-AIX-NEXT: blr
1993 %vecext = extractelement <4 x i32> %vui, i32 3
1999 ; Function Attrs: norecurse nounwind readnone
2000 define signext i32 @getvelsi(<4 x i32> %vsi, i32 signext %i) {
2001 ; CHECK-LABEL: getvelsi:
2002 ; CHECK: # %bb.0: # %entry
2003 ; CHECK-NEXT: clrldi r3, r5, 32
2004 ; CHECK-NEXT: andi. r4, r3, 2
2005 ; CHECK-NEXT: sldi r4, r4, 2
2006 ; CHECK-NEXT: lvsl v3, 0, r4
2007 ; CHECK-NEXT: li r4, 1
2008 ; CHECK-NEXT: andc r3, r4, r3
2009 ; CHECK-NEXT: sldi r3, r3, 5
2010 ; CHECK-NEXT: vperm v2, v2, v2, v3
2011 ; CHECK-NEXT: mfvsrd r4, v2
2012 ; CHECK-NEXT: srd r3, r4, r3
2013 ; CHECK-NEXT: extsw r3, r3
2016 ; CHECK-LE-LABEL: getvelsi:
2017 ; CHECK-LE: # %bb.0: # %entry
2018 ; CHECK-LE-NEXT: clrldi r3, r5, 32
2019 ; CHECK-LE-NEXT: li r4, 2
2020 ; CHECK-LE-NEXT: andc r4, r4, r3
2021 ; CHECK-LE-NEXT: sldi r4, r4, 2
2022 ; CHECK-LE-NEXT: lvsl v3, 0, r4
2023 ; CHECK-LE-NEXT: li r4, 1
2024 ; CHECK-LE-NEXT: and r3, r4, r3
2025 ; CHECK-LE-NEXT: sldi r3, r3, 5
2026 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2027 ; CHECK-LE-NEXT: mfvsrd r4, v2
2028 ; CHECK-LE-NEXT: srd r3, r4, r3
2029 ; CHECK-LE-NEXT: extsw r3, r3
2030 ; CHECK-LE-NEXT: blr
2032 ; CHECK-AIX-LABEL: getvelsi:
2033 ; CHECK-AIX: # %bb.0: # %entry
2034 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2035 ; CHECK-AIX-NEXT: andi. 4, 3, 2
2036 ; CHECK-AIX-NEXT: sldi 4, 4, 2
2037 ; CHECK-AIX-NEXT: lvsl 3, 0, 4
2038 ; CHECK-AIX-NEXT: li 4, 1
2039 ; CHECK-AIX-NEXT: andc 3, 4, 3
2040 ; CHECK-AIX-NEXT: sldi 3, 3, 5
2041 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2042 ; CHECK-AIX-NEXT: mfvsrd 4, 34
2043 ; CHECK-AIX-NEXT: srd 3, 4, 3
2044 ; CHECK-AIX-NEXT: extsw 3, 3
2045 ; CHECK-AIX-NEXT: blr
2047 %vecext = extractelement <4 x i32> %vsi, i32 %i
2049 ; FIXME: add check patterns when variable element extraction is implemented
2052 ; Function Attrs: norecurse nounwind readnone
2053 define zeroext i32 @getvelui(<4 x i32> %vui, i32 signext %i) {
2054 ; CHECK-LABEL: getvelui:
2055 ; CHECK: # %bb.0: # %entry
2056 ; CHECK-NEXT: clrldi r3, r5, 32
2057 ; CHECK-NEXT: andi. r4, r3, 2
2058 ; CHECK-NEXT: sldi r4, r4, 2
2059 ; CHECK-NEXT: lvsl v3, 0, r4
2060 ; CHECK-NEXT: li r4, 1
2061 ; CHECK-NEXT: andc r3, r4, r3
2062 ; CHECK-NEXT: sldi r3, r3, 5
2063 ; CHECK-NEXT: vperm v2, v2, v2, v3
2064 ; CHECK-NEXT: mfvsrd r4, v2
2065 ; CHECK-NEXT: srd r3, r4, r3
2066 ; CHECK-NEXT: clrldi r3, r3, 32
2069 ; CHECK-LE-LABEL: getvelui:
2070 ; CHECK-LE: # %bb.0: # %entry
2071 ; CHECK-LE-NEXT: clrldi r3, r5, 32
2072 ; CHECK-LE-NEXT: li r4, 2
2073 ; CHECK-LE-NEXT: andc r4, r4, r3
2074 ; CHECK-LE-NEXT: sldi r4, r4, 2
2075 ; CHECK-LE-NEXT: lvsl v3, 0, r4
2076 ; CHECK-LE-NEXT: li r4, 1
2077 ; CHECK-LE-NEXT: and r3, r4, r3
2078 ; CHECK-LE-NEXT: sldi r3, r3, 5
2079 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2080 ; CHECK-LE-NEXT: mfvsrd r4, v2
2081 ; CHECK-LE-NEXT: srd r3, r4, r3
2082 ; CHECK-LE-NEXT: clrldi r3, r3, 32
2083 ; CHECK-LE-NEXT: blr
2085 ; CHECK-AIX-LABEL: getvelui:
2086 ; CHECK-AIX: # %bb.0: # %entry
2087 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2088 ; CHECK-AIX-NEXT: andi. 4, 3, 2
2089 ; CHECK-AIX-NEXT: sldi 4, 4, 2
2090 ; CHECK-AIX-NEXT: lvsl 3, 0, 4
2091 ; CHECK-AIX-NEXT: li 4, 1
2092 ; CHECK-AIX-NEXT: andc 3, 4, 3
2093 ; CHECK-AIX-NEXT: sldi 3, 3, 5
2094 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2095 ; CHECK-AIX-NEXT: mfvsrd 4, 34
2096 ; CHECK-AIX-NEXT: srd 3, 4, 3
2097 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2098 ; CHECK-AIX-NEXT: blr
2100 %vecext = extractelement <4 x i32> %vui, i32 %i
2102 ; FIXME: add check patterns when variable element extraction is implemented
2105 ; Function Attrs: norecurse nounwind readnone
2106 define i64 @getsl0(<2 x i64> %vsl) {
2107 ; CHECK-LABEL: getsl0:
2108 ; CHECK: # %bb.0: # %entry
2109 ; CHECK-NEXT: mfvsrd r3, v2
2112 ; CHECK-LE-LABEL: getsl0:
2113 ; CHECK-LE: # %bb.0: # %entry
2114 ; CHECK-LE-NEXT: xxswapd vs0, v2
2115 ; CHECK-LE-NEXT: mffprd r3, f0
2116 ; CHECK-LE-NEXT: blr
2118 ; CHECK-AIX-LABEL: getsl0:
2119 ; CHECK-AIX: # %bb.0: # %entry
2120 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2121 ; CHECK-AIX-NEXT: blr
2123 %vecext = extractelement <2 x i64> %vsl, i32 0
2129 ; Function Attrs: norecurse nounwind readnone
2130 define i64 @getsl1(<2 x i64> %vsl) {
2131 ; CHECK-LABEL: getsl1:
2132 ; CHECK: # %bb.0: # %entry
2133 ; CHECK-NEXT: xxswapd vs0, v2
2134 ; CHECK-NEXT: mffprd r3, f0
2137 ; CHECK-LE-LABEL: getsl1:
2138 ; CHECK-LE: # %bb.0: # %entry
2139 ; CHECK-LE-NEXT: mfvsrd r3, v2
2140 ; CHECK-LE-NEXT: blr
2142 ; CHECK-AIX-LABEL: getsl1:
2143 ; CHECK-AIX: # %bb.0: # %entry
2144 ; CHECK-AIX-NEXT: xxswapd 0, 34
2145 ; CHECK-AIX-NEXT: mffprd 3, 0
2146 ; CHECK-AIX-NEXT: blr
2148 %vecext = extractelement <2 x i64> %vsl, i32 1
2154 ; Function Attrs: norecurse nounwind readnone
2155 define i64 @getul0(<2 x i64> %vul) {
2156 ; CHECK-LABEL: getul0:
2157 ; CHECK: # %bb.0: # %entry
2158 ; CHECK-NEXT: mfvsrd r3, v2
2161 ; CHECK-LE-LABEL: getul0:
2162 ; CHECK-LE: # %bb.0: # %entry
2163 ; CHECK-LE-NEXT: xxswapd vs0, v2
2164 ; CHECK-LE-NEXT: mffprd r3, f0
2165 ; CHECK-LE-NEXT: blr
2167 ; CHECK-AIX-LABEL: getul0:
2168 ; CHECK-AIX: # %bb.0: # %entry
2169 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2170 ; CHECK-AIX-NEXT: blr
2172 %vecext = extractelement <2 x i64> %vul, i32 0
2178 ; Function Attrs: norecurse nounwind readnone
2179 define i64 @getul1(<2 x i64> %vul) {
2180 ; CHECK-LABEL: getul1:
2181 ; CHECK: # %bb.0: # %entry
2182 ; CHECK-NEXT: xxswapd vs0, v2
2183 ; CHECK-NEXT: mffprd r3, f0
2186 ; CHECK-LE-LABEL: getul1:
2187 ; CHECK-LE: # %bb.0: # %entry
2188 ; CHECK-LE-NEXT: mfvsrd r3, v2
2189 ; CHECK-LE-NEXT: blr
2191 ; CHECK-AIX-LABEL: getul1:
2192 ; CHECK-AIX: # %bb.0: # %entry
2193 ; CHECK-AIX-NEXT: xxswapd 0, 34
2194 ; CHECK-AIX-NEXT: mffprd 3, 0
2195 ; CHECK-AIX-NEXT: blr
2197 %vecext = extractelement <2 x i64> %vul, i32 1
2203 ; Function Attrs: norecurse nounwind readnone
2204 define i64 @getvelsl(<2 x i64> %vsl, i32 signext %i) {
2205 ; CHECK-LABEL: getvelsl:
2206 ; CHECK: # %bb.0: # %entry
2207 ; CHECK-NEXT: clrldi r3, r5, 32
2208 ; CHECK-NEXT: andi. r3, r3, 1
2209 ; CHECK-NEXT: sldi r3, r3, 3
2210 ; CHECK-NEXT: lvsl v3, 0, r3
2211 ; CHECK-NEXT: vperm v2, v2, v2, v3
2212 ; CHECK-NEXT: mfvsrd r3, v2
2215 ; CHECK-LE-LABEL: getvelsl:
2216 ; CHECK-LE: # %bb.0: # %entry
2217 ; CHECK-LE-NEXT: clrldi r3, r5, 32
2218 ; CHECK-LE-NEXT: li r4, 1
2219 ; CHECK-LE-NEXT: andc r3, r4, r3
2220 ; CHECK-LE-NEXT: sldi r3, r3, 3
2221 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2222 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2223 ; CHECK-LE-NEXT: mfvsrd r3, v2
2224 ; CHECK-LE-NEXT: blr
2226 ; CHECK-AIX-LABEL: getvelsl:
2227 ; CHECK-AIX: # %bb.0: # %entry
2228 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2229 ; CHECK-AIX-NEXT: andi. 3, 3, 1
2230 ; CHECK-AIX-NEXT: sldi 3, 3, 3
2231 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2232 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2233 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2234 ; CHECK-AIX-NEXT: blr
2236 %vecext = extractelement <2 x i64> %vsl, i32 %i
2238 ; FIXME: add check patterns when variable element extraction is implemented
2241 ; Function Attrs: norecurse nounwind readnone
2242 define i64 @getvelul(<2 x i64> %vul, i32 signext %i) {
2243 ; CHECK-LABEL: getvelul:
2244 ; CHECK: # %bb.0: # %entry
2245 ; CHECK-NEXT: clrldi r3, r5, 32
2246 ; CHECK-NEXT: andi. r3, r3, 1
2247 ; CHECK-NEXT: sldi r3, r3, 3
2248 ; CHECK-NEXT: lvsl v3, 0, r3
2249 ; CHECK-NEXT: vperm v2, v2, v2, v3
2250 ; CHECK-NEXT: mfvsrd r3, v2
2253 ; CHECK-LE-LABEL: getvelul:
2254 ; CHECK-LE: # %bb.0: # %entry
2255 ; CHECK-LE-NEXT: clrldi r3, r5, 32
2256 ; CHECK-LE-NEXT: li r4, 1
2257 ; CHECK-LE-NEXT: andc r3, r4, r3
2258 ; CHECK-LE-NEXT: sldi r3, r3, 3
2259 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2260 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2261 ; CHECK-LE-NEXT: mfvsrd r3, v2
2262 ; CHECK-LE-NEXT: blr
2264 ; CHECK-AIX-LABEL: getvelul:
2265 ; CHECK-AIX: # %bb.0: # %entry
2266 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2267 ; CHECK-AIX-NEXT: andi. 3, 3, 1
2268 ; CHECK-AIX-NEXT: sldi 3, 3, 3
2269 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2270 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2271 ; CHECK-AIX-NEXT: mfvsrd 3, 34
2272 ; CHECK-AIX-NEXT: blr
2274 %vecext = extractelement <2 x i64> %vul, i32 %i
2276 ; FIXME: add check patterns when variable element extraction is implemented
2279 ; Function Attrs: norecurse nounwind readnone
2280 define float @getf0(<4 x float> %vf) {
2281 ; CHECK-LABEL: getf0:
2282 ; CHECK: # %bb.0: # %entry
2283 ; CHECK-NEXT: xscvspdpn f1, v2
2286 ; CHECK-LE-LABEL: getf0:
2287 ; CHECK-LE: # %bb.0: # %entry
2288 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
2289 ; CHECK-LE-NEXT: xscvspdpn f1, vs0
2290 ; CHECK-LE-NEXT: blr
2292 ; CHECK-AIX-LABEL: getf0:
2293 ; CHECK-AIX: # %bb.0: # %entry
2294 ; CHECK-AIX-NEXT: xscvspdpn 1, 34
2295 ; CHECK-AIX-NEXT: blr
2297 %vecext = extractelement <4 x float> %vf, i32 0
2303 ; Function Attrs: norecurse nounwind readnone
2304 define float @getf1(<4 x float> %vf) {
2305 ; CHECK-LABEL: getf1:
2306 ; CHECK: # %bb.0: # %entry
2307 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 1
2308 ; CHECK-NEXT: xscvspdpn f1, vs0
2311 ; CHECK-LE-LABEL: getf1:
2312 ; CHECK-LE: # %bb.0: # %entry
2313 ; CHECK-LE-NEXT: xxswapd vs0, v2
2314 ; CHECK-LE-NEXT: xscvspdpn f1, vs0
2315 ; CHECK-LE-NEXT: blr
2317 ; CHECK-AIX-LABEL: getf1:
2318 ; CHECK-AIX: # %bb.0: # %entry
2319 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 1
2320 ; CHECK-AIX-NEXT: xscvspdpn 1, 0
2321 ; CHECK-AIX-NEXT: blr
2323 %vecext = extractelement <4 x float> %vf, i32 1
2329 ; Function Attrs: norecurse nounwind readnone
2330 define float @getf2(<4 x float> %vf) {
2331 ; CHECK-LABEL: getf2:
2332 ; CHECK: # %bb.0: # %entry
2333 ; CHECK-NEXT: xxswapd vs0, v2
2334 ; CHECK-NEXT: xscvspdpn f1, vs0
2337 ; CHECK-LE-LABEL: getf2:
2338 ; CHECK-LE: # %bb.0: # %entry
2339 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 1
2340 ; CHECK-LE-NEXT: xscvspdpn f1, vs0
2341 ; CHECK-LE-NEXT: blr
2343 ; CHECK-AIX-LABEL: getf2:
2344 ; CHECK-AIX: # %bb.0: # %entry
2345 ; CHECK-AIX-NEXT: xxswapd 0, 34
2346 ; CHECK-AIX-NEXT: xscvspdpn 1, 0
2347 ; CHECK-AIX-NEXT: blr
2349 %vecext = extractelement <4 x float> %vf, i32 2
2355 ; Function Attrs: norecurse nounwind readnone
2356 define float @getf3(<4 x float> %vf) {
2357 ; CHECK-LABEL: getf3:
2358 ; CHECK: # %bb.0: # %entry
2359 ; CHECK-NEXT: xxsldwi vs0, v2, v2, 3
2360 ; CHECK-NEXT: xscvspdpn f1, vs0
2363 ; CHECK-LE-LABEL: getf3:
2364 ; CHECK-LE: # %bb.0: # %entry
2365 ; CHECK-LE-NEXT: xscvspdpn f1, v2
2366 ; CHECK-LE-NEXT: blr
2368 ; CHECK-AIX-LABEL: getf3:
2369 ; CHECK-AIX: # %bb.0: # %entry
2370 ; CHECK-AIX-NEXT: xxsldwi 0, 34, 34, 3
2371 ; CHECK-AIX-NEXT: xscvspdpn 1, 0
2372 ; CHECK-AIX-NEXT: blr
2374 %vecext = extractelement <4 x float> %vf, i32 3
2380 ; Function Attrs: norecurse nounwind readnone
2381 define float @getvelf(<4 x float> %vf, i32 signext %i) {
2382 ; CHECK-LABEL: getvelf:
2383 ; CHECK: # %bb.0: # %entry
2384 ; CHECK-NEXT: rldic r3, r5, 2, 30
2385 ; CHECK-NEXT: lvsl v3, 0, r3
2386 ; CHECK-NEXT: vperm v2, v2, v2, v3
2387 ; CHECK-NEXT: xscvspdpn f1, v2
2390 ; CHECK-LE-LABEL: getvelf:
2391 ; CHECK-LE: # %bb.0: # %entry
2392 ; CHECK-LE-NEXT: clrldi r3, r5, 32
2393 ; CHECK-LE-NEXT: xori r3, r3, 3
2394 ; CHECK-LE-NEXT: sldi r3, r3, 2
2395 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2396 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2397 ; CHECK-LE-NEXT: xscvspdpn f1, v2
2398 ; CHECK-LE-NEXT: blr
2400 ; CHECK-AIX-LABEL: getvelf:
2401 ; CHECK-AIX: # %bb.0: # %entry
2402 ; CHECK-AIX-NEXT: rldic 3, 3, 2, 30
2403 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2404 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2405 ; CHECK-AIX-NEXT: xscvspdpn 1, 34
2406 ; CHECK-AIX-NEXT: blr
2408 %vecext = extractelement <4 x float> %vf, i32 %i
2410 ; FIXME: add check patterns when variable element extraction is implemented
2413 ; Function Attrs: norecurse nounwind readnone
2414 define double @getd0(<2 x double> %vd) {
2415 ; CHECK-LABEL: getd0:
2416 ; CHECK: # %bb.0: # %entry
2417 ; CHECK-NEXT: xxlor f1, v2, v2
2420 ; CHECK-LE-LABEL: getd0:
2421 ; CHECK-LE: # %bb.0: # %entry
2422 ; CHECK-LE-NEXT: xxswapd vs1, v2
2423 ; CHECK-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2424 ; CHECK-LE-NEXT: blr
2426 ; CHECK-AIX-LABEL: getd0:
2427 ; CHECK-AIX: # %bb.0: # %entry
2428 ; CHECK-AIX-NEXT: xxlor 1, 34, 34
2429 ; CHECK-AIX-NEXT: blr
2431 %vecext = extractelement <2 x double> %vd, i32 0
2437 ; Function Attrs: norecurse nounwind readnone
2438 define double @getd1(<2 x double> %vd) {
2439 ; CHECK-LABEL: getd1:
2440 ; CHECK: # %bb.0: # %entry
2441 ; CHECK-NEXT: xxswapd vs1, v2
2442 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2445 ; CHECK-LE-LABEL: getd1:
2446 ; CHECK-LE: # %bb.0: # %entry
2447 ; CHECK-LE-NEXT: xxlor f1, v2, v2
2448 ; CHECK-LE-NEXT: blr
2450 ; CHECK-AIX-LABEL: getd1:
2451 ; CHECK-AIX: # %bb.0: # %entry
2452 ; CHECK-AIX-NEXT: xxswapd 1, 34
2453 ; CHECK-AIX-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2454 ; CHECK-AIX-NEXT: blr
2456 %vecext = extractelement <2 x double> %vd, i32 1
2460 ; Function Attrs: norecurse nounwind readnone
2461 define double @getveld(<2 x double> %vd, i32 signext %i) {
2462 ; CHECK-LABEL: getveld:
2463 ; CHECK: # %bb.0: # %entry
2464 ; CHECK-NEXT: clrldi r3, r5, 32
2465 ; CHECK-NEXT: andi. r3, r3, 1
2466 ; CHECK-NEXT: sldi r3, r3, 3
2467 ; CHECK-NEXT: lvsl v3, 0, r3
2468 ; CHECK-NEXT: vperm v2, v2, v2, v3
2469 ; CHECK-NEXT: xxlor vs1, v2, v2
2470 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2473 ; CHECK-LE-LABEL: getveld:
2474 ; CHECK-LE: # %bb.0: # %entry
2475 ; CHECK-LE-NEXT: clrldi r3, r5, 32
2476 ; CHECK-LE-NEXT: li r4, 1
2477 ; CHECK-LE-NEXT: andc r3, r4, r3
2478 ; CHECK-LE-NEXT: sldi r3, r3, 3
2479 ; CHECK-LE-NEXT: lvsl v3, 0, r3
2480 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2481 ; CHECK-LE-NEXT: xxlor vs1, v2, v2
2482 ; CHECK-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2483 ; CHECK-LE-NEXT: blr
2485 ; CHECK-AIX-LABEL: getveld:
2486 ; CHECK-AIX: # %bb.0: # %entry
2487 ; CHECK-AIX-NEXT: clrldi 3, 3, 32
2488 ; CHECK-AIX-NEXT: andi. 3, 3, 1
2489 ; CHECK-AIX-NEXT: sldi 3, 3, 3
2490 ; CHECK-AIX-NEXT: lvsl 3, 0, 3
2491 ; CHECK-AIX-NEXT: vperm 2, 2, 2, 3
2492 ; CHECK-AIX-NEXT: xxlor 1, 34, 34
2493 ; CHECK-AIX-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2494 ; CHECK-AIX-NEXT: blr
2496 %vecext = extractelement <2 x double> %vd, i32 %i
2498 ; FIXME: add check patterns when variable element extraction is implemented
2501 ; To check when LHS is i32 to vector and RHS is i64 to vector,
2502 ; the combination should be skipped properly.
2503 define <2 x i64> @buildi2(i64 %arg, i32 %arg1) {
2504 ; CHECK-LABEL: buildi2:
2505 ; CHECK: # %bb.0: # %entry
2506 ; CHECK-NEXT: sldi r4, r4, 32
2507 ; CHECK-NEXT: mtfprd f1, r3
2508 ; CHECK-NEXT: mtfprd f0, r4
2509 ; CHECK-NEXT: xxmrghd v2, vs0, vs1
2512 ; CHECK-LE-LABEL: buildi2:
2513 ; CHECK-LE: # %bb.0: # %entry
2514 ; CHECK-LE-NEXT: mtfprd f0, r4
2515 ; CHECK-LE-NEXT: mtfprd f1, r3
2516 ; CHECK-LE-NEXT: xxswapd vs0, vs0
2517 ; CHECK-LE-NEXT: xxswapd v2, vs1
2518 ; CHECK-LE-NEXT: xxmrgld v2, v2, vs0
2519 ; CHECK-LE-NEXT: blr
2521 ; CHECK-AIX-LABEL: buildi2:
2522 ; CHECK-AIX: # %bb.0: # %entry
2523 ; CHECK-AIX-NEXT: sldi 4, 4, 32
2524 ; CHECK-AIX-NEXT: mtfprd 1, 3
2525 ; CHECK-AIX-NEXT: mtfprd 0, 4
2526 ; CHECK-AIX-NEXT: xxmrghd 34, 0, 1
2527 ; CHECK-AIX-NEXT: blr
2529 %lhs.i32 = insertelement <4 x i32> undef, i32 %arg1, i32 0
2530 %rhs = insertelement <2 x i64> undef, i64 %arg, i32 0
2531 %lhs = bitcast <4 x i32> %lhs.i32 to <2 x i64>
2532 %shuffle = shufflevector <2 x i64> %lhs, <2 x i64> %rhs, <2 x i32> <i32 0, i32 2>
2533 ret <2 x i64> %shuffle