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 ++++ .../s390/zvector/autovec-double-quiet-ordered.c | 10 ++++ .../s390/zvector/autovec-double-quiet-uneq.c | 10 ++++ .../s390/zvector/autovec-double-quiet-unordered.c | 11 +++++ .../autovec-double-signaling-eq-z13-finite.c | 10 ++++ .../s390/zvector/autovec-double-signaling-eq-z13.c | 9 ++++ .../s390/zvector/autovec-double-signaling-eq.c | 11 +++++ .../autovec-double-signaling-ge-z13-finite.c | 10 ++++ .../s390/zvector/autovec-double-signaling-ge-z13.c | 9 ++++ .../s390/zvector/autovec-double-signaling-ge.c | 8 ++++ .../autovec-double-signaling-gt-z13-finite.c | 10 ++++ .../s390/zvector/autovec-double-signaling-gt-z13.c | 9 ++++ .../s390/zvector/autovec-double-signaling-gt.c | 8 ++++ .../autovec-double-signaling-le-z13-finite.c | 10 ++++ .../s390/zvector/autovec-double-signaling-le-z13.c | 9 ++++ .../s390/zvector/autovec-double-signaling-le.c | 8 ++++ .../autovec-double-signaling-lt-z13-finite.c | 10 ++++ .../s390/zvector/autovec-double-signaling-lt-z13.c | 9 ++++ .../s390/zvector/autovec-double-signaling-lt.c | 8 ++++ .../autovec-double-signaling-ltgt-z13-finite.c | 9 ++++ .../zvector/autovec-double-signaling-ltgt-z13.c | 9 ++++ .../s390/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 ++++ .../s390/zvector/autovec-float-quiet-ordered.c | 10 ++++ .../s390/zvector/autovec-float-quiet-uneq.c | 10 ++++ .../s390/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 ++++ .../s390/zvector/autovec-float-signaling-ltgt.c | 9 ++++ .../gcc.target/s390/zvector/autovec-fortran.h | 7 +++ .../zvector/autovec-long-double-signaling-ge.c | 8 ++++ .../zvector/autovec-long-double-signaling-gt.c | 8 ++++ .../zvector/autovec-long-double-signaling-le.c | 8 ++++ .../zvector/autovec-long-double-signaling-lt.c | 8 ++++ gcc/testsuite/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 668abb6..c565dae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,60 @@ 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 expectations. diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp index 86f7e43..925eb56 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 0000000..46bef83 --- /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 0000000..4dbbd8f --- /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 0000000..57f7cef --- /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 0000000..3de425c --- /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 0000000..0817846 --- /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 0000000..65b0240 --- /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 0000000..3d6da30 --- /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 0000000..1f6fb78 --- /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 0000000..461ff8d --- /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 0000000..1806fa8 --- /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 0000000..a8402b9 --- /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 0000000..518f5d7 --- /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 0000000..1e1737f --- /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 0000000..49172f5 --- /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 0000000..cf54ada --- /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 0000000..8a9e03a --- /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 0000000..af62e1f --- /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 0000000..100366e --- /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 0000000..c0714ef --- /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 0000000..33266d4 --- /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 0000000..f587364 --- /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 0000000..18e81be --- /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 0000000..1ceea1b --- /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 0000000..8ee3cce --- /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 0000000..d270887 --- /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 0000000..9dfae8f --- /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 0000000..8a23566 --- /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 0000000..c877053 --- /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 0000000..37711f9 --- /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 0000000..25d6213 --- /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 0000000..216063f --- /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 0000000..eddf8d6 --- /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 0000000..69fbb25 --- /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 0000000..49374e4 --- /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 0000000..403534c --- /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 0000000..ae799fb --- /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 0000000..1df53a9 --- /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 0000000..3eb44da --- /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 0000000..7dd91a5 --- /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 0000000..884203b --- /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 0000000..8e4401e --- /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 0000000..14ff8b4 --- /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 0000000..420c7ca --- /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 0000000..c34cf09 --- /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 0000000..8e44cb2 --- /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 0000000..e4d01b5 --- /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 0000000..b9417ac --- /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 0000000..1a76b1d --- /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 0000000..0a1c5cd --- /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 0000000..d7977a1 --- /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.7.4