diff options
| author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2019-01-24 23:44:28 +0000 |
|---|---|---|
| committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2019-01-24 23:44:28 +0000 |
| commit | b9b75de0aebce6fec139ab52ab6bf4bca2d41ee9 (patch) | |
| tree | 0b61ccfdb5b115a65bc89d394c1516c51ee3f46b /llvm/test/CodeGen/PowerPC/scalar_vector_test_2.ll | |
| parent | 6bab7ab11e75f675f561162f40c9b28525b4e473 (diff) | |
| download | bcm5719-llvm-b9b75de0aebce6fec139ab52ab6bf4bca2d41ee9.tar.gz bcm5719-llvm-b9b75de0aebce6fec139ab52ab6bf4bca2d41ee9.zip | |
[PowerPC] Exploit store instructions that store a single vector element
This patch exploits the instructions that store a single element from a vector
to preform a (store (extract_elt)). We already have code that does this with
ISA 3.0 instructions that were added to handle i8/i16 types. However, we had
never exploited the existing ones that handle f32/f64/i32/i64 types.
Differential revision: https://reviews.llvm.org/D56175
llvm-svn: 352131
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/scalar_vector_test_2.ll')
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/scalar_vector_test_2.ll | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/llvm/test/CodeGen/PowerPC/scalar_vector_test_2.ll b/llvm/test/CodeGen/PowerPC/scalar_vector_test_2.ll index 96c823b7310..af695c58f1b 100644 --- a/llvm/test/CodeGen/PowerPC/scalar_vector_test_2.ll +++ b/llvm/test/CodeGen/PowerPC/scalar_vector_test_2.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \ ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P9LE ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \ @@ -15,11 +16,10 @@ define void @test_liwzx1(<1 x float>* %A, <1 x float>* %B, <1 x float>* %C) { ; P9LE-NEXT: xxpermdi vs0, f0, f0, 2 ; P9LE-NEXT: xxpermdi vs1, f1, f1, 2 ; P9LE-NEXT: xvaddsp vs0, vs0, vs1 -; P9LE-NEXT: xxsldwi vs0, vs0, vs0, 3 -; P9LE-NEXT: xscvspdpn f0, vs0 -; P9LE-NEXT: stfs f0, 0(r5) +; P9LE-NEXT: xxsldwi vs0, vs0, vs0, 2 +; P9LE-NEXT: stfiwx f0, 0, r5 ; P9LE-NEXT: blr - +; ; P9BE-LABEL: test_liwzx1: ; P9BE: # %bb.0: ; P9BE-NEXT: lfiwzx f0, 0, r3 @@ -27,10 +27,10 @@ define void @test_liwzx1(<1 x float>* %A, <1 x float>* %B, <1 x float>* %C) { ; P9BE-NEXT: xxsldwi vs0, f0, f0, 1 ; P9BE-NEXT: xxsldwi vs1, f1, f1, 1 ; P9BE-NEXT: xvaddsp vs0, vs0, vs1 -; P9BE-NEXT: xscvspdpn f0, vs0 -; P9BE-NEXT: stfs f0, 0(r5) +; P9BE-NEXT: xxsldwi vs0, vs0, vs0, 3 +; P9BE-NEXT: stfiwx f0, 0, r5 ; P9BE-NEXT: blr - +; ; P8LE-LABEL: test_liwzx1: ; P8LE: # %bb.0: ; P8LE-NEXT: lfiwzx f0, 0, r3 @@ -38,11 +38,10 @@ define void @test_liwzx1(<1 x float>* %A, <1 x float>* %B, <1 x float>* %C) { ; P8LE-NEXT: xxpermdi vs0, f0, f0, 2 ; P8LE-NEXT: xxpermdi vs1, f1, f1, 2 ; P8LE-NEXT: xvaddsp vs0, vs0, vs1 -; P8LE-NEXT: xxsldwi vs0, vs0, vs0, 3 -; P8LE-NEXT: xscvspdpn f0, vs0 -; P8LE-NEXT: stfsx f0, 0, r5 +; P8LE-NEXT: xxsldwi vs0, vs0, vs0, 2 +; P8LE-NEXT: stfiwx f0, 0, r5 ; P8LE-NEXT: blr - +; ; P8BE-LABEL: test_liwzx1: ; P8BE: # %bb.0: ; P8BE-NEXT: lfiwzx f0, 0, r3 @@ -50,9 +49,12 @@ define void @test_liwzx1(<1 x float>* %A, <1 x float>* %B, <1 x float>* %C) { ; P8BE-NEXT: xxsldwi vs0, f0, f0, 1 ; P8BE-NEXT: xxsldwi vs1, f1, f1, 1 ; P8BE-NEXT: xvaddsp vs0, vs0, vs1 -; P8BE-NEXT: xscvspdpn f0, vs0 -; P8BE-NEXT: stfsx f0, 0, r5 +; P8BE-NEXT: xxsldwi vs0, vs0, vs0, 3 +; P8BE-NEXT: stfiwx f0, 0, r5 ; P8BE-NEXT: blr + + + %a = load <1 x float>, <1 x float>* %A %b = load <1 x float>, <1 x float>* %B %X = fadd <1 x float> %a, %b @@ -68,12 +70,11 @@ define <1 x float>* @test_liwzx2(<1 x float>* %A, <1 x float>* %B, <1 x float>* ; P9LE-NEXT: xxpermdi vs0, f0, f0, 2 ; P9LE-NEXT: xxpermdi vs1, f1, f1, 2 ; P9LE-NEXT: xvsubsp vs0, vs0, vs1 -; P9LE-NEXT: xxsldwi vs0, vs0, vs0, 3 -; P9LE-NEXT: xscvspdpn f0, vs0 +; P9LE-NEXT: xxsldwi vs0, vs0, vs0, 2 ; P9LE-NEXT: mr r3, r5 -; P9LE-NEXT: stfs f0, 0(r5) +; P9LE-NEXT: stfiwx f0, 0, r5 ; P9LE-NEXT: blr - +; ; P9BE-LABEL: test_liwzx2: ; P9BE: # %bb.0: ; P9BE-NEXT: lfiwzx f0, 0, r3 @@ -81,11 +82,11 @@ define <1 x float>* @test_liwzx2(<1 x float>* %A, <1 x float>* %B, <1 x float>* ; P9BE-NEXT: xxsldwi vs0, f0, f0, 1 ; P9BE-NEXT: xxsldwi vs1, f1, f1, 1 ; P9BE-NEXT: xvsubsp vs0, vs0, vs1 -; P9BE-NEXT: xscvspdpn f0, vs0 +; P9BE-NEXT: xxsldwi vs0, vs0, vs0, 3 ; P9BE-NEXT: mr r3, r5 -; P9BE-NEXT: stfs f0, 0(r5) +; P9BE-NEXT: stfiwx f0, 0, r5 ; P9BE-NEXT: blr - +; ; P8LE-LABEL: test_liwzx2: ; P8LE: # %bb.0: ; P8LE-NEXT: lfiwzx f0, 0, r3 @@ -94,11 +95,10 @@ define <1 x float>* @test_liwzx2(<1 x float>* %A, <1 x float>* %B, <1 x float>* ; P8LE-NEXT: xxpermdi vs0, f0, f0, 2 ; P8LE-NEXT: xxpermdi vs1, f1, f1, 2 ; P8LE-NEXT: xvsubsp vs0, vs0, vs1 -; P8LE-NEXT: xxsldwi vs0, vs0, vs0, 3 -; P8LE-NEXT: xscvspdpn f0, vs0 -; P8LE-NEXT: stfsx f0, 0, r5 +; P8LE-NEXT: xxsldwi vs0, vs0, vs0, 2 +; P8LE-NEXT: stfiwx f0, 0, r5 ; P8LE-NEXT: blr - +; ; P8BE-LABEL: test_liwzx2: ; P8BE: # %bb.0: ; P8BE-NEXT: lfiwzx f0, 0, r3 @@ -107,9 +107,14 @@ define <1 x float>* @test_liwzx2(<1 x float>* %A, <1 x float>* %B, <1 x float>* ; P8BE-NEXT: xxsldwi vs0, f0, f0, 1 ; P8BE-NEXT: xxsldwi vs1, f1, f1, 1 ; P8BE-NEXT: xvsubsp vs0, vs0, vs1 -; P8BE-NEXT: xscvspdpn f0, vs0 -; P8BE-NEXT: stfsx f0, 0, r5 +; P8BE-NEXT: xxsldwi vs0, vs0, vs0, 3 +; P8BE-NEXT: stfiwx f0, 0, r5 ; P8BE-NEXT: blr + + + + + %a = load <1 x float>, <1 x float>* %A %b = load <1 x float>, <1 x float>* %B %X = fsub <1 x float> %a, %b |

