Ehsan Amiri | a538b0f | 2016-08-03 18:17:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs < %s | FileCheck %s |
Hal Finkel | fc35391 | 2016-03-31 20:39:41 +0000 | [diff] [blame] | 2 | target datalayout = "E-m:e-i64:64-n32:64" |
| 3 | target triple = "powerpc64-bgq-linux" |
| 4 | |
| 5 | ; Function Attrs: norecurse nounwind readonly |
| 6 | define <4 x double> @foo(double* nocapture readonly %a) #0 { |
| 7 | entry: |
Hal Finkel | 0f02ccd | 2016-03-31 20:45:00 +0000 | [diff] [blame] | 8 | %0 = load double, double* %a, align 8 |
Hal Finkel | fc35391 | 2016-03-31 20:39:41 +0000 | [diff] [blame] | 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 |
| 12 | |
| 13 | ; CHECK-LABEL: @foo |
| 14 | ; CHECK: lfd 1, 0(3) |
| 15 | ; CHECK: blr |
| 16 | } |
| 17 | |
| 18 | define <4 x double> @foox(double* nocapture readonly %a, i64 %idx) #0 { |
| 19 | entry: |
| 20 | %p = getelementptr double, double* %a, i64 %idx |
Hal Finkel | 0f02ccd | 2016-03-31 20:45:00 +0000 | [diff] [blame] | 21 | %0 = load double, double* %p, align 8 |
Hal Finkel | fc35391 | 2016-03-31 20:39:41 +0000 | [diff] [blame] | 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 |
| 25 | |
| 26 | ; CHECK-LABEL: @foox |
| 27 | ; CHECK: sldi [[REG1:[0-9]+]], 4, 3 |
| 28 | ; CHECK: lfdx 1, 3, [[REG1]] |
| 29 | ; CHECK: blr |
| 30 | } |
| 31 | |
| 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 |
Hal Finkel | 0f02ccd | 2016-03-31 20:45:00 +0000 | [diff] [blame] | 35 | %0 = load double, double* %p, align 8 |
Hal Finkel | fc35391 | 2016-03-31 20:39:41 +0000 | [diff] [blame] | 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 |
| 40 | |
| 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 |
| 46 | } |
| 47 | |
| 48 | define <4 x float> @foof(float* nocapture readonly %a) #0 { |
| 49 | entry: |
Hal Finkel | 0f02ccd | 2016-03-31 20:45:00 +0000 | [diff] [blame] | 50 | %0 = load float, float* %a, align 4 |
Hal Finkel | fc35391 | 2016-03-31 20:39:41 +0000 | [diff] [blame] | 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 |
| 54 | |
| 55 | ; CHECK-LABEL: @foof |
| 56 | ; CHECK: lfs 1, 0(3) |
| 57 | ; CHECK: blr |
| 58 | } |
| 59 | |
| 60 | define <4 x float> @foofx(float* nocapture readonly %a, i64 %idx) #0 { |
| 61 | entry: |
| 62 | %p = getelementptr float, float* %a, i64 %idx |
Hal Finkel | 0f02ccd | 2016-03-31 20:45:00 +0000 | [diff] [blame] | 63 | %0 = load float, float* %p, align 4 |
Hal Finkel | fc35391 | 2016-03-31 20:39:41 +0000 | [diff] [blame] | 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 |
| 67 | |
| 68 | ; CHECK-LABEL: @foofx |
| 69 | ; CHECK: sldi [[REG1:[0-9]+]], 4, 2 |
| 70 | ; CHECK: lfsx 1, 3, [[REG1]] |
| 71 | ; CHECK: blr |
| 72 | } |
| 73 | |
Hal Finkel | 0f02ccd | 2016-03-31 20:45:00 +0000 | [diff] [blame] | 74 | attributes #0 = { norecurse nounwind readonly "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" } |
Hal Finkel | fc35391 | 2016-03-31 20:39:41 +0000 | [diff] [blame] | 75 | |