1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-vsr-nums-as-vr \
3 ; RUN: -ppc-asm-full-reg-names -verify-machineinstrs < %s | FileCheck %s
5 ; Function Attrs: norecurse nounwind readonly
6 define <4 x double> @foo(double* nocapture readonly %a) #0 {
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: lxvdsx v2, 0, r3
10 ; CHECK-NEXT: vmr v3, v2
13 %0 = load double, double* %a, align 8
14 %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
15 %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
16 ret <4 x double> %shuffle.i
19 define <4 x double> @foox(double* nocapture readonly %a, i64 %idx) #0 {
21 ; CHECK: # %bb.0: # %entry
22 ; CHECK-NEXT: sldi r4, r4, 3
23 ; CHECK-NEXT: lxvdsx v2, r3, r4
24 ; CHECK-NEXT: vmr v3, v2
27 %p = getelementptr double, double* %a, i64 %idx
28 %0 = load double, double* %p, align 8
29 %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
30 %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
31 ret <4 x double> %shuffle.i
34 define <4 x double> @fooxu(double* nocapture readonly %a, i64 %idx, double** %pptr) #0 {
36 ; CHECK: # %bb.0: # %entry
37 ; CHECK-NEXT: sldi r4, r4, 3
38 ; CHECK-NEXT: add r6, r3, r4
39 ; CHECK-NEXT: std r6, 0(r5)
40 ; CHECK-NEXT: lxvdsx v2, r3, r4
41 ; CHECK-NEXT: vmr v3, v2
44 %p = getelementptr double, double* %a, i64 %idx
45 %0 = load double, double* %p, align 8
46 %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
47 %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
48 store double* %p, double** %pptr, align 8
49 ret <4 x double> %shuffle.i
52 define <4 x float> @foof(float* nocapture readonly %a) #0 {
54 ; CHECK: # %bb.0: # %entry
55 ; CHECK-NEXT: lfiwzx f0, 0, r3
56 ; CHECK-NEXT: xxpermdi vs0, f0, f0, 2
57 ; CHECK-NEXT: xxspltw v2, vs0, 3
60 %0 = load float, float* %a, align 4
61 %vecinit.i = insertelement <4 x float> undef, float %0, i32 0
62 %shuffle.i = shufflevector <4 x float> %vecinit.i, <4 x float> undef, <4 x i32> zeroinitializer
63 ret <4 x float> %shuffle.i
66 define <4 x float> @foofx(float* nocapture readonly %a, i64 %idx) #0 {
68 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: sldi r4, r4, 2
70 ; CHECK-NEXT: lfiwzx f0, r3, r4
71 ; CHECK-NEXT: xxpermdi vs0, f0, f0, 2
72 ; CHECK-NEXT: xxspltw v2, vs0, 3
75 %p = getelementptr float, float* %a, i64 %idx
76 %0 = load float, float* %p, align 4
77 %vecinit.i = insertelement <4 x float> undef, float %0, i32 0
78 %shuffle.i = shufflevector <4 x float> %vecinit.i, <4 x float> undef, <4 x i32> zeroinitializer
79 ret <4 x float> %shuffle.i