Recommit r310809 with a fix for the spill problem
[llvm-core.git] / test / CodeGen / PowerPC / qpx-load-splat.ll
blob034961815178ceccc676b914ce82ccae1632e70c
1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-bgq-linux"
5 ; Function Attrs: norecurse nounwind readonly
6 define <4 x double> @foo(double* nocapture readonly %a) #0 {
7 entry:
8   %0 = load double, double* %a, align 8
9   %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
10   %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
11   ret <4 x double> %shuffle.i
13 ; CHECK-LABEL: @foo
14 ; CHECK: lfd 1, 0(3)
15 ; CHECK: blr
18 define <4 x double> @foox(double* nocapture readonly %a, i64 %idx) #0 {
19 entry:
20   %p = getelementptr double, double* %a, i64 %idx
21   %0 = load double, double* %p, align 8
22   %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
23   %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
24   ret <4 x double> %shuffle.i
26 ; CHECK-LABEL: @foox
27 ; CHECK: sldi [[REG1:[0-9]+]], 4, 3
28 ; CHECK: lfdx 1, 3, [[REG1]]
29 ; CHECK: blr
32 define <4 x double> @fooxu(double* nocapture readonly %a, i64 %idx, double** %pptr) #0 {
33 entry:
34   %p = getelementptr double, double* %a, i64 %idx
35   %0 = load double, double* %p, align 8
36   %vecinit.i = insertelement <4 x double> undef, double %0, i32 0
37   %shuffle.i = shufflevector <4 x double> %vecinit.i, <4 x double> undef, <4 x i32> zeroinitializer
38   store double* %p, double** %pptr, align 8
39   ret <4 x double> %shuffle.i
41 ; CHECK-LABEL: @foox
42 ; CHECK: sldi [[REG1:[0-9]+]], 4, 3
43 ; CHECK: lfdux 1, 3, [[REG1]]
44 ; CHECK: std 3, 0(5)
45 ; CHECK: blr
48 define <4 x float> @foof(float* nocapture readonly %a) #0 {
49 entry:
50   %0 = load float, float* %a, align 4
51   %vecinit.i = insertelement <4 x float> undef, float %0, i32 0
52   %shuffle.i = shufflevector <4 x float> %vecinit.i, <4 x float> undef, <4 x i32> zeroinitializer
53   ret <4 x float> %shuffle.i
55 ; CHECK-LABEL: @foof
56 ; CHECK: lfs 1, 0(3)
57 ; CHECK: blr
60 define <4 x float> @foofx(float* nocapture readonly %a, i64 %idx) #0 {
61 entry:
62   %p = getelementptr float, float* %a, i64 %idx
63   %0 = load float, float* %p, align 4
64   %vecinit.i = insertelement <4 x float> undef, float %0, i32 0
65   %shuffle.i = shufflevector <4 x float> %vecinit.i, <4 x float> undef, <4 x i32> zeroinitializer
66   ret <4 x float> %shuffle.i
68 ; CHECK-LABEL: @foofx
69 ; CHECK: sldi [[REG1:[0-9]+]], 4, 2
70 ; CHECK: lfsx 1, 3, [[REG1]]
71 ; CHECK: blr
74 attributes #0 = { norecurse nounwind readonly "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }