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
This commit is contained in:
Andreas Krebbel 2017-10-06 09:19:46 +00:00 committed by Andreas Krebbel
parent 6fcb90c624
commit ac95a65da1
5 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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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HAR)
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)

View File

@ -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)

View File

@ -1,3 +1,8 @@
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

View File

@ -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);
}