From 76dcb70dab490c5dbabaf1b982a1650da2a341cf Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Fri, 11 Oct 2019 09:03:00 +0000 Subject: [PATCH] S/390: Test signaling FP comparison instructions gcc/testsuite/ChangeLog: 2019-10-11 Ilya Leoshkevich PR target/77918 * gcc.target/s390/s390.exp: Enable Fortran tests. * gcc.target/s390/zvector/autovec-double-quiet-eq.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-ge.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-gt.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-le.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-lt.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-ordered.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-uneq.c: New test. * gcc.target/s390/zvector/autovec-double-quiet-unordered.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-eq-z13-finite.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-eq.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-ge-z13-finite.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-ge-z13.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-ge.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-gt-z13-finite.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-gt-z13.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-gt.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-le-z13-finite.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-le-z13.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-le.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-lt-z13-finite.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-lt-z13.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-lt.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13-finite.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13.c: New test. * gcc.target/s390/zvector/autovec-double-signaling-ltgt.c: New test. * gcc.target/s390/zvector/autovec-double-smax-z13.F90: New test. * gcc.target/s390/zvector/autovec-double-smax.F90: New test. * gcc.target/s390/zvector/autovec-double-smin-z13.F90: New test. * gcc.target/s390/zvector/autovec-double-smin.F90: New test. * gcc.target/s390/zvector/autovec-float-quiet-eq.c: New test. * gcc.target/s390/zvector/autovec-float-quiet-ge.c: New test. * gcc.target/s390/zvector/autovec-float-quiet-gt.c: New test. * gcc.target/s390/zvector/autovec-float-quiet-le.c: New test. * gcc.target/s390/zvector/autovec-float-quiet-lt.c: New test. * gcc.target/s390/zvector/autovec-float-quiet-ordered.c: New test. * gcc.target/s390/zvector/autovec-float-quiet-uneq.c: New test. * gcc.target/s390/zvector/autovec-float-quiet-unordered.c: New test. * gcc.target/s390/zvector/autovec-float-signaling-eq.c: New test. * gcc.target/s390/zvector/autovec-float-signaling-ge.c: New test. * gcc.target/s390/zvector/autovec-float-signaling-gt.c: New test. * gcc.target/s390/zvector/autovec-float-signaling-le.c: New test. * gcc.target/s390/zvector/autovec-float-signaling-lt.c: New test. * gcc.target/s390/zvector/autovec-float-signaling-ltgt.c: New test. * gcc.target/s390/zvector/autovec-fortran.h: New test. * gcc.target/s390/zvector/autovec-long-double-signaling-ge.c: New test. * gcc.target/s390/zvector/autovec-long-double-signaling-gt.c: New test. * gcc.target/s390/zvector/autovec-long-double-signaling-le.c: New test. * gcc.target/s390/zvector/autovec-long-double-signaling-lt.c: New test. * gcc.target/s390/zvector/autovec.h: New test. From-SVN: r276872 --- gcc/testsuite/ChangeLog | 55 +++++++++++++++++++ gcc/testsuite/gcc.target/s390/s390.exp | 8 +++ .../s390/zvector/autovec-double-quiet-eq.c | 8 +++ .../s390/zvector/autovec-double-quiet-ge.c | 8 +++ .../s390/zvector/autovec-double-quiet-gt.c | 8 +++ .../s390/zvector/autovec-double-quiet-le.c | 8 +++ .../s390/zvector/autovec-double-quiet-lt.c | 8 +++ .../zvector/autovec-double-quiet-ordered.c | 10 ++++ .../s390/zvector/autovec-double-quiet-uneq.c | 10 ++++ .../zvector/autovec-double-quiet-unordered.c | 11 ++++ .../autovec-double-signaling-eq-z13-finite.c | 10 ++++ .../zvector/autovec-double-signaling-eq-z13.c | 9 +++ .../zvector/autovec-double-signaling-eq.c | 11 ++++ .../autovec-double-signaling-ge-z13-finite.c | 10 ++++ .../zvector/autovec-double-signaling-ge-z13.c | 9 +++ .../zvector/autovec-double-signaling-ge.c | 8 +++ .../autovec-double-signaling-gt-z13-finite.c | 10 ++++ .../zvector/autovec-double-signaling-gt-z13.c | 9 +++ .../zvector/autovec-double-signaling-gt.c | 8 +++ .../autovec-double-signaling-le-z13-finite.c | 10 ++++ .../zvector/autovec-double-signaling-le-z13.c | 9 +++ .../zvector/autovec-double-signaling-le.c | 8 +++ .../autovec-double-signaling-lt-z13-finite.c | 10 ++++ .../zvector/autovec-double-signaling-lt-z13.c | 9 +++ .../zvector/autovec-double-signaling-lt.c | 8 +++ ...autovec-double-signaling-ltgt-z13-finite.c | 9 +++ .../autovec-double-signaling-ltgt-z13.c | 9 +++ .../zvector/autovec-double-signaling-ltgt.c | 9 +++ .../s390/zvector/autovec-double-smax-z13.F90 | 11 ++++ .../s390/zvector/autovec-double-smax.F90 | 8 +++ .../s390/zvector/autovec-double-smin-z13.F90 | 11 ++++ .../s390/zvector/autovec-double-smin.F90 | 8 +++ .../s390/zvector/autovec-float-quiet-eq.c | 8 +++ .../s390/zvector/autovec-float-quiet-ge.c | 8 +++ .../s390/zvector/autovec-float-quiet-gt.c | 8 +++ .../s390/zvector/autovec-float-quiet-le.c | 8 +++ .../s390/zvector/autovec-float-quiet-lt.c | 8 +++ .../zvector/autovec-float-quiet-ordered.c | 10 ++++ .../s390/zvector/autovec-float-quiet-uneq.c | 10 ++++ .../zvector/autovec-float-quiet-unordered.c | 11 ++++ .../s390/zvector/autovec-float-signaling-eq.c | 11 ++++ .../s390/zvector/autovec-float-signaling-ge.c | 8 +++ .../s390/zvector/autovec-float-signaling-gt.c | 8 +++ .../s390/zvector/autovec-float-signaling-le.c | 8 +++ .../s390/zvector/autovec-float-signaling-lt.c | 8 +++ .../zvector/autovec-float-signaling-ltgt.c | 9 +++ .../gcc.target/s390/zvector/autovec-fortran.h | 7 +++ .../autovec-long-double-signaling-ge.c | 8 +++ .../autovec-long-double-signaling-gt.c | 8 +++ .../autovec-long-double-signaling-le.c | 8 +++ .../autovec-long-double-signaling-lt.c | 8 +++ .../gcc.target/s390/zvector/autovec.h | 43 +++++++++++++++ 52 files changed, 542 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-eq.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ge.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-gt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-le.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-lt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ordered.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-uneq.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-unordered.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13-finite.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13-finite.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13-finite.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13-finite.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13-finite.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13-finite.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax-z13.F90 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax.F90 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin-z13.F90 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin.F90 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-eq.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ge.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-gt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-le.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-lt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ordered.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-uneq.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-unordered.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ge.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-gt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-le.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-lt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ltgt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-fortran.h create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-ge.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-gt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-le.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-lt.c create mode 100644 gcc/testsuite/gcc.target/s390/zvector/autovec.h diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 668abb67518..c565dae1a80 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,58 @@ +2019-10-11 Ilya Leoshkevich + + PR target/77918 + * gcc.target/s390/s390.exp: Enable Fortran tests. + * gcc.target/s390/zvector/autovec-double-quiet-eq.c: New test. + * gcc.target/s390/zvector/autovec-double-quiet-ge.c: New test. + * gcc.target/s390/zvector/autovec-double-quiet-gt.c: New test. + * gcc.target/s390/zvector/autovec-double-quiet-le.c: New test. + * gcc.target/s390/zvector/autovec-double-quiet-lt.c: New test. + * gcc.target/s390/zvector/autovec-double-quiet-ordered.c: New test. + * gcc.target/s390/zvector/autovec-double-quiet-uneq.c: New test. + * gcc.target/s390/zvector/autovec-double-quiet-unordered.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-eq-z13-finite.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-eq.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-ge-z13-finite.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-ge-z13.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-ge.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-gt-z13-finite.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-gt-z13.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-gt.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-le-z13-finite.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-le-z13.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-le.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-lt-z13-finite.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-lt-z13.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-lt.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13-finite.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13.c: New test. + * gcc.target/s390/zvector/autovec-double-signaling-ltgt.c: New test. + * gcc.target/s390/zvector/autovec-double-smax-z13.F90: New test. + * gcc.target/s390/zvector/autovec-double-smax.F90: New test. + * gcc.target/s390/zvector/autovec-double-smin-z13.F90: New test. + * gcc.target/s390/zvector/autovec-double-smin.F90: New test. + * gcc.target/s390/zvector/autovec-float-quiet-eq.c: New test. + * gcc.target/s390/zvector/autovec-float-quiet-ge.c: New test. + * gcc.target/s390/zvector/autovec-float-quiet-gt.c: New test. + * gcc.target/s390/zvector/autovec-float-quiet-le.c: New test. + * gcc.target/s390/zvector/autovec-float-quiet-lt.c: New test. + * gcc.target/s390/zvector/autovec-float-quiet-ordered.c: New test. + * gcc.target/s390/zvector/autovec-float-quiet-uneq.c: New test. + * gcc.target/s390/zvector/autovec-float-quiet-unordered.c: New test. + * gcc.target/s390/zvector/autovec-float-signaling-eq.c: New test. + * gcc.target/s390/zvector/autovec-float-signaling-ge.c: New test. + * gcc.target/s390/zvector/autovec-float-signaling-gt.c: New test. + * gcc.target/s390/zvector/autovec-float-signaling-le.c: New test. + * gcc.target/s390/zvector/autovec-float-signaling-lt.c: New test. + * gcc.target/s390/zvector/autovec-float-signaling-ltgt.c: New test. + * gcc.target/s390/zvector/autovec-fortran.h: New test. + * gcc.target/s390/zvector/autovec-long-double-signaling-ge.c: New test. + * gcc.target/s390/zvector/autovec-long-double-signaling-gt.c: New test. + * gcc.target/s390/zvector/autovec-long-double-signaling-le.c: New test. + * gcc.target/s390/zvector/autovec-long-double-signaling-lt.c: New test. + * gcc.target/s390/zvector/autovec.h: New test. + 2019-10-11 Ilya Leoshkevich * gcc.target/s390/vector/vec-scalar-cmp-1.c: Adjust diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp index 86f7e4398eb..925eb568832 100644 --- a/gcc/testsuite/gcc.target/s390/s390.exp +++ b/gcc/testsuite/gcc.target/s390/s390.exp @@ -27,6 +27,7 @@ if ![istarget s390*-*-*] then { # Load support procs. load_lib gcc-dg.exp load_lib target-supports.exp +load_lib gfortran-dg.exp # Return 1 if the the assembler understands .machine and .machinemode. The # target attribute needs that feature to work. @@ -193,6 +194,10 @@ global DEFAULT_CFLAGS if ![info exists DEFAULT_CFLAGS] then { set DEFAULT_CFLAGS " -ansi -pedantic-errors" } +global DEFAULT_FFLAGS +if ![info exists DEFAULT_FFLAGS] then { + set DEFAULT_FFLAGS " -pedantic-errors" +} # Initialize `dg'. dg-init @@ -209,6 +214,9 @@ dg-runtest [lsort [prune [glob -nocomplain $srcdir/$subdir/*.{c,S}] \ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*vector*/*.{c,S}]] \ "" $DEFAULT_CFLAGS +gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*vector*/*.F90]] \ + "" $DEFAULT_FFLAGS + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/target-attribute/*.{c,S}]] \ "" $DEFAULT_CFLAGS diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-eq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-eq.c new file mode 100644 index 00000000000..46bef83cfa3 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-eq.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_EQ); + +/* { dg-final { scan-assembler {\n\tvfcedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ge.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ge.c new file mode 100644 index 00000000000..4dbbd8f6728 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ge.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_GE); + +/* { dg-final { scan-assembler {\n\tvfchedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-gt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-gt.c new file mode 100644 index 00000000000..57f7cefb578 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-gt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_GT); + +/* { dg-final { scan-assembler {\n\tvfchdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-le.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-le.c new file mode 100644 index 00000000000..3de425ca760 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-le.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_LE); + +/* { dg-final { scan-assembler {\n\tvfchedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-lt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-lt.c new file mode 100644 index 00000000000..0817846944d --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-lt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_LT); + +/* { dg-final { scan-assembler {\n\tvfchdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ordered.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ordered.c new file mode 100644 index 00000000000..65b0240073c --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-ordered.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_ORDERED); + +/* { dg-final { scan-assembler {\n\tvfchedb\t} } } */ +/* { dg-final { scan-assembler {\n\tvfchdb\t} } } */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-uneq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-uneq.c new file mode 100644 index 00000000000..3d6da30beac --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-uneq.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_UNEQ); + +/* { dg-final { scan-assembler-times {\n\tvfchdb\t} 2 } } */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ +/* { dg-final { scan-assembler {\n\tvx\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-unordered.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-unordered.c new file mode 100644 index 00000000000..1f6fb781f64 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-quiet-unordered.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (QUIET_UNORDERED); + +/* { dg-final { scan-assembler {\n\tvfchedb\t} } } */ +/* { dg-final { scan-assembler {\n\tvfchdb\t} } } */ +/* combine prefers to reorder vsel args instead of using vno. */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13-finite.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13-finite.c new file mode 100644 index 00000000000..461ff8d7024 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13-finite.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -ffinite-math-only -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_EQ); + +/* We can use non-signaling vector comparison instructions with + -ffinite-math-only. */ +/* { dg-final { scan-assembler {\n\tvfcedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c new file mode 100644 index 00000000000..1806fa8c60e --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_EQ); + +/* z13 does not have signaling vector comparison instructions. */ +/* { dg-final { scan-assembler {\n\tkdbr\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c new file mode 100644 index 00000000000..a8402b9f705 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_EQ); + +/* The vectorizer produces <= and ==, which rtl passes cannot turn into vfkedb + yet. */ +/* { dg-final { scan-assembler {\n\tvfcedb\t} } } */ +/* { dg-final { scan-assembler {\n\tvfkhedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13-finite.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13-finite.c new file mode 100644 index 00000000000..518f5d7a645 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13-finite.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -ffinite-math-only -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_GE); + +/* We can use non-signaling vector comparison instructions with + -ffinite-math-only. */ +/* { dg-final { scan-assembler {\n\tvfchedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13.c new file mode 100644 index 00000000000..1e1737fd269 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge-z13.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_GE); + +/* z13 does not have signaling vector comparison instructions. */ +/* { dg-final { scan-assembler {\n\tkdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge.c new file mode 100644 index 00000000000..49172f55ac9 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ge.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_GE); + +/* { dg-final { scan-assembler {\n\tvfkhedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13-finite.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13-finite.c new file mode 100644 index 00000000000..cf54adabed7 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13-finite.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -ffinite-math-only -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_GT); + +/* We can use non-signaling vector comparison instructions with + -ffinite-math-only. */ +/* { dg-final { scan-assembler {\n\tvfchdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13.c new file mode 100644 index 00000000000..8a9e03af1a4 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt-z13.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_GT); + +/* z13 does not have signaling vector comparison instructions. */ +/* { dg-final { scan-assembler {\n\tkdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt.c new file mode 100644 index 00000000000..af62e1fd005 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-gt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_GT); + +/* { dg-final { scan-assembler {\n\tvfkhdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13-finite.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13-finite.c new file mode 100644 index 00000000000..100366e8f1a --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13-finite.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -ffinite-math-only -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LE); + +/* We can use non-signaling vector comparison instructions with + -ffinite-math-only. */ +/* { dg-final { scan-assembler {\n\tvfchedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13.c new file mode 100644 index 00000000000..c0714efc1d9 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le-z13.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LE); + +/* z13 does not have signaling vector comparison instructions. */ +/* { dg-final { scan-assembler {\n\tkdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le.c new file mode 100644 index 00000000000..33266d41681 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-le.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LE); + +/* { dg-final { scan-assembler {\n\tvfkhedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13-finite.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13-finite.c new file mode 100644 index 00000000000..f587364af09 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13-finite.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -ffinite-math-only -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LT); + +/* We can use non-signaling vector comparison instructions with + -ffinite-math-only. */ +/* { dg-final { scan-assembler {\n\tvfchdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13.c new file mode 100644 index 00000000000..18e81be845b --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt-z13.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LT); + +/* z13 does not have signaling vector comparison instructions. */ +/* { dg-final { scan-assembler {\n\tkdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt.c new file mode 100644 index 00000000000..1ceea1bdbc6 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-lt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LT); + +/* { dg-final { scan-assembler {\n\tvfkhdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13-finite.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13-finite.c new file mode 100644 index 00000000000..8ee3cce5e95 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13-finite.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -ffinite-math-only -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LTGT); + +/* ltgt is the same as eq with -ffinite-math-only. */ +/* { dg-final { scan-assembler {\n\tvfcedb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13.c new file mode 100644 index 00000000000..d270887c3df --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt-z13.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LTGT); + +/* z13 does not have signaling vector comparison instructions. */ +/* { dg-final { scan-assembler {\n\tkdb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt.c new file mode 100644 index 00000000000..9dfae8f2f7e --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-ltgt.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_DOUBLE (SIGNALING_LTGT); + +/* { dg-final { scan-assembler-times {\n\tvfkhdb\t} 2 } } */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax-z13.F90 b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax-z13.F90 new file mode 100644 index 00000000000..8a23566e8b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax-z13.F90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-ffree-line-length-256 -O3 -march=z13 -mzvector -mzarch" } + +#include "autovec-fortran.h" + +AUTOVEC_FORTRAN (max) + +! Fortran's max does not specify whether or not an exception should be raised in +! face of qNaNs, and neither does gcc's smax. Vectorize max using quiet +! comparison, because that's the only one we have on z13. +! { dg-final { scan-assembler {\n\tvfchdb\t} } } diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax.F90 b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax.F90 new file mode 100644 index 00000000000..c877053136f --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smax.F90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! { dg-options "-ffree-line-length-256 -O3 -march=z14 -mzvector -mzarch" } + +#include "autovec-fortran.h" + +AUTOVEC_FORTRAN (max) + +! { dg-final { scan-assembler {\n\tvfmaxdb\t} } } diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin-z13.F90 b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin-z13.F90 new file mode 100644 index 00000000000..37711f96176 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin-z13.F90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-ffree-line-length-256 -O3 -march=z13 -mzvector -mzarch" } + +#include "autovec-fortran.h" + +AUTOVEC_FORTRAN (min) + +! Fortran's min does not specify whether or not an exception should be raised in +! face of qNaNs, and neither does gcc's smin. Vectorize min using quiet +! comparison, because that's the only one we have on z13. +! { dg-final { scan-assembler {\n\tvfchdb\t} } } diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin.F90 b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin.F90 new file mode 100644 index 00000000000..25d6213fa79 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-smin.F90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! { dg-options "-ffree-line-length-256 -O3 -march=z14 -mzvector -mzarch" } + +#include "autovec-fortran.h" + +AUTOVEC_FORTRAN (min) + +! { dg-final { scan-assembler {\n\tvfmindb\t} } } diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-eq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-eq.c new file mode 100644 index 00000000000..216063f0086 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-eq.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_EQ); + +/* { dg-final { scan-assembler {\n\tvfcesb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ge.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ge.c new file mode 100644 index 00000000000..eddf8d66658 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ge.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_GE); + +/* { dg-final { scan-assembler {\n\tvfchesb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-gt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-gt.c new file mode 100644 index 00000000000..69fbb25d6b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-gt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_GT); + +/* { dg-final { scan-assembler {\n\tvfchsb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-le.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-le.c new file mode 100644 index 00000000000..49374e478f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-le.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_LE); + +/* { dg-final { scan-assembler {\n\tvfchesb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-lt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-lt.c new file mode 100644 index 00000000000..403534cb799 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-lt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_LT); + +/* { dg-final { scan-assembler {\n\tvfchsb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ordered.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ordered.c new file mode 100644 index 00000000000..ae799fbfa98 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-ordered.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_UNORDERED); + +/* { dg-final { scan-assembler {\n\tvfchesb\t} } } */ +/* { dg-final { scan-assembler {\n\tvfchsb\t} } } */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-uneq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-uneq.c new file mode 100644 index 00000000000..1df53a99bc8 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-uneq.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_UNEQ); + +/* { dg-final { scan-assembler-times {\n\tvfchsb\t} 2 } } */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ +/* { dg-final { scan-assembler {\n\tvx\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-unordered.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-unordered.c new file mode 100644 index 00000000000..3eb44da7484 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-quiet-unordered.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (QUIET_UNORDERED); + +/* { dg-final { scan-assembler {\n\tvfchesb\t} } } */ +/* { dg-final { scan-assembler {\n\tvfchsb\t} } } */ +/* combine prefers to reorder vsel args instead of using vno. */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c new file mode 100644 index 00000000000..7dd91a5e6f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (SIGNALING_EQ); + +/* The vectorizer produces <= and ==, which rtl passes cannot turn into vfkesb + yet. */ +/* { dg-final { scan-assembler {\n\tvfcesb\t} } } */ +/* { dg-final { scan-assembler {\n\tvfkhesb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ge.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ge.c new file mode 100644 index 00000000000..884203b42c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ge.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (SIGNALING_GE); + +/* { dg-final { scan-assembler {\n\tvfkhesb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-gt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-gt.c new file mode 100644 index 00000000000..8e4401e3b23 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-gt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (SIGNALING_GT); + +/* { dg-final { scan-assembler {\n\tvfkhsb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-le.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-le.c new file mode 100644 index 00000000000..14ff8b49b4d --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-le.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (SIGNALING_LE); + +/* { dg-final { scan-assembler {\n\tvfkhesb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-lt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-lt.c new file mode 100644 index 00000000000..420c7ca5930 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-lt.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (SIGNALING_LT); + +/* { dg-final { scan-assembler {\n\tvfkhsb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ltgt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ltgt.c new file mode 100644 index 00000000000..c34cf091608 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-ltgt.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_FLOAT (SIGNALING_LTGT); + +/* { dg-final { scan-assembler-times {\n\tvfkhsb\t} 2 } } */ +/* { dg-final { scan-assembler {\n\tvo\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-fortran.h b/gcc/testsuite/gcc.target/s390/zvector/autovec-fortran.h new file mode 100644 index 00000000000..8e44cb2dd31 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-fortran.h @@ -0,0 +1,7 @@ +#define AUTOVEC_FORTRAN(OP) subroutine f (r, x, y); \ + real(kind=kind (1.0d0)) :: r(1000000), x(1000000), y(1000000); \ + integer :: i; \ + do i = 1, 1000000; \ + r(i) = OP (x(i), y(i)); \ + end do; \ +end diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-ge.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-ge.c new file mode 100644 index 00000000000..e4d01b5ccf9 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-ge.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_LONG_DOUBLE (SIGNALING_GE); + +/* { dg-final { scan-assembler {\n\twfkhexb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-gt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-gt.c new file mode 100644 index 00000000000..b9417ac5112 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-gt.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_LONG_DOUBLE (SIGNALING_GT); + +/* { dg-final { scan-assembler {\n\twfkhxb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-le.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-le.c new file mode 100644 index 00000000000..1a76b1d8ff1 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-le.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_LONG_DOUBLE (SIGNALING_LE); + +/* { dg-final { scan-assembler {\n\twfkhexb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-lt.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-lt.c new file mode 100644 index 00000000000..0a1c5cd56d6 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-long-double-signaling-lt.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */ + +#include "autovec.h" + +AUTOVEC_LONG_DOUBLE (SIGNALING_LT); + +/* { dg-final { scan-assembler {\n\twfkhxb\t} } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec.h b/gcc/testsuite/gcc.target/s390/zvector/autovec.h new file mode 100644 index 00000000000..d7977a13335 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec.h @@ -0,0 +1,43 @@ +#ifndef AUTOVEC_H +#define AUTOVEC_H 1 + +#define QUIET_EQ(x, y) ((x) == (y)) +#define QUIET_GE __builtin_isgreaterequal +#define QUIET_GT __builtin_isgreater +#define QUIET_LE __builtin_islessequal +#define QUIET_LT __builtin_isless +#define QUIET_ORDERED(x, y) (!__builtin_isunordered ((x), (y))) +#define QUIET_UNEQ(x, y) (__builtin_isless ((x), (y)) \ + || __builtin_isgreater ((x), (y))) +#define QUIET_UNORDERED __builtin_isunordered +#define SIGNALING_EQ(x, y) (((x) <= (y)) && ((x) >= (y))) +#define SIGNALING_GE(x, y) ((x) >= (y)) +#define SIGNALING_GT(x, y) ((x) > (y)) +#define SIGNALING_LE(x, y) ((x) <= (y)) +#define SIGNALING_LT(x, y) ((x) < (y)) +#define SIGNALING_LTGT(x, y) (((x) < (y)) || ((x) > (y))) + +#define AUTOVEC(RESULT_TYPE, OP_TYPE, OP) void \ +f (RESULT_TYPE *r, const OP_TYPE *x, const OP_TYPE *y) \ +{ \ + int i; \ +\ + for (i = 0; i < 1000000; i++) \ + { \ + OP_TYPE xi = x[i], yi = y[i]; \ +\ + r[i] = OP (xi, yi); \ + } \ +} + +#define AUTOVEC_DOUBLE(OP) AUTOVEC (long long, double, OP) + +#define AUTOVEC_FLOAT(OP) AUTOVEC (int, float, OP) + +#ifdef __SIZEOF_INT128__ +typedef __int128 v1ti __attribute__ ((vector_size (16))); +typedef long double v1tf __attribute__ ((vector_size (16))); +#define AUTOVEC_LONG_DOUBLE(OP) AUTOVEC (v1ti, v1tf, OP) +#endif + +#endif -- 2.30.2