S/390: Test signaling FP comparison instructions
gcc/testsuite/ChangeLog: 2019-10-11 Ilya Leoshkevich <iii@linux.ibm.com> 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
This commit is contained in:
parent
d0a0cacaba
commit
76dcb70dab
52 changed files with 542 additions and 0 deletions
|
@ -1,3 +1,58 @@
|
|||
2019-10-11 Ilya Leoshkevich <iii@linux.ibm.com>
|
||||
|
||||
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 <iii@linux.ibm.com>
|
||||
|
||||
* gcc.target/s390/vector/vec-scalar-cmp-1.c: Adjust
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } }
|
|
@ -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} } }
|
|
@ -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} } }
|
|
@ -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} } }
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
7
gcc/testsuite/gcc.target/s390/zvector/autovec-fortran.h
Normal file
7
gcc/testsuite/gcc.target/s390/zvector/autovec-fortran.h
Normal file
|
@ -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
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
|
@ -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} } } */
|
43
gcc/testsuite/gcc.target/s390/zvector/autovec.h
Normal file
43
gcc/testsuite/gcc.target/s390/zvector/autovec.h
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue