1 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-vsr-nums-as-vr \
2 ; RUN: -ppc-asm-full-reg-names -verify-machineinstrs < %s | FileCheck %s
4 ; Function Attrs: norecurse nounwind readonly
5 define <4 x double> @foo(double* nocapture readonly %a) #0 {
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: lxvdsx v2, 0, r3
9 ; CHECK-NEXT: vmr v3, v2
12 %0 = load double, double* %a, align 8
13 %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
14 %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
15 ret <4 x double> %shuffle.i
18 define <4 x double> @foox(double* nocapture readonly %a, i64 %idx) #0 {
20 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: sldi r4, r4, 3
22 ; CHECK-NEXT: lxvdsx v2, r3, r4
23 ; CHECK-NEXT: vmr v3, v2
26 %p = getelementptr double, double* %a, i64 %idx
27 %0 = load double, double* %p, align 8
28 %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
29 %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
30 ret <4 x double> %shuffle.i
33 define <4 x double> @fooxu(double* nocapture readonly %a, i64 %idx, double** %pptr) #0 {
35 ; CHECK: # %bb.0: # %entry
36 ; CHECK-NEXT: sldi r4, r4, 3
37 ; CHECK-NEXT: lfdux f0, r3, r4
38 ; CHECK-NEXT: xxspltd v2, vs0, 0
39 ; CHECK-NEXT: std r3, 0(r5)
40 ; CHECK-NEXT: vmr v3, v2
43 %p = getelementptr double, double* %a, i64 %idx
44 %0 = load double, double* %p, align 8
45 %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
46 %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
47 store double* %p, double** %pptr, align 8
48 ret <4 x double> %shuffle.i
51 define <4 x float> @foof(float* nocapture readonly %a) #0 {
53 ; CHECK: # %bb.0: # %entry
54 ; CHECK-NEXT: lfiwzx f0, 0, r3
55 ; CHECK-NEXT: xxpermdi vs0, f0, f0, 2
56 ; CHECK-NEXT: xxspltw v2, vs0, 3
59 %0 = load float, float* %a, align 4
60 %vecinit.i = insertelement <4 x float> undef, float %0, i32 0
61 %shuffle.i = shufflevector <4 x float> %vecinit.i, <4 x float> undef, <4 x i32> zeroinitializer
62 ret <4 x float> %shuffle.i
65 define <4 x float> @foofx(float* nocapture readonly %a, i64 %idx) #0 {
67 ; CHECK: # %bb.0: # %entry
68 ; CHECK-NEXT: sldi r4, r4, 2
69 ; CHECK-NEXT: lfiwzx f0, r3, r4
70 ; CHECK-NEXT: xxpermdi vs0, f0, f0, 2
71 ; CHECK-NEXT: xxspltw v2, vs0, 3
74 %p = getelementptr float, float* %a, i64 %idx
75 %0 = load float, float* %p, align 4
76 %vecinit.i = insertelement <4 x float> undef, float %0, i32 0
77 %shuffle.i = shufflevector <4 x float> %vecinit.i, <4 x float> undef, <4 x i32> zeroinitializer
78 ret <4 x float> %shuffle.i