1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
3 target datalayout = "E-m:e-i64:64-n32:64"
4 target triple = "powerpc64-unknown-linux-gnu"
6 define <16 x i8> @test_l_v16i8(<16 x i8>* %p) #0 {
7 ; CHECK-LABEL: test_l_v16i8:
8 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: lvsl 3, 0, 3
11 ; CHECK-NEXT: lvx 2, 3, 4
12 ; CHECK-NEXT: lvx 4, 0, 3
13 ; CHECK-NEXT: vperm 2, 4, 2, 3
16 %r = load <16 x i8>, <16 x i8>* %p, align 1
21 define <32 x i8> @test_l_v32i8(<32 x i8>* %p) #0 {
22 ; CHECK-LABEL: test_l_v32i8:
23 ; CHECK: # %bb.0: # %entry
24 ; CHECK-NEXT: li 4, 31
25 ; CHECK-NEXT: lvsl 5, 0, 3
26 ; CHECK-NEXT: lvx 2, 3, 4
27 ; CHECK-NEXT: li 4, 16
28 ; CHECK-NEXT: lvx 4, 3, 4
29 ; CHECK-NEXT: lvx 0, 0, 3
30 ; CHECK-NEXT: vperm 3, 4, 2, 5
31 ; CHECK-NEXT: vperm 2, 0, 4, 5
34 %r = load <32 x i8>, <32 x i8>* %p, align 1
39 define <8 x i16> @test_l_v8i16(<8 x i16>* %p) #0 {
40 ; CHECK-LABEL: test_l_v8i16:
41 ; CHECK: # %bb.0: # %entry
42 ; CHECK-NEXT: li 4, 15
43 ; CHECK-NEXT: lvsl 3, 0, 3
44 ; CHECK-NEXT: lvx 2, 3, 4
45 ; CHECK-NEXT: lvx 4, 0, 3
46 ; CHECK-NEXT: vperm 2, 4, 2, 3
49 %r = load <8 x i16>, <8 x i16>* %p, align 2
54 define <16 x i16> @test_l_v16i16(<16 x i16>* %p) #0 {
55 ; CHECK-LABEL: test_l_v16i16:
56 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: li 4, 31
58 ; CHECK-NEXT: lvsl 5, 0, 3
59 ; CHECK-NEXT: lvx 2, 3, 4
60 ; CHECK-NEXT: li 4, 16
61 ; CHECK-NEXT: lvx 4, 3, 4
62 ; CHECK-NEXT: lvx 0, 0, 3
63 ; CHECK-NEXT: vperm 3, 4, 2, 5
64 ; CHECK-NEXT: vperm 2, 0, 4, 5
67 %r = load <16 x i16>, <16 x i16>* %p, align 2
72 define <4 x i32> @test_l_v4i32(<4 x i32>* %p) #0 {
73 ; CHECK-LABEL: test_l_v4i32:
74 ; CHECK: # %bb.0: # %entry
75 ; CHECK-NEXT: li 4, 15
76 ; CHECK-NEXT: lvsl 3, 0, 3
77 ; CHECK-NEXT: lvx 2, 3, 4
78 ; CHECK-NEXT: lvx 4, 0, 3
79 ; CHECK-NEXT: vperm 2, 4, 2, 3
82 %r = load <4 x i32>, <4 x i32>* %p, align 4
87 define <8 x i32> @test_l_v8i32(<8 x i32>* %p) #0 {
88 ; CHECK-LABEL: test_l_v8i32:
89 ; CHECK: # %bb.0: # %entry
90 ; CHECK-NEXT: li 4, 31
91 ; CHECK-NEXT: lvsl 5, 0, 3
92 ; CHECK-NEXT: lvx 2, 3, 4
93 ; CHECK-NEXT: li 4, 16
94 ; CHECK-NEXT: lvx 4, 3, 4
95 ; CHECK-NEXT: lvx 0, 0, 3
96 ; CHECK-NEXT: vperm 3, 4, 2, 5
97 ; CHECK-NEXT: vperm 2, 0, 4, 5
100 %r = load <8 x i32>, <8 x i32>* %p, align 4
105 define <2 x i64> @test_l_v2i64(<2 x i64>* %p) #0 {
106 ; CHECK-LABEL: test_l_v2i64:
107 ; CHECK: # %bb.0: # %entry
108 ; CHECK-NEXT: lxvd2x 34, 0, 3
111 %r = load <2 x i64>, <2 x i64>* %p, align 8
116 define <4 x i64> @test_l_v4i64(<4 x i64>* %p) #0 {
117 ; CHECK-LABEL: test_l_v4i64:
118 ; CHECK: # %bb.0: # %entry
119 ; CHECK-NEXT: li 4, 16
120 ; CHECK-NEXT: lxvd2x 34, 0, 3
121 ; CHECK-NEXT: lxvd2x 35, 3, 4
124 %r = load <4 x i64>, <4 x i64>* %p, align 8
129 define <4 x float> @test_l_v4float(<4 x float>* %p) #0 {
130 ; CHECK-LABEL: test_l_v4float:
131 ; CHECK: # %bb.0: # %entry
132 ; CHECK-NEXT: li 4, 15
133 ; CHECK-NEXT: lvsl 3, 0, 3
134 ; CHECK-NEXT: lvx 2, 3, 4
135 ; CHECK-NEXT: lvx 4, 0, 3
136 ; CHECK-NEXT: vperm 2, 4, 2, 3
139 %r = load <4 x float>, <4 x float>* %p, align 4
144 define <8 x float> @test_l_v8float(<8 x float>* %p) #0 {
145 ; CHECK-LABEL: test_l_v8float:
146 ; CHECK: # %bb.0: # %entry
147 ; CHECK-NEXT: li 4, 31
148 ; CHECK-NEXT: lvsl 5, 0, 3
149 ; CHECK-NEXT: lvx 2, 3, 4
150 ; CHECK-NEXT: li 4, 16
151 ; CHECK-NEXT: lvx 4, 3, 4
152 ; CHECK-NEXT: lvx 0, 0, 3
153 ; CHECK-NEXT: vperm 3, 4, 2, 5
154 ; CHECK-NEXT: vperm 2, 0, 4, 5
157 %r = load <8 x float>, <8 x float>* %p, align 4
162 define <2 x double> @test_l_v2double(<2 x double>* %p) #0 {
163 ; CHECK-LABEL: test_l_v2double:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: lxvd2x 34, 0, 3
168 %r = load <2 x double>, <2 x double>* %p, align 8
173 define <4 x double> @test_l_v4double(<4 x double>* %p) #0 {
174 ; CHECK-LABEL: test_l_v4double:
175 ; CHECK: # %bb.0: # %entry
176 ; CHECK-NEXT: li 4, 16
177 ; CHECK-NEXT: lxvd2x 34, 0, 3
178 ; CHECK-NEXT: lxvd2x 35, 3, 4
181 %r = load <4 x double>, <4 x double>* %p, align 8
186 define <16 x i8> @test_l_p8v16i8(<16 x i8>* %p) #2 {
187 ; CHECK-LABEL: test_l_p8v16i8:
188 ; CHECK: # %bb.0: # %entry
189 ; CHECK-NEXT: lxvw4x 34, 0, 3
192 %r = load <16 x i8>, <16 x i8>* %p, align 1
197 define <32 x i8> @test_l_p8v32i8(<32 x i8>* %p) #2 {
198 ; CHECK-LABEL: test_l_p8v32i8:
199 ; CHECK: # %bb.0: # %entry
200 ; CHECK-NEXT: li 4, 16
201 ; CHECK-NEXT: lxvw4x 34, 0, 3
202 ; CHECK-NEXT: lxvw4x 35, 3, 4
205 %r = load <32 x i8>, <32 x i8>* %p, align 1
210 define <8 x i16> @test_l_p8v8i16(<8 x i16>* %p) #2 {
211 ; CHECK-LABEL: test_l_p8v8i16:
212 ; CHECK: # %bb.0: # %entry
213 ; CHECK-NEXT: lxvw4x 34, 0, 3
216 %r = load <8 x i16>, <8 x i16>* %p, align 2
221 define <16 x i16> @test_l_p8v16i16(<16 x i16>* %p) #2 {
222 ; CHECK-LABEL: test_l_p8v16i16:
223 ; CHECK: # %bb.0: # %entry
224 ; CHECK-NEXT: li 4, 16
225 ; CHECK-NEXT: lxvw4x 34, 0, 3
226 ; CHECK-NEXT: lxvw4x 35, 3, 4
229 %r = load <16 x i16>, <16 x i16>* %p, align 2
234 define <4 x i32> @test_l_p8v4i32(<4 x i32>* %p) #2 {
235 ; CHECK-LABEL: test_l_p8v4i32:
236 ; CHECK: # %bb.0: # %entry
237 ; CHECK-NEXT: lxvw4x 34, 0, 3
240 %r = load <4 x i32>, <4 x i32>* %p, align 4
245 define <8 x i32> @test_l_p8v8i32(<8 x i32>* %p) #2 {
246 ; CHECK-LABEL: test_l_p8v8i32:
247 ; CHECK: # %bb.0: # %entry
248 ; CHECK-NEXT: li 4, 16
249 ; CHECK-NEXT: lxvw4x 34, 0, 3
250 ; CHECK-NEXT: lxvw4x 35, 3, 4
253 %r = load <8 x i32>, <8 x i32>* %p, align 4
258 define <2 x i64> @test_l_p8v2i64(<2 x i64>* %p) #2 {
259 ; CHECK-LABEL: test_l_p8v2i64:
260 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: lxvd2x 34, 0, 3
264 %r = load <2 x i64>, <2 x i64>* %p, align 8
269 define <4 x i64> @test_l_p8v4i64(<4 x i64>* %p) #2 {
270 ; CHECK-LABEL: test_l_p8v4i64:
271 ; CHECK: # %bb.0: # %entry
272 ; CHECK-NEXT: li 4, 16
273 ; CHECK-NEXT: lxvd2x 34, 0, 3
274 ; CHECK-NEXT: lxvd2x 35, 3, 4
277 %r = load <4 x i64>, <4 x i64>* %p, align 8
282 define <4 x float> @test_l_p8v4float(<4 x float>* %p) #2 {
283 ; CHECK-LABEL: test_l_p8v4float:
284 ; CHECK: # %bb.0: # %entry
285 ; CHECK-NEXT: lxvw4x 34, 0, 3
288 %r = load <4 x float>, <4 x float>* %p, align 4
293 define <8 x float> @test_l_p8v8float(<8 x float>* %p) #2 {
294 ; CHECK-LABEL: test_l_p8v8float:
295 ; CHECK: # %bb.0: # %entry
296 ; CHECK-NEXT: li 4, 16
297 ; CHECK-NEXT: lxvw4x 34, 0, 3
298 ; CHECK-NEXT: lxvw4x 35, 3, 4
301 %r = load <8 x float>, <8 x float>* %p, align 4
306 define <2 x double> @test_l_p8v2double(<2 x double>* %p) #2 {
307 ; CHECK-LABEL: test_l_p8v2double:
308 ; CHECK: # %bb.0: # %entry
309 ; CHECK-NEXT: lxvd2x 34, 0, 3
312 %r = load <2 x double>, <2 x double>* %p, align 8
317 define <4 x double> @test_l_p8v4double(<4 x double>* %p) #2 {
318 ; CHECK-LABEL: test_l_p8v4double:
319 ; CHECK: # %bb.0: # %entry
320 ; CHECK-NEXT: li 4, 16
321 ; CHECK-NEXT: lxvd2x 34, 0, 3
322 ; CHECK-NEXT: lxvd2x 35, 3, 4
325 %r = load <4 x double>, <4 x double>* %p, align 8
330 define <4 x float> @test_l_qv4float(<4 x float>* %p) #1 {
331 ; CHECK-LABEL: test_l_qv4float:
332 ; CHECK: # %bb.0: # %entry
333 ; CHECK-NEXT: li 4, 15
334 ; CHECK-NEXT: qvlpclsx 0, 0, 3
335 ; CHECK-NEXT: qvlfsx 1, 3, 4
336 ; CHECK-NEXT: qvlfsx 2, 0, 3
337 ; CHECK-NEXT: qvfperm 1, 2, 1, 0
340 %r = load <4 x float>, <4 x float>* %p, align 4
345 define <8 x float> @test_l_qv8float(<8 x float>* %p) #1 {
346 ; CHECK-LABEL: test_l_qv8float:
347 ; CHECK: # %bb.0: # %entry
348 ; CHECK-NEXT: li 4, 31
349 ; CHECK-NEXT: qvlpclsx 1, 0, 3
350 ; CHECK-NEXT: qvlfsx 0, 3, 4
351 ; CHECK-NEXT: li 4, 16
352 ; CHECK-NEXT: qvlfsx 3, 3, 4
353 ; CHECK-NEXT: qvlfsx 4, 0, 3
354 ; CHECK-NEXT: qvfperm 2, 3, 0, 1
355 ; CHECK-NEXT: qvfperm 1, 4, 3, 1
358 %r = load <8 x float>, <8 x float>* %p, align 4
363 define <4 x double> @test_l_qv4double(<4 x double>* %p) #1 {
364 ; CHECK-LABEL: test_l_qv4double:
365 ; CHECK: # %bb.0: # %entry
366 ; CHECK-NEXT: li 4, 31
367 ; CHECK-NEXT: qvlpcldx 0, 0, 3
368 ; CHECK-NEXT: qvlfdx 1, 3, 4
369 ; CHECK-NEXT: qvlfdx 2, 0, 3
370 ; CHECK-NEXT: qvfperm 1, 2, 1, 0
373 %r = load <4 x double>, <4 x double>* %p, align 8
378 define <8 x double> @test_l_qv8double(<8 x double>* %p) #1 {
379 ; CHECK-LABEL: test_l_qv8double:
380 ; CHECK: # %bb.0: # %entry
381 ; CHECK-NEXT: li 4, 63
382 ; CHECK-NEXT: qvlpcldx 1, 0, 3
383 ; CHECK-NEXT: qvlfdx 0, 3, 4
384 ; CHECK-NEXT: li 4, 32
385 ; CHECK-NEXT: qvlfdx 3, 3, 4
386 ; CHECK-NEXT: qvlfdx 4, 0, 3
387 ; CHECK-NEXT: qvfperm 2, 3, 0, 1
388 ; CHECK-NEXT: qvfperm 1, 4, 3, 1
391 %r = load <8 x double>, <8 x double>* %p, align 8
396 define void @test_s_v16i8(<16 x i8>* %p, <16 x i8> %v) #0 {
397 ; CHECK-LABEL: test_s_v16i8:
398 ; CHECK: # %bb.0: # %entry
399 ; CHECK-NEXT: stxvw4x 34, 0, 3
402 store <16 x i8> %v, <16 x i8>* %p, align 1
407 define void @test_s_v32i8(<32 x i8>* %p, <32 x i8> %v) #0 {
408 ; CHECK-LABEL: test_s_v32i8:
409 ; CHECK: # %bb.0: # %entry
410 ; CHECK-NEXT: li 4, 16
411 ; CHECK-NEXT: stxvw4x 34, 0, 3
412 ; CHECK-NEXT: stxvw4x 35, 3, 4
415 store <32 x i8> %v, <32 x i8>* %p, align 1
420 define void @test_s_v8i16(<8 x i16>* %p, <8 x i16> %v) #0 {
421 ; CHECK-LABEL: test_s_v8i16:
422 ; CHECK: # %bb.0: # %entry
423 ; CHECK-NEXT: stxvw4x 34, 0, 3
426 store <8 x i16> %v, <8 x i16>* %p, align 2
431 define void @test_s_v16i16(<16 x i16>* %p, <16 x i16> %v) #0 {
432 ; CHECK-LABEL: test_s_v16i16:
433 ; CHECK: # %bb.0: # %entry
434 ; CHECK-NEXT: li 4, 16
435 ; CHECK-NEXT: stxvw4x 34, 0, 3
436 ; CHECK-NEXT: stxvw4x 35, 3, 4
439 store <16 x i16> %v, <16 x i16>* %p, align 2
444 define void @test_s_v4i32(<4 x i32>* %p, <4 x i32> %v) #0 {
445 ; CHECK-LABEL: test_s_v4i32:
446 ; CHECK: # %bb.0: # %entry
447 ; CHECK-NEXT: stxvw4x 34, 0, 3
450 store <4 x i32> %v, <4 x i32>* %p, align 4
455 define void @test_s_v8i32(<8 x i32>* %p, <8 x i32> %v) #0 {
456 ; CHECK-LABEL: test_s_v8i32:
457 ; CHECK: # %bb.0: # %entry
458 ; CHECK-NEXT: li 4, 16
459 ; CHECK-NEXT: stxvw4x 34, 0, 3
460 ; CHECK-NEXT: stxvw4x 35, 3, 4
463 store <8 x i32> %v, <8 x i32>* %p, align 4
468 define void @test_s_v2i64(<2 x i64>* %p, <2 x i64> %v) #0 {
469 ; CHECK-LABEL: test_s_v2i64:
470 ; CHECK: # %bb.0: # %entry
471 ; CHECK-NEXT: stxvd2x 34, 0, 3
474 store <2 x i64> %v, <2 x i64>* %p, align 8
479 define void @test_s_v4i64(<4 x i64>* %p, <4 x i64> %v) #0 {
480 ; CHECK-LABEL: test_s_v4i64:
481 ; CHECK: # %bb.0: # %entry
482 ; CHECK-NEXT: li 4, 16
483 ; CHECK-NEXT: stxvd2x 34, 0, 3
484 ; CHECK-NEXT: stxvd2x 35, 3, 4
487 store <4 x i64> %v, <4 x i64>* %p, align 8
492 define void @test_s_v4float(<4 x float>* %p, <4 x float> %v) #0 {
493 ; CHECK-LABEL: test_s_v4float:
494 ; CHECK: # %bb.0: # %entry
495 ; CHECK-NEXT: stxvw4x 34, 0, 3
498 store <4 x float> %v, <4 x float>* %p, align 4
503 define void @test_s_v8float(<8 x float>* %p, <8 x float> %v) #0 {
504 ; CHECK-LABEL: test_s_v8float:
505 ; CHECK: # %bb.0: # %entry
506 ; CHECK-NEXT: li 4, 16
507 ; CHECK-NEXT: stxvw4x 34, 0, 3
508 ; CHECK-NEXT: stxvw4x 35, 3, 4
511 store <8 x float> %v, <8 x float>* %p, align 4
516 define void @test_s_v2double(<2 x double>* %p, <2 x double> %v) #0 {
517 ; CHECK-LABEL: test_s_v2double:
518 ; CHECK: # %bb.0: # %entry
519 ; CHECK-NEXT: stxvd2x 34, 0, 3
522 store <2 x double> %v, <2 x double>* %p, align 8
527 define void @test_s_v4double(<4 x double>* %p, <4 x double> %v) #0 {
528 ; CHECK-LABEL: test_s_v4double:
529 ; CHECK: # %bb.0: # %entry
530 ; CHECK-NEXT: li 4, 16
531 ; CHECK-NEXT: stxvd2x 34, 0, 3
532 ; CHECK-NEXT: stxvd2x 35, 3, 4
535 store <4 x double> %v, <4 x double>* %p, align 8
540 define void @test_s_qv4float(<4 x float>* %p, <4 x float> %v) #1 {
541 ; CHECK-LABEL: test_s_qv4float:
542 ; CHECK: # %bb.0: # %entry
543 ; CHECK-NEXT: qvesplati 0, 1, 3
544 ; CHECK-NEXT: stfs 1, 0(3)
545 ; CHECK-NEXT: stfs 0, 12(3)
546 ; CHECK-NEXT: qvesplati 0, 1, 2
547 ; CHECK-NEXT: qvesplati 1, 1, 1
548 ; CHECK-NEXT: stfs 0, 8(3)
549 ; CHECK-NEXT: stfs 1, 4(3)
552 store <4 x float> %v, <4 x float>* %p, align 4
557 define void @test_s_qv8float(<8 x float>* %p, <8 x float> %v) #1 {
558 ; CHECK-LABEL: test_s_qv8float:
559 ; CHECK: # %bb.0: # %entry
560 ; CHECK-NEXT: qvesplati 0, 2, 3
561 ; CHECK-NEXT: stfs 2, 16(3)
562 ; CHECK-NEXT: stfs 0, 28(3)
563 ; CHECK-NEXT: qvesplati 0, 2, 2
564 ; CHECK-NEXT: qvesplati 2, 2, 1
565 ; CHECK-NEXT: stfs 1, 0(3)
566 ; CHECK-NEXT: stfs 0, 24(3)
567 ; CHECK-NEXT: qvesplati 0, 1, 3
568 ; CHECK-NEXT: stfs 2, 20(3)
569 ; CHECK-NEXT: qvesplati 2, 1, 2
570 ; CHECK-NEXT: qvesplati 1, 1, 1
571 ; CHECK-NEXT: stfs 0, 12(3)
572 ; CHECK-NEXT: stfs 2, 8(3)
573 ; CHECK-NEXT: stfs 1, 4(3)
576 store <8 x float> %v, <8 x float>* %p, align 4
581 define void @test_s_qv4double(<4 x double>* %p, <4 x double> %v) #1 {
582 ; CHECK-LABEL: test_s_qv4double:
583 ; CHECK: # %bb.0: # %entry
584 ; CHECK-NEXT: qvesplati 0, 1, 3
585 ; CHECK-NEXT: stfd 1, 0(3)
586 ; CHECK-NEXT: stfd 0, 24(3)
587 ; CHECK-NEXT: qvesplati 0, 1, 2
588 ; CHECK-NEXT: qvesplati 1, 1, 1
589 ; CHECK-NEXT: stfd 0, 16(3)
590 ; CHECK-NEXT: stfd 1, 8(3)
593 store <4 x double> %v, <4 x double>* %p, align 8
598 define void @test_s_qv8double(<8 x double>* %p, <8 x double> %v) #1 {
599 ; CHECK-LABEL: test_s_qv8double:
600 ; CHECK: # %bb.0: # %entry
601 ; CHECK-NEXT: qvesplati 0, 2, 3
602 ; CHECK-NEXT: stfd 2, 32(3)
603 ; CHECK-NEXT: stfd 0, 56(3)
604 ; CHECK-NEXT: qvesplati 0, 2, 2
605 ; CHECK-NEXT: qvesplati 2, 2, 1
606 ; CHECK-NEXT: stfd 1, 0(3)
607 ; CHECK-NEXT: stfd 0, 48(3)
608 ; CHECK-NEXT: qvesplati 0, 1, 3
609 ; CHECK-NEXT: stfd 2, 40(3)
610 ; CHECK-NEXT: qvesplati 2, 1, 2
611 ; CHECK-NEXT: qvesplati 1, 1, 1
612 ; CHECK-NEXT: stfd 0, 24(3)
613 ; CHECK-NEXT: stfd 2, 16(3)
614 ; CHECK-NEXT: stfd 1, 8(3)
617 store <8 x double> %v, <8 x double>* %p, align 8
622 attributes #0 = { nounwind "target-cpu"="pwr7" }
623 attributes #1 = { nounwind "target-cpu"="a2q" }
624 attributes #2 = { nounwind "target-cpu"="pwr8" }