Commit 76794c52 by Andreas Krebbel Committed by Andreas Krebbel

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.

From-SVN: r246459
parent 2de2b3f9
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.
2017-03-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390.c (s390_expand_vec_compare): Support other
vector floating point modes than just V2DF.
(s390_expand_vcond): Likewise.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -145,6 +145,8 @@ extern const unsigned int opflags_builtin[S390_BUILTIN_MAX + 1];
extern const unsigned int
bflags_overloaded_builtin[S390_OVERLOADED_BUILTIN_MAX + 1];
extern const unsigned int
bflags_overloaded_builtin_var[S390_OVERLOADED_BUILTIN_VAR_MAX + 1];
extern const unsigned int
opflags_overloaded_builtin_var[S390_OVERLOADED_BUILTIN_VAR_MAX + 1];
static inline unsigned int
......
......@@ -61,7 +61,7 @@ type_for_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) FNTYPE,
#define OB_DEF_VAR(NAME, PATTERN, FLAGS, OPFLAGS, FNTYPE) FNTYPE,
#include "s390-builtins.def"
BT_OV_MAX
};
......@@ -259,6 +259,7 @@ s390_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
if (rid_code == RID_UNSIGNED || rid_code == RID_LONG
|| rid_code == RID_SHORT || rid_code == RID_SIGNED
|| rid_code == RID_INT || rid_code == RID_CHAR
|| (rid_code == RID_FLOAT && TARGET_VXE)
|| rid_code == RID_DOUBLE)
{
expand_this = C_CPP_HASHNODE (__vector_keyword);
......@@ -323,7 +324,7 @@ s390_cpu_cpp_builtins_internal (cpp_reader *pfile,
s390_def_or_undef_macro (pfile, MASK_OPT_VX, old_opts, opts,
"__VX__", "__VX__");
s390_def_or_undef_macro (pfile, MASK_ZVECTOR, old_opts, opts,
"__VEC__=10301", "__VEC__");
"__VEC__=10302", "__VEC__");
s390_def_or_undef_macro (pfile, MASK_ZVECTOR, old_opts, opts,
"__vector=__attribute__((vector_size(16)))",
"__vector__");
......@@ -471,11 +472,13 @@ s390_expand_overloaded_builtin (location_t loc,
}
return build_int_cst (NULL_TREE,
TYPE_VECTOR_SUBPARTS (TREE_TYPE ((*arglist)[0])));
case S390_OVERLOADED_BUILTIN_s390_vec_xl:
case S390_OVERLOADED_BUILTIN_s390_vec_xld2:
case S390_OVERLOADED_BUILTIN_s390_vec_xlw4:
return build2 (MEM_REF, return_type,
fold_build_pointer_plus ((*arglist)[1], (*arglist)[0]),
build_int_cst (TREE_TYPE ((*arglist)[1]), 0));
case S390_OVERLOADED_BUILTIN_s390_vec_xst:
case S390_OVERLOADED_BUILTIN_s390_vec_xstd2:
case S390_OVERLOADED_BUILTIN_s390_vec_xstw4:
return build2 (MODIFY_EXPR, TREE_TYPE((*arglist)[0]),
......@@ -848,6 +851,7 @@ s390_resolve_overloaded_builtin (location_t loc,
int last_match_type = INT_MAX;
int last_match_index = -1;
unsigned int all_op_flags;
const unsigned int ob_flags = bflags_for_builtin(ob_fcode);
int num_matches = 0;
tree target_builtin_decl, b_arg_chain, return_type;
enum s390_builtin_ov_type_index last_match_fntype_index;
......@@ -861,7 +865,7 @@ s390_resolve_overloaded_builtin (location_t loc,
/* 0...S390_BUILTIN_MAX-1 is for non-overloaded builtins. */
if (ob_fcode < S390_BUILTIN_MAX)
{
if (bflags_for_builtin(ob_fcode) & B_INT)
if (ob_flags & B_INT)
{
error_at (loc,
"builtin %qF is for GCC internal use only.",
......@@ -871,6 +875,21 @@ s390_resolve_overloaded_builtin (location_t loc,
return NULL_TREE;
}
if (ob_flags & B_DEP)
warning_at (loc, 0, "builtin %qF is deprecated.", ob_fndecl);
if (!TARGET_VX && (ob_flags & B_VX))
{
error_at (loc, "%qF requires -mvx", ob_fndecl);
return error_mark_node;
}
if (!TARGET_VXE && (ob_flags & B_VXE))
{
error_at (loc, "%qF requires -march=arch12 or higher", ob_fndecl);
return error_mark_node;
}
ob_fcode -= S390_BUILTIN_MAX;
for (b_arg_chain = TYPE_ARG_TYPES (TREE_TYPE (ob_fndecl));
......@@ -941,6 +960,20 @@ s390_resolve_overloaded_builtin (location_t loc,
return error_mark_node;
}
if (!TARGET_VXE
&& bflags_overloaded_builtin_var[last_match_index] & B_VXE)
{
error_at (loc, "%qs matching variant requires -march=arch12 or higher",
IDENTIFIER_POINTER (DECL_NAME (ob_fndecl)));
return error_mark_node;
}
if (bflags_overloaded_builtin_var[last_match_index] & B_DEP)
warning_at (loc, 0, "%qs matching variant is deprecated.",
IDENTIFIER_POINTER (DECL_NAME (ob_fndecl)));
/* Overloaded variants which have MAX set as low level builtin are
supposed to be replaced during expansion with something else. */
if (bt_for_overloaded_builtin_var[last_match_index] == S390_BUILTIN_MAX)
target_builtin_decl = ob_fndecl;
else
......
......@@ -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;
}
......
......@@ -156,6 +156,7 @@
UNSPEC_VEC_INSERT_AND_ZERO
UNSPEC_VEC_LOAD_BNDRY
UNSPEC_VEC_LOAD_LEN
UNSPEC_VEC_LOAD_LEN_R
UNSPEC_VEC_MERGEH
UNSPEC_VEC_MERGEL
UNSPEC_VEC_PACK
......@@ -169,6 +170,8 @@
UNSPEC_VEC_PERMI
UNSPEC_VEC_EXTEND
UNSPEC_VEC_STORE_LEN
UNSPEC_VEC_STORE_LEN_R
UNSPEC_VEC_VBPERM
UNSPEC_VEC_UNPACKH
UNSPEC_VEC_UNPACKH_L
UNSPEC_VEC_UNPACKL
......@@ -223,13 +226,18 @@
UNSPEC_VEC_VCGDB
UNSPEC_VEC_VCLGDB
UNSPEC_VEC_VFIDB
UNSPEC_VEC_VFI
UNSPEC_VEC_VLDEB
UNSPEC_VEC_VLEDB
UNSPEC_VEC_VFLL ; vector fp load lengthened
UNSPEC_VEC_VFLR ; vector fp load rounded
UNSPEC_VEC_VFTCIDB
UNSPEC_VEC_VFTCIDBCC
UNSPEC_VEC_VFTCI
UNSPEC_VEC_VFTCICC
UNSPEC_VEC_MSUM
UNSPEC_VEC_VFMIN
UNSPEC_VEC_VFMAX
])
;;
......@@ -400,7 +408,7 @@
;; Used to determine defaults for length and other attribute values.
(define_attr "op_type"
"NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY,RRF,SIL,RRS,RIS,VRI,VRR,VRS,VRV,VRX"
"NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY,RRF,SIL,RRS,RIS,VRI,VRR,VRS,VRV,VRX,VSI"
(const_string "NN"))
;; Instruction type attribute used for scheduling.
......
......@@ -21,18 +21,42 @@ along with GCC; see the file COPYING3. If not see
#ifndef _VECINTRIN_H
#define _VECINTRIN_H
#define __VFTCI_ZERO 1<<11
#define __VFTCI_ZERO_N 1<<10
#define __VFTCI_NORMAL 1<<9
#define __VFTCI_NORMAL_N 1<<8
#define __VFTCI_SUBNORMAL 1<<7
#define __VFTCI_SUBNORMAL_N 1<<6
#define __VFTCI_INF 1<<5
#define __VFTCI_INF_N 1<<4
#define __VFTCI_QNAN 1<<3
#define __VFTCI_QNAN_N 1<<2
#define __VFTCI_SNAN 1<<1
#define __VFTCI_SNAN_N 1<<0
#define __VEC_CLASS_FP_ZERO_P (1<<11)
#define __VEC_CLASS_FP_ZERO_N (1<<10)
#define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P \
| __VEC_CLASS_FP_ZERO_N)
#define __VEC_CLASS_FP_NORMAL_P (1<<9)
#define __VEC_CLASS_FP_NORMAL_N (1<<8)
#define __VEC_CLASS_FP_NORMAL (__VEC_CLASS_FP_NORMAL_P \
| __VEC_CLASS_FP_NORMAL_N)
#define __VEC_CLASS_FP_SUBNORMAL_P (1<<7)
#define __VEC_CLASS_FP_SUBNORMAL_N (1<<6)
#define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P \
| __VEC_CLASS_FP_SUBNORMAL_N)
#define __VEC_CLASS_FP_INFINITY_P (1<<5)
#define __VEC_CLASS_FP_INFINITY_N (1<<4)
#define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P \
| __VEC_CLASS_FP_INFINITY_N)
#define __VEC_CLASS_FP_QNAN_P (1<<3)
#define __VEC_CLASS_FP_QNAN_N (1<<2)
#define __VEC_CLASS_FP_QNAN (__VEC_CLASS_FP_QNAN_P \
| __VEC_CLASS_FP_QNAN_N)
#define __VEC_CLASS_FP_SNAN_P (1<<1)
#define __VEC_CLASS_FP_SNAN_N (1<<0)
#define __VEC_CLASS_FP_SNAN (__VEC_CLASS_FP_SNAN_P \
| __VEC_CLASS_FP_SNAN_N)
#define __VEC_CLASS_FP_NAN (__VEC_CLASS_FP_QNAN \
| __VEC_CLASS_FP_SNAN)
#define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN \
| __VEC_CLASS_FP_SUBNORMAL \
|__VEC_CLASS_FP_ZERO \
| __VEC_CLASS_FP_INFINITY)
/* This also accepts a type for its parameter, so it is not enough
to #define vec_step to __builtin_vec_step. */
......@@ -76,62 +100,69 @@ __lcbb(const void *ptr, int bndry)
#define vec_checksum __builtin_s390_vcksm
#define vec_gfmsum_128 __builtin_s390_vgfmg
#define vec_gfmsum_accum_128 __builtin_s390_vgfmag
#define vec_ceil(X) __builtin_s390_vfidb((X), 4, 6)
#define vec_roundp(X) __builtin_s390_vfidb((X), 4, 6)
#define vec_floor(X) __builtin_s390_vfidb((X), 4, 7)
#define vec_roundm(X) __builtin_s390_vfidb((X), 4, 7)
#define vec_trunc(X) __builtin_s390_vfidb((X), 4, 5)
#define vec_roundz(X) __builtin_s390_vfidb((X), 4, 5)
#define vec_roundc(X) __builtin_s390_vfidb((X), 4, 0)
#define vec_round(X) __builtin_s390_vfidb((X), 4, 4)
#define vec_ceil(X) __builtin_s390_vfi((X), 4, 6)
#define vec_roundp(X) __builtin_s390_vfi((X), 4, 6)
#define vec_floor(X) __builtin_s390_vfi((X), 4, 7)
#define vec_roundm(X) __builtin_s390_vfi((X), 4, 7)
#define vec_trunc(X) __builtin_s390_vfi((X), 4, 5)
#define vec_roundz(X) __builtin_s390_vfi((X), 4, 5)
#define vec_rint(X) __builtin_s390_vfi((X), 0, 0)
#define vec_roundc(X) __builtin_s390_vfi((X), 4, 0)
#define vec_round(X) __builtin_s390_vfi((X), 4, 4)
#define vec_signed(X) __builtin_s390_vcgdb((X), 0, 0)
#define vec_unsigned(X) __builtin_s390_vclgdb((X), 0, 0)
#define vec_doublee(X) __builtin_s390_vfll((X))
#define vec_floate(X) __builtin_s390_vflr((X), 0, 0)
#define vec_madd __builtin_s390_vfmadb
#define vec_msub __builtin_s390_vfmsdb
#define vec_load_len_r(X,Y) __builtin_s390_vlrl((Y),(X))
#define vec_store_len_r(X,Y) __builtin_s390_vstrl((Y),(X))
#define vec_all_nan(a) \
__extension__ ({ \
int __cc; \
__builtin_s390_vftcidb (a, \
__VFTCI_QNAN \
| __VFTCI_QNAN_N \
| __VFTCI_SNAN \
| __VFTCI_SNAN_N, &__cc); \
__builtin_s390_vec_fp_test_data_class (a, \
__VEC_CLASS_FP_QNAN \
| __VEC_CLASS_FP_QNAN_N \
| __VEC_CLASS_FP_SNAN \
| __VEC_CLASS_FP_SNAN_N, &__cc); \
__cc == 0 ? 1 : 0; \
})
#define vec_all_numeric(a) \
__extension__ ({ \
int __cc; \
__builtin_s390_vftcidb (a, \
__VFTCI_NORMAL \
| __VFTCI_NORMAL_N \
| __VFTCI_SUBNORMAL \
| __VFTCI_SUBNORMAL_N, &__cc); \
__builtin_s390_vec_fp_test_data_class (a, \
__VEC_CLASS_FP_NORMAL \
| __VEC_CLASS_FP_NORMAL_N \
| __VEC_CLASS_FP_SUBNORMAL \
| __VEC_CLASS_FP_SUBNORMAL_N, &__cc); \
__cc == 0 ? 1 : 0; \
})
#define vec_any_nan(a) \
__extension__ ({ \
int __cc; \
__builtin_s390_vftcidb (a, \
__VFTCI_QNAN \
| __VFTCI_QNAN_N \
| __VFTCI_SNAN \
| __VFTCI_SNAN_N, &cc); \
__builtin_s390_vec_fp_test_data_class (a, \
__VEC_CLASS_FP_QNAN \
| __VEC_CLASS_FP_QNAN_N \
| __VEC_CLASS_FP_SNAN \
| __VEC_CLASS_FP_SNAN_N, &cc); \
cc != 3 ? 1 : 0; \
})
#define vec_any_numeric(a) \
__extension__ ({ \
int __cc; \
__builtin_s390_vftcidb (a, \
__VFTCI_NORMAL \
| __VFTCI_NORMAL_N \
| __VFTCI_SUBNORMAL \
| __VFTCI_SUBNORMAL_N, &cc); \
__builtin_s390_vec_fp_test_data_class (a, \
__VEC_CLASS_FP_NORMAL \
| __VEC_CLASS_FP_NORMAL_N \
| __VEC_CLASS_FP_SUBNORMAL \
| __VEC_CLASS_FP_SUBNORMAL_N, &cc); \
cc != 3 ? 1 : 0; \
})
#define vec_gather_element __builtin_s390_vec_gather_element
#define vec_xl __builtin_s390_vec_xl
#define vec_xld2 __builtin_s390_vec_xld2
#define vec_xlw4 __builtin_s390_vec_xlw4
#define vec_splats __builtin_s390_vec_splats
......@@ -155,9 +186,11 @@ __lcbb(const void *ptr, int bndry)
#define vec_scatter_element __builtin_s390_vec_scatter_element
#define vec_sel __builtin_s390_vec_sel
#define vec_extend_s64 __builtin_s390_vec_extend_s64
#define vec_xst __builtin_s390_vec_xst
#define vec_xstd2 __builtin_s390_vec_xstd2
#define vec_xstw4 __builtin_s390_vec_xstw4
#define vec_store_len __builtin_s390_vec_store_len
#define vec_bperm_u128 __builtin_s390_vec_bperm_u128
#define vec_unpackh __builtin_s390_vec_unpackh
#define vec_unpackl __builtin_s390_vec_unpackl
#define vec_addc __builtin_s390_vec_addc
......@@ -223,6 +256,10 @@ __lcbb(const void *ptr, int bndry)
#define vec_sum_u128 __builtin_s390_vec_sum_u128
#define vec_sum4 __builtin_s390_vec_sum4
#define vec_test_mask __builtin_s390_vec_test_mask
#define vec_msum_u128 __builtin_s390_vec_msum_u128
#define vec_eqv __builtin_s390_vec_eqv
#define vec_nand __builtin_s390_vec_nand
#define vec_orc __builtin_s390_vec_orc
#define vec_find_any_eq_idx __builtin_s390_vec_find_any_eq_idx
#define vec_find_any_ne_idx __builtin_s390_vec_find_any_ne_idx
#define vec_find_any_eq_or_0_idx __builtin_s390_vec_find_any_eq_or_0_idx
......@@ -268,4 +305,10 @@ __lcbb(const void *ptr, int bndry)
#define vec_ctul __builtin_s390_vec_ctul
#define vec_ld2f __builtin_s390_vec_ld2f
#define vec_st2f __builtin_s390_vec_st2f
#define vec_double __builtin_s390_vec_double
#define vec_nmadd __builtin_s390_vec_nmadd
#define vec_nmsub __builtin_s390_vec_nmsub
#define vec_nabs __builtin_s390_vec_nabs
#define vec_sqrt __builtin_s390_vec_sqrt
#define vec_fp_test_data_class __builtin_s390_vec_fp_test_data_class
#endif /* _VECINTRIN_H */
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.
2017-03-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/vxe/negfma-1.c: New test.
2017-03-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
......
......@@ -16,8 +16,7 @@ void vx1(void)
__attribute__ ((target("arch=z10")))
void vx0(void)
{
vec_load_bndry ((const signed char *)0, 64); /* { dg-error "is not supported without -mvx" } */
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "is not supported without -mvx" } */
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "requires -mvx" } */
}
void vxd(void)
......
......@@ -24,8 +24,7 @@ void a0(void)
#ifdef __VEC__
#error __VEC__ is defined
#endif
vec_load_bndry ((const signed char *)0, 64); /* { dg-error "is not supported without -mvx" } */
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "is not supported without -mvx" } */
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "requires -mvx" } */
}
void d(void)
......@@ -33,6 +32,5 @@ void d(void)
#ifdef __VEC__
#error __VEC__ is defined
#endif
vec_load_bndry ((const signed char *)0, 64); /* { dg-error "is not supported without -mvx" } */
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "is not supported without -mvx" } */
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "requires -mvx" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment