diff options
author | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2019-02-12 18:06:06 +0000 |
---|---|---|
committer | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2019-02-12 18:06:06 +0000 |
commit | 34bead750c25fb3fa56dfe268797c438b1ccbb66 (patch) | |
tree | 38e3c1b9a2d6e8046b5bc237a6d10a82e9c90eb6 /llvm/test/CodeGen/SystemZ | |
parent | 0205828be4f1b89a49ea60f818efa0e23fe2ee41 (diff) | |
download | bcm5719-llvm-34bead750c25fb3fa56dfe268797c438b1ccbb66.tar.gz bcm5719-llvm-34bead750c25fb3fa56dfe268797c438b1ccbb66.zip |
[SystemZ] Use VGM whenever possible to load FP immediates.
isFPImmLegal() has been extended to recognize certain FP immediates that can
be built with VGM (Vector Generate Mask).
These scalar FP immediates (that were previously loaded from the constant
pool) are now selected as VGMF/VGMG in Select().
Review: Ulrich Weigand
https://reviews.llvm.org/D58003
llvm-svn: 353867
Diffstat (limited to 'llvm/test/CodeGen/SystemZ')
-rw-r--r-- | llvm/test/CodeGen/SystemZ/fp-const-12.ll | 63 | ||||
-rw-r--r-- | llvm/test/CodeGen/SystemZ/subregliveness-02.ll | 2 |
2 files changed, 64 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/SystemZ/fp-const-12.ll b/llvm/test/CodeGen/SystemZ/fp-const-12.ll new file mode 100644 index 00000000000..f22156ba40e --- /dev/null +++ b/llvm/test/CodeGen/SystemZ/fp-const-12.ll @@ -0,0 +1,63 @@ +; Test loads of FP constants with VGM. +; +; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s + +define double @f1() { +; CHECK-LABEL: f1: +; CHECK: vgmg %v0, 2, 11 + ret double 1.0 +} + +define double @f2() { +; CHECK-LABEL: f2: +; CHECK: vgmg %v0, 1, 1 + ret double 2.0 +} + +define double @f3() { +; CHECK-LABEL: f3: +; CHECK: vgmg %v0, 0, 1 + ret double -2.0 +} + +define double @f4() { +; CHECK-LABEL: f4: +; CHECK: vgmg %v0, 2, 10 + ret double 0.5 +} + +define double @f5() { +; CHECK-LABEL: f5: +; CHECK: vgmg %v0, 2, 9 + ret double 0.125 +} + +define float @f6() { +; CHECK-LABEL: f6: +; CHECK: vgmf %v0, 2, 8 + ret float 1.0 +} + +define float @f7() { +; CHECK-LABEL: f7: +; CHECK: vgmf %v0, 1, 1 + ret float 2.0 +} + +define float @f8() { +; CHECK-LABEL: f8: +; CHECK: vgmf %v0, 0, 1 + ret float -2.0 +} + +define float @f9() { +; CHECK-LABEL: f9: +; CHECK: vgmf %v0, 2, 7 + ret float 0.5 +} + +define float @f10() { +; CHECK-LABEL: f10: +; CHECK: vgmf %v0, 2, 6 + ret float 0.125 +} diff --git a/llvm/test/CodeGen/SystemZ/subregliveness-02.ll b/llvm/test/CodeGen/SystemZ/subregliveness-02.ll index abdc223bcb8..8f972e18a66 100644 --- a/llvm/test/CodeGen/SystemZ/subregliveness-02.ll +++ b/llvm/test/CodeGen/SystemZ/subregliveness-02.ll @@ -1,7 +1,7 @@ ; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -systemz-subreg-liveness < %s | FileCheck %s ; Check for successful compilation. -; CHECK: meeb %f0, 0(%r1) +; CHECK: meebr %f1, %f0 target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64" target triple = "s390x-ibm-linux" |