• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
4; Function Attrs: norecurse nounwind readonly
5define <4 x double> @foo(double* nocapture readonly %a) #0 {
6; CHECK-LABEL: foo:
7; CHECK:       # %bb.0: # %entry
8; CHECK-NEXT:    lxvdsx v2, 0, r3
9; CHECK-NEXT:    vmr v3, v2
10; CHECK-NEXT:    blr
11entry:
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
16}
17
18define <4 x double> @foox(double* nocapture readonly %a, i64 %idx) #0 {
19; CHECK-LABEL: foox:
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
24; CHECK-NEXT:    blr
25entry:
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
31}
32
33define <4 x double> @fooxu(double* nocapture readonly %a, i64 %idx, double** %pptr) #0 {
34; CHECK-LABEL: fooxu:
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
41; CHECK-NEXT:    blr
42entry:
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
49}
50
51define <4 x float> @foof(float* nocapture readonly %a) #0 {
52; CHECK-LABEL: foof:
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
57; CHECK-NEXT:    blr
58entry:
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
63}
64
65define <4 x float> @foofx(float* nocapture readonly %a, i64 %idx) #0 {
66; CHECK-LABEL: foofx:
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
72; CHECK-NEXT:    blr
73entry:
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
79}
80
81
82