From 063ed3cf28cc568a6e1f6a518c08c19cb6d6cd23 Mon Sep 17 00:00:00 2001 From: krebbel Date: Fri, 24 Mar 2017 14:04:12 +0000 Subject: S/390: arch12: New builtins. This patch implements a set of low-level builtins for instruction which would otherwise not be emitted by the compiler plus a set of high-level builtins as defined by the IBM XL compiler. The high-level builtins will be described in a future revision of the z/OS XL C/C++ Programming Guide. I'll try to come up with a documentation appropriate for the GCC manual as well (sometimes in the future). gcc/ChangeLog: 2017-03-24 Andreas Krebbel * config/s390/s390-builtins.def: Add VXE builtins. Add a flags argument to the overloaded builtin variants. Use the new flag to deprecate certain builtin variants. * config/s390/s390-builtin-types.def: Add new builtin types. * config/s390/s390-builtins.h: Support new flags field for overloaded builtins. * config/s390/s390-c.c (OB_DEF_VAR): New flags field. (s390_macro_to_expand): Enable vector float data type. (s390_cpu_cpp_builtins_internal): Indicate support of the new builtins by incrementing the __VEC__ version number. (s390_expand_overloaded_builtin): Support expansion of vec_xl and vec_xst. (s390_resolve_overloaded_builtin): Emit error messages depending on the builtin flags. * config/s390/s390.c (s390_expand_builtin): Support additional flags argument. Change error message to match the messages emitted in s390-c.c. * config/s390/s390.md: New UNSPEC_* constants. (op_type): Add new instruction types. * config/s390/vecintrin.h: Add new builtins and test data class constants. * config/s390/vx-builtins.md (V_HW_32_64): Add V4SF. (V_HW_4, VEC_HW, VECF_HW): New mode iterators. (VEC_INEXACT, VEC_NOINEXACT): New constants. ("vec_splats", "vec_insert", "vec_promote") ("vec_insert_and_zero", "vec_mergeh") ("vec_mergel"): V_HW -> VEC_HW. ("vlrlrv16qi", "vstrlrv16qi", "vbpermv16qi", "vec_msumv2di") ("vmslg", "*vftci_cconly", "vftci_intcconly") ("*vftci", "vftci_intcc", "vec_double_s64") ("vec_double_u64", "vfmin", "vfmax"): New definition. ("and_av2df3", "and_cv2df3", "vec_andc_av2df3") ("vec_andc_cv2df3", "xor_av2df3", "xor_cv2df3", "vec_nor_av2df3") ("vec_nor_cv2df3", "ior_av2df3", "ior_cv2df3", "vec_nabs") ("*vftcidb", "*vftcidb_cconly", "vftcidb"): Remove definition. ("vec_all_v2df", "vec_any_v2df") ("vec_scatter_elementv4si_DI", "vec_cmpv2df") ("vec_di_to_df_s64", "vec_di_to_df_u64", "vec_df_to_di_u64") ("vfidb", "*vldeb", "*vledb", "*vec_cmpv2df_cconly") ("vec_cmpeqv2df_cc", "vec_cmpeqv2df_cc", "vec_cmphv2df_cc") ("vec_cmphev2df_cc", "*vec_cmpeqv2df_cc") ("*vec_cmphv2df_cc", "*vec_cmphev2df_cc"): Enable new modes as ... ("vec_all_", "vec_any_") ("vec_scatter_element_DI") ("vec_cmp", "vcdgb", "vcdlgb", "vclgdb") ("vec_fpint", "vflls") ("vflrd", "*vec_cmp_cconly", "vec_cmpeq_cc") ("vec_cmpeq_cc", "vec_cmph_cc", "vec_cmphe_cc") ("*vec_cmpeq_cc", "*vec_cmph_cc") ("*vec_cmphe_cc"): ... these. ("vec_ctd_s64", "vec_ctsl", "vec_ctul", "vec_st2f"): Use rounding mode constant instead of magic value. gcc/testsuite/ChangeLog: 2017-03-24 Andreas Krebbel * gcc.target/s390/target-attribute/tattr-3.c: Adjust error message and remove the high-level builtin. The error message for the would prevent compilation from reaching the second. * gcc.target/s390/target-attribute/tattr-4.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246459 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/s390/s390.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'gcc/config/s390/s390.c') diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 1d26979cdea..0b1a95f2dca 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -624,6 +624,19 @@ const unsigned int bflags_overloaded_builtin[S390_OVERLOADED_BUILTIN_MAX + 1] = 0 }; +const unsigned int +bflags_overloaded_builtin_var[S390_OVERLOADED_BUILTIN_VAR_MAX + 1] = + { +#undef B_DEF +#undef OB_DEF +#undef OB_DEF_VAR +#define B_DEF(...) +#define OB_DEF(...) +#define OB_DEF_VAR(NAME, PATTERN, FLAGS, OPFLAGS, FNTYPE) FLAGS, +#include "s390-builtins.def" + 0 + }; + const unsigned int opflags_overloaded_builtin_var[S390_OVERLOADED_BUILTIN_VAR_MAX + 1] = { @@ -632,7 +645,7 @@ opflags_overloaded_builtin_var[S390_OVERLOADED_BUILTIN_VAR_MAX + 1] = #undef OB_DEF_VAR #define B_DEF(...) #define OB_DEF(...) -#define OB_DEF_VAR(NAME, PATTERN, FLAGS, FNTYPE) FLAGS, +#define OB_DEF_VAR(NAME, PATTERN, FLAGS, OPFLAGS, FNTYPE) OPFLAGS, #include "s390-builtins.def" 0 }; @@ -827,7 +840,7 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, } if (((bflags & B_VX) || (bflags & B_VXE)) && !TARGET_VX) { - error ("builtin %qF is not supported without -mvx " + error ("builtin %qF requires -mvx " "(default with -march=z13 and higher).", fndecl); return const0_rtx; } -- cgit v1.2.1