From: Andreas Krebbel Date: Fri, 6 Oct 2017 09:19:46 +0000 (+0000) Subject: PR82322: S/390: Fix vec_ceil and friends X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac95a65da150a120cf729d1a773af7417e263330;p=gcc.git 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 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 PR target/82322 * gcc.target/s390/zvector/pr82322.c: New test. From-SVN: r253481 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a69364a896f..82479468f91 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-10-06 Andreas Krebbel + + 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 PR target/82317 diff --git a/gcc/config/s390/s390-builtin-types.def b/gcc/config/s390/s390-builtin-types.def index b466aa13e63..fa03f423a9a 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 7007e388dda..5cfe9a43de9 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 181935b4003..c7cbfa95ae4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-06 Andreas Krebbel + + PR target/82322 + * gcc.target/s390/zvector/pr82322.c: New test. + 2017-10-06 Andreas Krebbel PR target/82317 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 00000000000..87410e7a9d9 --- /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 + +vector double +foo (vector double a) { + return vec_ceil (a); +} + +vector float +bar (vector float a) { + return vec_ceil (a); +}