summaryrefslogtreecommitdiff
path: root/gcc/config/s390/s390.c
diff options
context:
space:
mode:
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2017-03-24 14:04:12 +0000
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2017-03-24 14:04:12 +0000
commit063ed3cf28cc568a6e1f6a518c08c19cb6d6cd23 (patch)
treea5ca19d73677900d2c10dbd146a8c9748ff51855 /gcc/config/s390/s390.c
parent80912819e5b90e07e9c5dba736fdedb69aea4488 (diff)
downloadgcc-063ed3cf28cc568a6e1f6a518c08c19cb6d6cd23.tar.gz
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 <krebbel@linux.vnet.ibm.com> * 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<mode>", "vec_insert<mode>", "vec_promote<mode>") ("vec_insert_and_zero<mode>", "vec_mergeh<mode>") ("vec_mergel<mode>"): V_HW -> VEC_HW. ("vlrlrv16qi", "vstrlrv16qi", "vbpermv16qi", "vec_msumv2di") ("vmslg", "*vftci<mode>_cconly", "vftci<mode>_intcconly") ("*vftci<mode>", "vftci<mode>_intcc", "vec_double_s64") ("vec_double_u64", "vfmin<mode>", "vfmax<mode>"): 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_<fpcmpcc:code>v2df", "vec_any_<fpcmpcc:code>v2df") ("vec_scatter_elementv4si_DI", "vec_cmp<fpcmp:code>v2df") ("vec_di_to_df_s64", "vec_di_to_df_u64", "vec_df_to_di_u64") ("vfidb", "*vldeb", "*vledb", "*vec_cmp<insn_cmp>v2df_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_<fpcmpcc:code><mode>", "vec_any_<fpcmpcc:code><mode>") ("vec_scatter_element<V_HW_4:mode>_DI") ("vec_cmp<fpcmp:code><mode>", "vcdgb", "vcdlgb", "vclgdb") ("vec_fpint<mode>", "vflls") ("vflrd", "*vec_cmp<insn_cmp><mode>_cconly", "vec_cmpeq<mode>_cc") ("vec_cmpeq<mode>_cc", "vec_cmph<mode>_cc", "vec_cmphe<mode>_cc") ("*vec_cmpeq<mode>_cc", "*vec_cmph<mode>_cc") ("*vec_cmphe<mode>_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 <krebbel@linux.vnet.ibm.com> * 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
Diffstat (limited to 'gcc/config/s390/s390.c')
-rw-r--r--gcc/config/s390/s390.c17
1 files changed, 15 insertions, 2 deletions
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
@@ -625,6 +625,19 @@ const unsigned int bflags_overloaded_builtin[S390_OVERLOADED_BUILTIN_MAX + 1] =
};
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] =
{
#undef B_DEF
@@ -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;
}