diff options
author | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2017-10-06 09:19:46 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2017-10-06 09:19:46 +0000 |
commit | ac95a65da150a120cf729d1a773af7417e263330 (patch) | |
tree | aa54268a1f20dcb7f60f10c4c860d671cdd66e85 | |
parent | 6fcb90c624db95f1b483e0d403e95215d4732bd6 (diff) | |
download | gcc-ac95a65da150a120cf729d1a773af7417e263330.zip gcc-ac95a65da150a120cf729d1a773af7417e263330.tar.gz gcc-ac95a65da150a120cf729d1a773af7417e263330.tar.bz2 |
PR82322: S/390: Fix vec_ceil and friends
vec_ceil and friends are expanded by vecintrin.h to __builtin_s390_vfi
which is an overloaded builtin being replaced by either
__builtin_s390_vfisb or __builtin_s390_vfidb depending on its argument
types.
The problem in this PR was that the overloaded builtin definition of
__builtin_s390_vfi was missing in s390-builtins.def.
gcc/ChangeLog:
2017-10-06 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/82322
* config/s390/s390-builtins.def (s390_vfi): Define new overloaded
builtin.
* config/s390/s390-builtin-types.def: Regenerate.
gcc/testsuite/ChangeLog:
2017-10-06 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/82322
* gcc.target/s390/zvector/pr82322.c: New test.
From-SVN: r253481
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/s390/s390-builtin-types.def | 3 | ||||
-rw-r--r-- | gcc/config/s390/s390-builtins.def | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/zvector/pr82322.c | 22 |
5 files changed, 41 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a69364a..8247946 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2017-10-06 Andreas Krebbel <krebbel@linux.vnet.ibm.com> + PR target/82322 + * config/s390/s390-builtins.def (s390_vfi): Define new overloaded + builtin. + * config/s390/s390-builtin-types.def: Regenerate. + +2017-10-06 Andreas Krebbel <krebbel@linux.vnet.ibm.com> + PR target/82317 * config/s390/s390-builtin-types.def: Regenerate. * config/s390/s390-builtins.def (s390_vfmaxdb_4, s390_vfmindb_4): diff --git a/gcc/config/s390/s390-builtin-types.def b/gcc/config/s390/s390-builtin-types.def index b466aa1..fa03f42 100644 --- a/gcc/config/s390/s390-builtin-types.def +++ b/gcc/config/s390/s390-builtin-types.def @@ -312,6 +312,7 @@ DEF_FN_TYPE_3 (BT_FN_V16QI_V8HI_V8HI_INTPTR, BT_V16QI, BT_V8HI, BT_V8HI, BT_INTP DEF_FN_TYPE_3 (BT_FN_V2DF_UV2DI_INT_INT, BT_V2DF, BT_UV2DI, BT_INT, BT_INT) DEF_FN_TYPE_3 (BT_FN_V2DF_V2DF_DBL_INT, BT_V2DF, BT_V2DF, BT_DBL, BT_INT) DEF_FN_TYPE_3 (BT_FN_V2DF_V2DF_UCHAR_UCHAR, BT_V2DF, BT_V2DF, BT_UCHAR, BT_UCHAR) +DEF_FN_TYPE_3 (BT_FN_V2DF_V2DF_UINT_UINT, BT_V2DF, BT_V2DF, BT_UINT, BT_UINT) DEF_FN_TYPE_3 (BT_FN_V2DF_V2DF_V2DF_INT, BT_V2DF, BT_V2DF, BT_V2DF, BT_INT) DEF_FN_TYPE_3 (BT_FN_V2DF_V2DF_V2DF_V2DF, BT_V2DF, BT_V2DF, BT_V2DF, BT_V2DF) DEF_FN_TYPE_3 (BT_FN_V2DF_V2DI_INT_INT, BT_V2DF, BT_V2DI, BT_INT, BT_INT) @@ -664,6 +665,7 @@ DEF_OV_TYPE (BT_OV_V2DF_UV2DI_INT, BT_V2DF, BT_UV2DI, BT_INT) DEF_OV_TYPE (BT_OV_V2DF_V2DF, BT_V2DF, BT_V2DF) DEF_OV_TYPE (BT_OV_V2DF_V2DF_BV2DI, BT_V2DF, BT_V2DF, BT_BV2DI) DEF_OV_TYPE (BT_OV_V2DF_V2DF_UCHAR, BT_V2DF, BT_V2DF, BT_UCHAR) +DEF_OV_TYPE (BT_OV_V2DF_V2DF_UCHAR_UCHAR, BT_V2DF, BT_V2DF, BT_UCHAR, BT_UCHAR) DEF_OV_TYPE (BT_OV_V2DF_V2DF_UV2DI, BT_V2DF, BT_V2DF, BT_UV2DI) DEF_OV_TYPE (BT_OV_V2DF_V2DF_UV2DI_DBLCONSTPTR_UCHAR, BT_V2DF, BT_V2DF, BT_UV2DI, BT_DBLCONSTPTR, BT_UCHAR) DEF_OV_TYPE (BT_OV_V2DF_V2DF_V2DF, BT_V2DF, BT_V2DF, BT_V2DF) @@ -717,6 +719,7 @@ DEF_OV_TYPE (BT_OV_V4SF_LONG_FLTPTR, BT_V4SF, BT_LONG, BT_FLTPTR) DEF_OV_TYPE (BT_OV_V4SF_V4SF, BT_V4SF, BT_V4SF) DEF_OV_TYPE (BT_OV_V4SF_V4SF_BV4SI, BT_V4SF, BT_V4SF, BT_BV4SI) DEF_OV_TYPE (BT_OV_V4SF_V4SF_UCHAR, BT_V4SF, BT_V4SF, BT_UCHAR) +DEF_OV_TYPE (BT_OV_V4SF_V4SF_UCHAR_UCHAR, BT_V4SF, BT_V4SF, BT_UCHAR, BT_UCHAR) DEF_OV_TYPE (BT_OV_V4SF_V4SF_UV4SI, BT_V4SF, BT_V4SF, BT_UV4SI) DEF_OV_TYPE (BT_OV_V4SF_V4SF_UV4SI_FLTCONSTPTR_UCHAR, BT_V4SF, BT_V4SF, BT_UV4SI, BT_FLTCONSTPTR, BT_UCHAR) DEF_OV_TYPE (BT_OV_V4SF_V4SF_V4SF, BT_V4SF, BT_V4SF, BT_V4SF) diff --git a/gcc/config/s390/s390-builtins.def b/gcc/config/s390/s390-builtins.def index 7007e38..5cfe9a4 100644 --- a/gcc/config/s390/s390-builtins.def +++ b/gcc/config/s390/s390-builtins.def @@ -2778,6 +2778,10 @@ OB_DEF (s390_vec_ctd, s390_vec_ctd_s64, s390_vec_ctd_u64, OB_DEF_VAR (s390_vec_ctd_s64, s390_vec_ctd_s64, 0, O2_U5, BT_OV_V2DF_V2DI_INT) /* vcdgb */ OB_DEF_VAR (s390_vec_ctd_u64, s390_vec_ctd_u64, 0, O2_U5, BT_OV_V2DF_UV2DI_INT) /* vcdlgb */ +OB_DEF (s390_vfi, s390_vfi_flt, s390_vfi_dbl, B_VX, BT_FN_V2DF_V2DF_UINT_UINT) +OB_DEF_VAR (s390_vfi_flt, s390_vfisb, 0, O2_U4 | O3_U3, BT_OV_V4SF_V4SF_UCHAR_UCHAR) /* vfisb */ +OB_DEF_VAR (s390_vfi_dbl, s390_vfidb, 0, O2_U4 | O3_U3, BT_OV_V2DF_V2DF_UCHAR_UCHAR) /* vfidb */ + B_DEF (s390_vec_ctd_s64, vec_ctd_s64, 0, B_VX, O2_U3, BT_FN_V2DF_V2DI_INT) /* vcdgb */ B_DEF (s390_vec_ctd_u64, vec_ctd_u64, 0, B_VX, O2_U3, BT_FN_V2DF_UV2DI_INT) /* vcdlgb */ B_DEF (s390_vcdgb, vcdgb, 0, B_VX, O2_U4 | O3_U3, BT_FN_V2DF_V2DI_INT_INT) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 181935b..c7cbfa9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2017-10-06 Andreas Krebbel <krebbel@linux.vnet.ibm.com> + PR target/82322 + * gcc.target/s390/zvector/pr82322.c: New test. + +2017-10-06 Andreas Krebbel <krebbel@linux.vnet.ibm.com> + PR target/82317 * gcc.target/s390/zvector/pr82317.c: New test. diff --git a/gcc/testsuite/gcc.target/s390/zvector/pr82322.c b/gcc/testsuite/gcc.target/s390/zvector/pr82322.c new file mode 100644 index 0000000..87410e7 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/pr82322.c @@ -0,0 +1,22 @@ +/* { dg-do compile { target { s390*-*-* } } } */ +/* { dg-options "-march=z14 -mzarch -mzvector" } */ + +/* vec_ceil and friends are expanded by vecintrin.h to + __builtin_s390_vfi which is an overloaded builtin being replaced by + either __builtin_s390_vfisb or __builtin_s390_vfidb depending on + its argument types. + + The problem in this PR was that the overloaded builtin definition + was missing in s390-builtins.def. */ + +#include <vecintrin.h> + +vector double +foo (vector double a) { + return vec_ceil (a); +} + +vector float +bar (vector float a) { + return vec_ceil (a); +} |