1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs \
3 ; RUN: -mcpu=pwr8 -vec-extabi | FileCheck %s
5 ; The build[csilf] functions simply test the scalar_to_vector handling with
6 ; direct moves. This corresponds to the "insertelement" instruction. Subsequent
7 ; to this, there will be a splat corresponding to the shufflevector.
9 @d = common global double 0.000000e+00, align 8
11 ; Function Attrs: norecurse nounwind readnone
12 define <16 x i8> @buildc(i8 zeroext %a) {
13 ; CHECK-LABEL: buildc:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: mtvsrwz 34, 3
16 ; CHECK-NEXT: vspltb 2, 2, 7
19 %splat.splatinsert = insertelement <16 x i8> undef, i8 %a, i32 0
20 %splat.splat = shufflevector <16 x i8> %splat.splatinsert, <16 x i8> undef, <16 x i32> zeroinitializer
21 ret <16 x i8> %splat.splat
24 ; Function Attrs: norecurse nounwind readnone
25 define <8 x i16> @builds(i16 zeroext %a) {
26 ; CHECK-LABEL: builds:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: sth 3, -16(1)
29 ; CHECK-NEXT: addi 3, 1, -16
30 ; CHECK-NEXT: lxvw4x 34, 0, 3
31 ; CHECK-NEXT: vsplth 2, 2, 0
34 %splat.splatinsert = insertelement <8 x i16> undef, i16 %a, i32 0
35 %splat.splat = shufflevector <8 x i16> %splat.splatinsert, <8 x i16> undef, <8 x i32> zeroinitializer
36 ret <8 x i16> %splat.splat
39 ; Function Attrs: norecurse nounwind readnone
40 define <4 x i32> @buildi(i32 zeroext %a) {
41 ; CHECK-LABEL: buildi:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: stw 3, -16(1)
44 ; CHECK-NEXT: addi 3, 1, -16
45 ; CHECK-NEXT: lxvw4x 0, 0, 3
46 ; CHECK-NEXT: xxspltw 34, 0, 0
49 %splat.splatinsert = insertelement <4 x i32> undef, i32 %a, i32 0
50 %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
51 ret <4 x i32> %splat.splat
54 ; Function Attrs: norecurse nounwind readnone
55 define <2 x i64> @buildl(i64 %a) {
56 ; CHECK-LABEL: buildl:
57 ; CHECK: # %bb.0: # %entry
58 ; CHECK-NEXT: stw 3, -32(1)
59 ; CHECK-NEXT: lwz 3, L..C0(2) # %const.0
60 ; CHECK-NEXT: stw 4, -16(1)
61 ; CHECK-NEXT: lxvw4x 34, 0, 3
62 ; CHECK-NEXT: addi 3, 1, -16
63 ; CHECK-NEXT: lxvw4x 35, 0, 3
64 ; CHECK-NEXT: addi 3, 1, -32
65 ; CHECK-NEXT: lxvw4x 36, 0, 3
66 ; CHECK-NEXT: vperm 2, 4, 3, 2
69 %splat.splatinsert = insertelement <2 x i64> undef, i64 %a, i32 0
70 %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer
71 ret <2 x i64> %splat.splat
74 ; Function Attrs: norecurse nounwind readnone
75 define <4 x float> @buildf(float %a) {
76 ; CHECK-LABEL: buildf:
77 ; CHECK: # %bb.0: # %entry
78 ; CHECK-NEXT: xscvdpspn 0, 1
79 ; CHECK-NEXT: xxspltw 34, 0, 1
82 %splat.splatinsert = insertelement <4 x float> undef, float %a, i32 0
83 %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
84 ret <4 x float> %splat.splat
87 ; The optimization to remove stack operations from PPCDAGToDAGISel::Select
88 ; should still trigger for v2f64, producing an lxvdsx.
89 ; Function Attrs: norecurse nounwind readonly
90 define <2 x double> @buildd() {
91 ; CHECK-LABEL: buildd:
92 ; CHECK: # %bb.0: # %entry
93 ; CHECK-NEXT: lwz 3, L..C1(2) # @d
94 ; CHECK-NEXT: lxvdsx 34, 0, 3
97 %0 = load double, ptr @d, align 8
98 %splat.splatinsert = insertelement <2 x double> undef, double %0, i32 0
99 %splat.splat = shufflevector <2 x double> %splat.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer
100 ret <2 x double> %splat.splat
103 ; Function Attrs: norecurse nounwind readnone
104 define signext i8 @getsc0(<16 x i8> %vsc) {
105 ; CHECK-LABEL: getsc0:
106 ; CHECK: # %bb.0: # %entry
107 ; CHECK-NEXT: addi 3, 1, -16
108 ; CHECK-NEXT: stxvw4x 34, 0, 3
109 ; CHECK-NEXT: lbz 3, -16(1)
110 ; CHECK-NEXT: extsb 3, 3
113 %vecext = extractelement <16 x i8> %vsc, i32 0
117 ; Function Attrs: norecurse nounwind readnone
118 define signext i8 @getsc1(<16 x i8> %vsc) {
119 ; CHECK-LABEL: getsc1:
120 ; CHECK: # %bb.0: # %entry
121 ; CHECK-NEXT: addi 3, 1, -16
122 ; CHECK-NEXT: stxvw4x 34, 0, 3
123 ; CHECK-NEXT: lbz 3, -15(1)
124 ; CHECK-NEXT: extsb 3, 3
127 %vecext = extractelement <16 x i8> %vsc, i32 1
131 ; Function Attrs: norecurse nounwind readnone
132 define signext i8 @getsc2(<16 x i8> %vsc) {
133 ; CHECK-LABEL: getsc2:
134 ; CHECK: # %bb.0: # %entry
135 ; CHECK-NEXT: addi 3, 1, -16
136 ; CHECK-NEXT: stxvw4x 34, 0, 3
137 ; CHECK-NEXT: lbz 3, -14(1)
138 ; CHECK-NEXT: extsb 3, 3
141 %vecext = extractelement <16 x i8> %vsc, i32 2
145 ; Function Attrs: norecurse nounwind readnone
146 define signext i8 @getsc3(<16 x i8> %vsc) {
147 ; CHECK-LABEL: getsc3:
148 ; CHECK: # %bb.0: # %entry
149 ; CHECK-NEXT: addi 3, 1, -16
150 ; CHECK-NEXT: stxvw4x 34, 0, 3
151 ; CHECK-NEXT: lbz 3, -13(1)
152 ; CHECK-NEXT: extsb 3, 3
155 %vecext = extractelement <16 x i8> %vsc, i32 3
159 ; Function Attrs: norecurse nounwind readnone
160 define signext i8 @getsc4(<16 x i8> %vsc) {
161 ; CHECK-LABEL: getsc4:
162 ; CHECK: # %bb.0: # %entry
163 ; CHECK-NEXT: addi 3, 1, -16
164 ; CHECK-NEXT: stxvw4x 34, 0, 3
165 ; CHECK-NEXT: lbz 3, -12(1)
166 ; CHECK-NEXT: extsb 3, 3
169 %vecext = extractelement <16 x i8> %vsc, i32 4
173 ; Function Attrs: norecurse nounwind readnone
174 define signext i8 @getsc5(<16 x i8> %vsc) {
175 ; CHECK-LABEL: getsc5:
176 ; CHECK: # %bb.0: # %entry
177 ; CHECK-NEXT: addi 3, 1, -16
178 ; CHECK-NEXT: stxvw4x 34, 0, 3
179 ; CHECK-NEXT: lbz 3, -11(1)
180 ; CHECK-NEXT: extsb 3, 3
183 %vecext = extractelement <16 x i8> %vsc, i32 5
187 ; Function Attrs: norecurse nounwind readnone
188 define signext i8 @getsc6(<16 x i8> %vsc) {
189 ; CHECK-LABEL: getsc6:
190 ; CHECK: # %bb.0: # %entry
191 ; CHECK-NEXT: addi 3, 1, -16
192 ; CHECK-NEXT: stxvw4x 34, 0, 3
193 ; CHECK-NEXT: lbz 3, -10(1)
194 ; CHECK-NEXT: extsb 3, 3
197 %vecext = extractelement <16 x i8> %vsc, i32 6
201 ; Function Attrs: norecurse nounwind readnone
202 define signext i8 @getsc7(<16 x i8> %vsc) {
203 ; CHECK-LABEL: getsc7:
204 ; CHECK: # %bb.0: # %entry
205 ; CHECK-NEXT: addi 3, 1, -16
206 ; CHECK-NEXT: stxvw4x 34, 0, 3
207 ; CHECK-NEXT: lbz 3, -9(1)
208 ; CHECK-NEXT: extsb 3, 3
211 %vecext = extractelement <16 x i8> %vsc, i32 7
215 ; Function Attrs: norecurse nounwind readnone
216 define signext i8 @getsc8(<16 x i8> %vsc) {
217 ; CHECK-LABEL: getsc8:
218 ; CHECK: # %bb.0: # %entry
219 ; CHECK-NEXT: addi 3, 1, -16
220 ; CHECK-NEXT: stxvw4x 34, 0, 3
221 ; CHECK-NEXT: lbz 3, -8(1)
222 ; CHECK-NEXT: extsb 3, 3
225 %vecext = extractelement <16 x i8> %vsc, i32 8
229 ; Function Attrs: norecurse nounwind readnone
230 define signext i8 @getsc9(<16 x i8> %vsc) {
231 ; CHECK-LABEL: getsc9:
232 ; CHECK: # %bb.0: # %entry
233 ; CHECK-NEXT: addi 3, 1, -16
234 ; CHECK-NEXT: stxvw4x 34, 0, 3
235 ; CHECK-NEXT: lbz 3, -7(1)
236 ; CHECK-NEXT: extsb 3, 3
239 %vecext = extractelement <16 x i8> %vsc, i32 9
243 ; Function Attrs: norecurse nounwind readnone
244 define signext i8 @getsc10(<16 x i8> %vsc) {
245 ; CHECK-LABEL: getsc10:
246 ; CHECK: # %bb.0: # %entry
247 ; CHECK-NEXT: addi 3, 1, -16
248 ; CHECK-NEXT: stxvw4x 34, 0, 3
249 ; CHECK-NEXT: lbz 3, -6(1)
250 ; CHECK-NEXT: extsb 3, 3
253 %vecext = extractelement <16 x i8> %vsc, i32 10
257 ; Function Attrs: norecurse nounwind readnone
258 define signext i8 @getsc11(<16 x i8> %vsc) {
259 ; CHECK-LABEL: getsc11:
260 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: addi 3, 1, -16
262 ; CHECK-NEXT: stxvw4x 34, 0, 3
263 ; CHECK-NEXT: lbz 3, -5(1)
264 ; CHECK-NEXT: extsb 3, 3
267 %vecext = extractelement <16 x i8> %vsc, i32 11
271 ; Function Attrs: norecurse nounwind readnone
272 define signext i8 @getsc12(<16 x i8> %vsc) {
273 ; CHECK-LABEL: getsc12:
274 ; CHECK: # %bb.0: # %entry
275 ; CHECK-NEXT: addi 3, 1, -16
276 ; CHECK-NEXT: stxvw4x 34, 0, 3
277 ; CHECK-NEXT: lbz 3, -4(1)
278 ; CHECK-NEXT: extsb 3, 3
281 %vecext = extractelement <16 x i8> %vsc, i32 12
285 ; Function Attrs: norecurse nounwind readnone
286 define signext i8 @getsc13(<16 x i8> %vsc) {
287 ; CHECK-LABEL: getsc13:
288 ; CHECK: # %bb.0: # %entry
289 ; CHECK-NEXT: addi 3, 1, -16
290 ; CHECK-NEXT: stxvw4x 34, 0, 3
291 ; CHECK-NEXT: lbz 3, -3(1)
292 ; CHECK-NEXT: extsb 3, 3
295 %vecext = extractelement <16 x i8> %vsc, i32 13
299 ; Function Attrs: norecurse nounwind readnone
300 define signext i8 @getsc14(<16 x i8> %vsc) {
301 ; CHECK-LABEL: getsc14:
302 ; CHECK: # %bb.0: # %entry
303 ; CHECK-NEXT: addi 3, 1, -16
304 ; CHECK-NEXT: stxvw4x 34, 0, 3
305 ; CHECK-NEXT: lbz 3, -2(1)
306 ; CHECK-NEXT: extsb 3, 3
309 %vecext = extractelement <16 x i8> %vsc, i32 14
313 ; Function Attrs: norecurse nounwind readnone
314 define signext i8 @getsc15(<16 x i8> %vsc) {
315 ; CHECK-LABEL: getsc15:
316 ; CHECK: # %bb.0: # %entry
317 ; CHECK-NEXT: addi 3, 1, -16
318 ; CHECK-NEXT: stxvw4x 34, 0, 3
319 ; CHECK-NEXT: lbz 3, -1(1)
320 ; CHECK-NEXT: extsb 3, 3
323 %vecext = extractelement <16 x i8> %vsc, i32 15
327 ; Function Attrs: norecurse nounwind readnone
328 define zeroext i8 @getuc0(<16 x i8> %vuc) {
329 ; CHECK-LABEL: getuc0:
330 ; CHECK: # %bb.0: # %entry
331 ; CHECK-NEXT: addi 3, 1, -16
332 ; CHECK-NEXT: stxvw4x 34, 0, 3
333 ; CHECK-NEXT: lbz 3, -16(1)
336 %vecext = extractelement <16 x i8> %vuc, i32 0
340 ; Function Attrs: norecurse nounwind readnone
341 define zeroext i8 @getuc1(<16 x i8> %vuc) {
342 ; CHECK-LABEL: getuc1:
343 ; CHECK: # %bb.0: # %entry
344 ; CHECK-NEXT: addi 3, 1, -16
345 ; CHECK-NEXT: stxvw4x 34, 0, 3
346 ; CHECK-NEXT: lbz 3, -15(1)
349 %vecext = extractelement <16 x i8> %vuc, i32 1
353 ; Function Attrs: norecurse nounwind readnone
354 define zeroext i8 @getuc2(<16 x i8> %vuc) {
355 ; CHECK-LABEL: getuc2:
356 ; CHECK: # %bb.0: # %entry
357 ; CHECK-NEXT: addi 3, 1, -16
358 ; CHECK-NEXT: stxvw4x 34, 0, 3
359 ; CHECK-NEXT: lbz 3, -14(1)
362 %vecext = extractelement <16 x i8> %vuc, i32 2
366 ; Function Attrs: norecurse nounwind readnone
367 define zeroext i8 @getuc3(<16 x i8> %vuc) {
368 ; CHECK-LABEL: getuc3:
369 ; CHECK: # %bb.0: # %entry
370 ; CHECK-NEXT: addi 3, 1, -16
371 ; CHECK-NEXT: stxvw4x 34, 0, 3
372 ; CHECK-NEXT: lbz 3, -13(1)
375 %vecext = extractelement <16 x i8> %vuc, i32 3
379 ; Function Attrs: norecurse nounwind readnone
380 define zeroext i8 @getuc4(<16 x i8> %vuc) {
381 ; CHECK-LABEL: getuc4:
382 ; CHECK: # %bb.0: # %entry
383 ; CHECK-NEXT: addi 3, 1, -16
384 ; CHECK-NEXT: stxvw4x 34, 0, 3
385 ; CHECK-NEXT: lbz 3, -12(1)
388 %vecext = extractelement <16 x i8> %vuc, i32 4
392 ; Function Attrs: norecurse nounwind readnone
393 define zeroext i8 @getuc5(<16 x i8> %vuc) {
394 ; CHECK-LABEL: getuc5:
395 ; CHECK: # %bb.0: # %entry
396 ; CHECK-NEXT: addi 3, 1, -16
397 ; CHECK-NEXT: stxvw4x 34, 0, 3
398 ; CHECK-NEXT: lbz 3, -11(1)
401 %vecext = extractelement <16 x i8> %vuc, i32 5
405 ; Function Attrs: norecurse nounwind readnone
406 define zeroext i8 @getuc6(<16 x i8> %vuc) {
407 ; CHECK-LABEL: getuc6:
408 ; CHECK: # %bb.0: # %entry
409 ; CHECK-NEXT: addi 3, 1, -16
410 ; CHECK-NEXT: stxvw4x 34, 0, 3
411 ; CHECK-NEXT: lbz 3, -10(1)
414 %vecext = extractelement <16 x i8> %vuc, i32 6
418 ; Function Attrs: norecurse nounwind readnone
419 define zeroext i8 @getuc7(<16 x i8> %vuc) {
420 ; CHECK-LABEL: getuc7:
421 ; CHECK: # %bb.0: # %entry
422 ; CHECK-NEXT: addi 3, 1, -16
423 ; CHECK-NEXT: stxvw4x 34, 0, 3
424 ; CHECK-NEXT: lbz 3, -9(1)
427 %vecext = extractelement <16 x i8> %vuc, i32 7
431 ; Function Attrs: norecurse nounwind readnone
432 define zeroext i8 @getuc8(<16 x i8> %vuc) {
433 ; CHECK-LABEL: getuc8:
434 ; CHECK: # %bb.0: # %entry
435 ; CHECK-NEXT: addi 3, 1, -16
436 ; CHECK-NEXT: stxvw4x 34, 0, 3
437 ; CHECK-NEXT: lbz 3, -8(1)
440 %vecext = extractelement <16 x i8> %vuc, i32 8
444 ; Function Attrs: norecurse nounwind readnone
445 define zeroext i8 @getuc9(<16 x i8> %vuc) {
446 ; CHECK-LABEL: getuc9:
447 ; CHECK: # %bb.0: # %entry
448 ; CHECK-NEXT: addi 3, 1, -16
449 ; CHECK-NEXT: stxvw4x 34, 0, 3
450 ; CHECK-NEXT: lbz 3, -7(1)
453 %vecext = extractelement <16 x i8> %vuc, i32 9
457 ; Function Attrs: norecurse nounwind readnone
458 define zeroext i8 @getuc10(<16 x i8> %vuc) {
459 ; CHECK-LABEL: getuc10:
460 ; CHECK: # %bb.0: # %entry
461 ; CHECK-NEXT: addi 3, 1, -16
462 ; CHECK-NEXT: stxvw4x 34, 0, 3
463 ; CHECK-NEXT: lbz 3, -6(1)
466 %vecext = extractelement <16 x i8> %vuc, i32 10
470 ; Function Attrs: norecurse nounwind readnone
471 define zeroext i8 @getuc11(<16 x i8> %vuc) {
472 ; CHECK-LABEL: getuc11:
473 ; CHECK: # %bb.0: # %entry
474 ; CHECK-NEXT: addi 3, 1, -16
475 ; CHECK-NEXT: stxvw4x 34, 0, 3
476 ; CHECK-NEXT: lbz 3, -5(1)
479 %vecext = extractelement <16 x i8> %vuc, i32 11
483 ; Function Attrs: norecurse nounwind readnone
484 define zeroext i8 @getuc12(<16 x i8> %vuc) {
486 ; CHECK-LABEL: getuc12:
487 ; CHECK: # %bb.0: # %entry
488 ; CHECK-NEXT: addi 3, 1, -16
489 ; CHECK-NEXT: stxvw4x 34, 0, 3
490 ; CHECK-NEXT: lbz 3, -4(1)
493 %vecext = extractelement <16 x i8> %vuc, i32 12
497 ; Function Attrs: norecurse nounwind readnone
498 define zeroext i8 @getuc13(<16 x i8> %vuc) {
499 ; CHECK-LABEL: getuc13:
500 ; CHECK: # %bb.0: # %entry
501 ; CHECK-NEXT: addi 3, 1, -16
502 ; CHECK-NEXT: stxvw4x 34, 0, 3
503 ; CHECK-NEXT: lbz 3, -3(1)
506 %vecext = extractelement <16 x i8> %vuc, i32 13
510 ; Function Attrs: norecurse nounwind readnone
511 define zeroext i8 @getuc14(<16 x i8> %vuc) {
512 ; CHECK-LABEL: getuc14:
513 ; CHECK: # %bb.0: # %entry
514 ; CHECK-NEXT: addi 3, 1, -16
515 ; CHECK-NEXT: stxvw4x 34, 0, 3
516 ; CHECK-NEXT: lbz 3, -2(1)
519 %vecext = extractelement <16 x i8> %vuc, i32 14
523 ; Function Attrs: norecurse nounwind readnone
524 define zeroext i8 @getuc15(<16 x i8> %vuc) {
525 ; CHECK-LABEL: getuc15:
526 ; CHECK: # %bb.0: # %entry
527 ; CHECK-NEXT: addi 3, 1, -16
528 ; CHECK-NEXT: stxvw4x 34, 0, 3
529 ; CHECK-NEXT: lbz 3, -1(1)
532 %vecext = extractelement <16 x i8> %vuc, i32 15
536 ; Function Attrs: norecurse nounwind readnone
537 define signext i8 @getvelsc(<16 x i8> %vsc, i32 signext %i) {
538 ; CHECK-LABEL: getvelsc:
539 ; CHECK: # %bb.0: # %entry
540 ; CHECK-NEXT: addi 4, 1, -16
541 ; CHECK-NEXT: clrlwi 3, 3, 28
542 ; CHECK-NEXT: stxvw4x 34, 0, 4
543 ; CHECK-NEXT: lbzx 3, 4, 3
544 ; CHECK-NEXT: extsb 3, 3
547 %vecext = extractelement <16 x i8> %vsc, i32 %i
551 ; Function Attrs: norecurse nounwind readnone
552 define zeroext i8 @getveluc(<16 x i8> %vuc, i32 signext %i) {
553 ; CHECK-LABEL: getveluc:
554 ; CHECK: # %bb.0: # %entry
555 ; CHECK-NEXT: addi 4, 1, -16
556 ; CHECK-NEXT: clrlwi 3, 3, 28
557 ; CHECK-NEXT: stxvw4x 34, 0, 4
558 ; CHECK-NEXT: lbzx 3, 4, 3
561 %vecext = extractelement <16 x i8> %vuc, i32 %i
565 ; Function Attrs: norecurse nounwind readnone
566 define signext i16 @getss0(<8 x i16> %vss) {
567 ; CHECK-LABEL: getss0:
568 ; CHECK: # %bb.0: # %entry
569 ; CHECK-NEXT: addi 3, 1, -16
570 ; CHECK-NEXT: stxvw4x 34, 0, 3
571 ; CHECK-NEXT: lha 3, -16(1)
574 %vecext = extractelement <8 x i16> %vss, i32 0
578 ; Function Attrs: norecurse nounwind readnone
579 define signext i16 @getss1(<8 x i16> %vss) {
580 ; CHECK-LABEL: getss1:
581 ; CHECK: # %bb.0: # %entry
582 ; CHECK-NEXT: addi 3, 1, -16
583 ; CHECK-NEXT: stxvw4x 34, 0, 3
584 ; CHECK-NEXT: lha 3, -14(1)
587 %vecext = extractelement <8 x i16> %vss, i32 1
591 ; Function Attrs: norecurse nounwind readnone
592 define signext i16 @getss2(<8 x i16> %vss) {
593 ; CHECK-LABEL: getss2:
594 ; CHECK: # %bb.0: # %entry
595 ; CHECK-NEXT: addi 3, 1, -16
596 ; CHECK-NEXT: stxvw4x 34, 0, 3
597 ; CHECK-NEXT: lha 3, -12(1)
600 %vecext = extractelement <8 x i16> %vss, i32 2
604 ; Function Attrs: norecurse nounwind readnone
605 define signext i16 @getss3(<8 x i16> %vss) {
606 ; CHECK-LABEL: getss3:
607 ; CHECK: # %bb.0: # %entry
608 ; CHECK-NEXT: addi 3, 1, -16
609 ; CHECK-NEXT: stxvw4x 34, 0, 3
610 ; CHECK-NEXT: lha 3, -10(1)
613 %vecext = extractelement <8 x i16> %vss, i32 3
617 ; Function Attrs: norecurse nounwind readnone
618 define signext i16 @getss4(<8 x i16> %vss) {
619 ; CHECK-LABEL: getss4:
620 ; CHECK: # %bb.0: # %entry
621 ; CHECK-NEXT: addi 3, 1, -16
622 ; CHECK-NEXT: stxvw4x 34, 0, 3
623 ; CHECK-NEXT: lha 3, -8(1)
626 %vecext = extractelement <8 x i16> %vss, i32 4
630 ; Function Attrs: norecurse nounwind readnone
631 define signext i16 @getss5(<8 x i16> %vss) {
632 ; CHECK-LABEL: getss5:
633 ; CHECK: # %bb.0: # %entry
634 ; CHECK-NEXT: addi 3, 1, -16
635 ; CHECK-NEXT: stxvw4x 34, 0, 3
636 ; CHECK-NEXT: lha 3, -6(1)
639 %vecext = extractelement <8 x i16> %vss, i32 5
643 ; Function Attrs: norecurse nounwind readnone
644 define signext i16 @getss6(<8 x i16> %vss) {
645 ; CHECK-LABEL: getss6:
646 ; CHECK: # %bb.0: # %entry
647 ; CHECK-NEXT: addi 3, 1, -16
648 ; CHECK-NEXT: stxvw4x 34, 0, 3
649 ; CHECK-NEXT: lha 3, -4(1)
652 %vecext = extractelement <8 x i16> %vss, i32 6
656 ; Function Attrs: norecurse nounwind readnone
657 define signext i16 @getss7(<8 x i16> %vss) {
658 ; CHECK-LABEL: getss7:
659 ; CHECK: # %bb.0: # %entry
660 ; CHECK-NEXT: addi 3, 1, -16
661 ; CHECK-NEXT: stxvw4x 34, 0, 3
662 ; CHECK-NEXT: lha 3, -2(1)
665 %vecext = extractelement <8 x i16> %vss, i32 7
669 ; Function Attrs: norecurse nounwind readnone
670 define zeroext i16 @getus0(<8 x i16> %vus) {
671 ; CHECK-LABEL: getus0:
672 ; CHECK: # %bb.0: # %entry
673 ; CHECK-NEXT: addi 3, 1, -16
674 ; CHECK-NEXT: stxvw4x 34, 0, 3
675 ; CHECK-NEXT: lhz 3, -16(1)
678 %vecext = extractelement <8 x i16> %vus, i32 0
682 ; Function Attrs: norecurse nounwind readnone
683 define zeroext i16 @getus1(<8 x i16> %vus) {
684 ; CHECK-LABEL: getus1:
685 ; CHECK: # %bb.0: # %entry
686 ; CHECK-NEXT: addi 3, 1, -16
687 ; CHECK-NEXT: stxvw4x 34, 0, 3
688 ; CHECK-NEXT: lhz 3, -14(1)
691 %vecext = extractelement <8 x i16> %vus, i32 1
695 ; Function Attrs: norecurse nounwind readnone
696 define zeroext i16 @getus2(<8 x i16> %vus) {
697 ; CHECK-LABEL: getus2:
698 ; CHECK: # %bb.0: # %entry
699 ; CHECK-NEXT: addi 3, 1, -16
700 ; CHECK-NEXT: stxvw4x 34, 0, 3
701 ; CHECK-NEXT: lhz 3, -12(1)
704 %vecext = extractelement <8 x i16> %vus, i32 2
708 ; Function Attrs: norecurse nounwind readnone
709 define zeroext i16 @getus3(<8 x i16> %vus) {
710 ; CHECK-LABEL: getus3:
711 ; CHECK: # %bb.0: # %entry
712 ; CHECK-NEXT: addi 3, 1, -16
713 ; CHECK-NEXT: stxvw4x 34, 0, 3
714 ; CHECK-NEXT: lhz 3, -10(1)
717 %vecext = extractelement <8 x i16> %vus, i32 3
721 ; Function Attrs: norecurse nounwind readnone
722 define zeroext i16 @getus4(<8 x i16> %vus) {
723 ; CHECK-LABEL: getus4:
724 ; CHECK: # %bb.0: # %entry
725 ; CHECK-NEXT: addi 3, 1, -16
726 ; CHECK-NEXT: stxvw4x 34, 0, 3
727 ; CHECK-NEXT: lhz 3, -8(1)
730 %vecext = extractelement <8 x i16> %vus, i32 4
734 ; Function Attrs: norecurse nounwind readnone
735 define zeroext i16 @getus5(<8 x i16> %vus) {
736 ; CHECK-LABEL: getus5:
737 ; CHECK: # %bb.0: # %entry
738 ; CHECK-NEXT: addi 3, 1, -16
739 ; CHECK-NEXT: stxvw4x 34, 0, 3
740 ; CHECK-NEXT: lhz 3, -6(1)
743 %vecext = extractelement <8 x i16> %vus, i32 5
747 ; Function Attrs: norecurse nounwind readnone
748 define zeroext i16 @getus6(<8 x i16> %vus) {
749 ; CHECK-LABEL: getus6:
750 ; CHECK: # %bb.0: # %entry
751 ; CHECK-NEXT: addi 3, 1, -16
752 ; CHECK-NEXT: stxvw4x 34, 0, 3
753 ; CHECK-NEXT: lhz 3, -4(1)
756 %vecext = extractelement <8 x i16> %vus, i32 6
760 ; Function Attrs: norecurse nounwind readnone
761 define zeroext i16 @getus7(<8 x i16> %vus) {
762 ; CHECK-LABEL: getus7:
763 ; CHECK: # %bb.0: # %entry
764 ; CHECK-NEXT: addi 3, 1, -16
765 ; CHECK-NEXT: stxvw4x 34, 0, 3
766 ; CHECK-NEXT: lhz 3, -2(1)
769 %vecext = extractelement <8 x i16> %vus, i32 7
773 ; Function Attrs: norecurse nounwind readnone
774 define signext i16 @getvelss(<8 x i16> %vss, i32 signext %i) {
775 ; CHECK-LABEL: getvelss:
776 ; CHECK: # %bb.0: # %entry
777 ; CHECK-NEXT: addi 4, 1, -16
778 ; CHECK-NEXT: rlwinm 3, 3, 1, 28, 30
779 ; CHECK-NEXT: stxvw4x 34, 0, 4
780 ; CHECK-NEXT: lhax 3, 4, 3
783 %vecext = extractelement <8 x i16> %vss, i32 %i
787 ; Function Attrs: norecurse nounwind readnone
788 define zeroext i16 @getvelus(<8 x i16> %vus, i32 signext %i) {
789 ; CHECK-LABEL: getvelus:
790 ; CHECK: # %bb.0: # %entry
791 ; CHECK-NEXT: addi 4, 1, -16
792 ; CHECK-NEXT: rlwinm 3, 3, 1, 28, 30
793 ; CHECK-NEXT: stxvw4x 34, 0, 4
794 ; CHECK-NEXT: lhzx 3, 4, 3
797 %vecext = extractelement <8 x i16> %vus, i32 %i
801 ; Function Attrs: norecurse nounwind readnone
802 define signext i32 @getsi0(<4 x i32> %vsi) {
803 ; CHECK-LABEL: getsi0:
804 ; CHECK: # %bb.0: # %entry
805 ; CHECK-NEXT: addi 3, 1, -16
806 ; CHECK-NEXT: stxvw4x 34, 0, 3
807 ; CHECK-NEXT: lwz 3, -16(1)
810 %vecext = extractelement <4 x i32> %vsi, i32 0
814 ; Function Attrs: norecurse nounwind readnone
815 define signext i32 @getsi1(<4 x i32> %vsi) {
816 ; CHECK-LABEL: getsi1:
817 ; CHECK: # %bb.0: # %entry
818 ; CHECK-NEXT: addi 3, 1, -16
819 ; CHECK-NEXT: stxvw4x 34, 0, 3
820 ; CHECK-NEXT: lwz 3, -12(1)
823 %vecext = extractelement <4 x i32> %vsi, i32 1
827 ; Function Attrs: norecurse nounwind readnone
828 define signext i32 @getsi2(<4 x i32> %vsi) {
829 ; CHECK-LABEL: getsi2:
830 ; CHECK: # %bb.0: # %entry
831 ; CHECK-NEXT: addi 3, 1, -16
832 ; CHECK-NEXT: stxvw4x 34, 0, 3
833 ; CHECK-NEXT: lwz 3, -8(1)
836 %vecext = extractelement <4 x i32> %vsi, i32 2
840 ; Function Attrs: norecurse nounwind readnone
841 define signext i32 @getsi3(<4 x i32> %vsi) {
842 ; CHECK-LABEL: getsi3:
843 ; CHECK: # %bb.0: # %entry
844 ; CHECK-NEXT: addi 3, 1, -16
845 ; CHECK-NEXT: stxvw4x 34, 0, 3
846 ; CHECK-NEXT: lwz 3, -4(1)
849 %vecext = extractelement <4 x i32> %vsi, i32 3
853 ; Function Attrs: norecurse nounwind readnone
854 define zeroext i32 @getui0(<4 x i32> %vui) {
855 ; CHECK-LABEL: getui0:
856 ; CHECK: # %bb.0: # %entry
857 ; CHECK-NEXT: addi 3, 1, -16
858 ; CHECK-NEXT: stxvw4x 34, 0, 3
859 ; CHECK-NEXT: lwz 3, -16(1)
862 %vecext = extractelement <4 x i32> %vui, i32 0
866 ; Function Attrs: norecurse nounwind readnone
867 define zeroext i32 @getui1(<4 x i32> %vui) {
868 ; CHECK-LABEL: getui1:
869 ; CHECK: # %bb.0: # %entry
870 ; CHECK-NEXT: addi 3, 1, -16
871 ; CHECK-NEXT: stxvw4x 34, 0, 3
872 ; CHECK-NEXT: lwz 3, -12(1)
875 %vecext = extractelement <4 x i32> %vui, i32 1
879 ; Function Attrs: norecurse nounwind readnone
880 define zeroext i32 @getui2(<4 x i32> %vui) {
881 ; CHECK-LABEL: getui2:
882 ; CHECK: # %bb.0: # %entry
883 ; CHECK-NEXT: addi 3, 1, -16
884 ; CHECK-NEXT: stxvw4x 34, 0, 3
885 ; CHECK-NEXT: lwz 3, -8(1)
888 %vecext = extractelement <4 x i32> %vui, i32 2
892 ; Function Attrs: norecurse nounwind readnone
893 define zeroext i32 @getui3(<4 x i32> %vui) {
894 ; CHECK-LABEL: getui3:
895 ; CHECK: # %bb.0: # %entry
896 ; CHECK-NEXT: addi 3, 1, -16
897 ; CHECK-NEXT: stxvw4x 34, 0, 3
898 ; CHECK-NEXT: lwz 3, -4(1)
901 %vecext = extractelement <4 x i32> %vui, i32 3
905 ; Function Attrs: norecurse nounwind readnone
906 define signext i32 @getvelsi(<4 x i32> %vsi, i32 signext %i) {
907 ; CHECK-LABEL: getvelsi:
908 ; CHECK: # %bb.0: # %entry
909 ; CHECK-NEXT: addi 4, 1, -16
910 ; CHECK-NEXT: rlwinm 3, 3, 2, 28, 29
911 ; CHECK-NEXT: stxvw4x 34, 0, 4
912 ; CHECK-NEXT: lwzx 3, 4, 3
915 %vecext = extractelement <4 x i32> %vsi, i32 %i
919 ; Function Attrs: norecurse nounwind readnone
920 define zeroext i32 @getvelui(<4 x i32> %vui, i32 signext %i) {
921 ; CHECK-LABEL: getvelui:
922 ; CHECK: # %bb.0: # %entry
923 ; CHECK-NEXT: addi 4, 1, -16
924 ; CHECK-NEXT: rlwinm 3, 3, 2, 28, 29
925 ; CHECK-NEXT: stxvw4x 34, 0, 4
926 ; CHECK-NEXT: lwzx 3, 4, 3
929 %vecext = extractelement <4 x i32> %vui, i32 %i
933 ; Function Attrs: norecurse nounwind readnone
934 define i64 @getsl0(<2 x i64> %vsl) {
935 ; CHECK-LABEL: getsl0:
936 ; CHECK: # %bb.0: # %entry
937 ; CHECK-NEXT: addi 3, 1, -16
938 ; CHECK-NEXT: stxvw4x 34, 0, 3
939 ; CHECK-NEXT: lwz 3, -16(1)
940 ; CHECK-NEXT: lwz 4, -12(1)
943 %vecext = extractelement <2 x i64> %vsl, i32 0
947 ; Function Attrs: norecurse nounwind readnone
948 define i64 @getsl1(<2 x i64> %vsl) {
949 ; CHECK-LABEL: getsl1:
950 ; CHECK: # %bb.0: # %entry
951 ; CHECK-NEXT: addi 3, 1, -16
952 ; CHECK-NEXT: stxvw4x 34, 0, 3
953 ; CHECK-NEXT: lwz 3, -8(1)
954 ; CHECK-NEXT: lwz 4, -4(1)
957 %vecext = extractelement <2 x i64> %vsl, i32 1
961 ; Function Attrs: norecurse nounwind readnone
962 define i64 @getul0(<2 x i64> %vul) {
963 ; CHECK-LABEL: getul0:
964 ; CHECK: # %bb.0: # %entry
965 ; CHECK-NEXT: addi 3, 1, -16
966 ; CHECK-NEXT: stxvw4x 34, 0, 3
967 ; CHECK-NEXT: lwz 3, -16(1)
968 ; CHECK-NEXT: lwz 4, -12(1)
971 %vecext = extractelement <2 x i64> %vul, i32 0
975 ; Function Attrs: norecurse nounwind readnone
976 define i64 @getul1(<2 x i64> %vul) {
977 ; CHECK-LABEL: getul1:
978 ; CHECK: # %bb.0: # %entry
979 ; CHECK-NEXT: addi 3, 1, -16
980 ; CHECK-NEXT: stxvw4x 34, 0, 3
981 ; CHECK-NEXT: lwz 3, -8(1)
982 ; CHECK-NEXT: lwz 4, -4(1)
985 %vecext = extractelement <2 x i64> %vul, i32 1
989 ; Function Attrs: norecurse nounwind readnone
990 define i64 @getvelsl(<2 x i64> %vsl, i32 signext %i) {
991 ; CHECK-LABEL: getvelsl:
992 ; CHECK: # %bb.0: # %entry
993 ; CHECK-NEXT: add 5, 3, 3
994 ; CHECK-NEXT: addi 4, 1, -16
995 ; CHECK-NEXT: rlwinm 3, 5, 2, 28, 29
996 ; CHECK-NEXT: addi 5, 5, 1
997 ; CHECK-NEXT: stxvw4x 34, 0, 4
998 ; CHECK-NEXT: rlwinm 5, 5, 2, 28, 29
999 ; CHECK-NEXT: lwzx 3, 4, 3
1000 ; CHECK-NEXT: lwzx 4, 4, 5
1003 %vecext = extractelement <2 x i64> %vsl, i32 %i
1007 ; Function Attrs: norecurse nounwind readnone
1008 define i64 @getvelul(<2 x i64> %vul, i32 signext %i) {
1009 ; CHECK-LABEL: getvelul:
1010 ; CHECK: # %bb.0: # %entry
1011 ; CHECK-NEXT: add 5, 3, 3
1012 ; CHECK-NEXT: addi 4, 1, -16
1013 ; CHECK-NEXT: rlwinm 3, 5, 2, 28, 29
1014 ; CHECK-NEXT: addi 5, 5, 1
1015 ; CHECK-NEXT: stxvw4x 34, 0, 4
1016 ; CHECK-NEXT: rlwinm 5, 5, 2, 28, 29
1017 ; CHECK-NEXT: lwzx 3, 4, 3
1018 ; CHECK-NEXT: lwzx 4, 4, 5
1021 %vecext = extractelement <2 x i64> %vul, i32 %i
1025 ; Function Attrs: norecurse nounwind readnone
1026 define float @getf0(<4 x float> %vf) {
1027 ; CHECK-LABEL: getf0:
1028 ; CHECK: # %bb.0: # %entry
1029 ; CHECK-NEXT: xscvspdpn 1, 34
1032 %vecext = extractelement <4 x float> %vf, i32 0
1036 ; Function Attrs: norecurse nounwind readnone
1037 define float @getf1(<4 x float> %vf) {
1038 ; CHECK-LABEL: getf1:
1039 ; CHECK: # %bb.0: # %entry
1040 ; CHECK-NEXT: xxsldwi 0, 34, 34, 1
1041 ; CHECK-NEXT: xscvspdpn 1, 0
1044 %vecext = extractelement <4 x float> %vf, i32 1
1048 ; Function Attrs: norecurse nounwind readnone
1049 define float @getf2(<4 x float> %vf) {
1050 ; CHECK-LABEL: getf2:
1051 ; CHECK: # %bb.0: # %entry
1052 ; CHECK-NEXT: xxswapd 0, 34
1053 ; CHECK-NEXT: xscvspdpn 1, 0
1056 %vecext = extractelement <4 x float> %vf, i32 2
1060 ; Function Attrs: norecurse nounwind readnone
1061 define float @getf3(<4 x float> %vf) {
1062 ; CHECK-LABEL: getf3:
1063 ; CHECK: # %bb.0: # %entry
1064 ; CHECK-NEXT: xxsldwi 0, 34, 34, 3
1065 ; CHECK-NEXT: xscvspdpn 1, 0
1068 %vecext = extractelement <4 x float> %vf, i32 3
1072 ; Function Attrs: norecurse nounwind readnone
1073 define float @getvelf(<4 x float> %vf, i32 signext %i) {
1074 ; CHECK-LABEL: getvelf:
1075 ; CHECK: # %bb.0: # %entry
1076 ; CHECK-NEXT: slwi 3, 3, 2
1077 ; CHECK-NEXT: lvsl 3, 0, 3
1078 ; CHECK-NEXT: vperm 2, 2, 2, 3
1079 ; CHECK-NEXT: xscvspdpn 1, 34
1082 %vecext = extractelement <4 x float> %vf, i32 %i
1086 ; Function Attrs: norecurse nounwind readnone
1087 define double @getd0(<2 x double> %vd) {
1088 ; CHECK-LABEL: getd0:
1089 ; CHECK: # %bb.0: # %entry
1090 ; CHECK-NEXT: xxlor 1, 34, 34
1093 %vecext = extractelement <2 x double> %vd, i32 0
1097 ; Function Attrs: norecurse nounwind readnone
1098 define double @getd1(<2 x double> %vd) {
1099 ; CHECK-LABEL: getd1:
1100 ; CHECK: # %bb.0: # %entry
1101 ; CHECK-NEXT: xxswapd 1, 34
1104 %vecext = extractelement <2 x double> %vd, i32 1
1108 ; Function Attrs: norecurse nounwind readnone
1109 define double @getveld(<2 x double> %vd, i32 signext %i) {
1110 ; CHECK-LABEL: getveld:
1111 ; CHECK: # %bb.0: # %entry
1112 ; CHECK-NEXT: andi. 3, 3, 1
1113 ; CHECK-NEXT: slwi 3, 3, 3
1114 ; CHECK-NEXT: lvsl 3, 0, 3
1115 ; CHECK-NEXT: vperm 2, 2, 2, 3
1116 ; CHECK-NEXT: xxlor 1, 34, 34
1119 %vecext = extractelement <2 x double> %vd, i32 %i