+2016-10-26 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ PR target/78056
+ * config/rs6000/rs6000.c (spe_init_builtins): Modify loops to not
+ define builtin functions from the bdesc_spe_predicates or
+ bdesc_spe_evsel arrays if the builtin mask is not compatible with
+ the current compiler configuration.
+ (paired_init_builtins): Modify loop to not define define builtin
+ functions from the bdesc_paried_preds array if the builtin mask is
+ not compatible with the current compiler configuration.
+ (altivec_init_builtins): Modify loops to not define the
+ __builtin_altivec_stxvl function nor the builtin functions from
+ the bdesc_dst or bdesc_altivec_preds, or bdesc_abs arrays if the
+ builtin mask is not compatible with the current compiler
+ configuration.
+
2016-10-26 Jeff Law <law@redhat.com>
* config/mips/mips.c (mips16_constant_cost): Add missing
tree pushort_type_node = build_pointer_type (short_unsigned_type_node);
const struct builtin_description *d;
size_t i;
+ HOST_WIDE_INT builtin_mask = rs6000_builtin_mask;
tree v2si_ftype_4_v2si
= build_function_type_list (opaque_V2SI_type_node,
for (i = 0; i < ARRAY_SIZE (bdesc_spe_predicates); ++i, d++)
{
tree type;
+ HOST_WIDE_INT mask = d->mask;
+
+ if ((mask & builtin_mask) != mask)
+ {
+ if (TARGET_DEBUG_BUILTIN)
+ fprintf (stderr, "spe_init_builtins, skip predicate %s\n",
+ d->name);
+ continue;
+ }
switch (insn_data[d->icode].operand[1].mode)
{
for (i = 0; i < ARRAY_SIZE (bdesc_spe_evsel); ++i, d++)
{
tree type;
+ HOST_WIDE_INT mask = d->mask;
+
+ if ((mask & builtin_mask) != mask)
+ {
+ if (TARGET_DEBUG_BUILTIN)
+ fprintf (stderr, "spe_init_builtins, skip evsel %s\n",
+ d->name);
+ continue;
+ }
switch (insn_data[d->icode].operand[1].mode)
{
{
const struct builtin_description *d;
size_t i;
+ HOST_WIDE_INT builtin_mask = rs6000_builtin_mask;
tree int_ftype_int_v2sf_v2sf
= build_function_type_list (integer_type_node,
for (i = 0; i < ARRAY_SIZE (bdesc_paired_preds); ++i, d++)
{
tree type;
+ HOST_WIDE_INT mask = d->mask;
+
+ if ((mask & builtin_mask) != mask)
+ {
+ if (TARGET_DEBUG_BUILTIN)
+ fprintf (stderr, "paired_init_builtins, skip predicate %s\n",
+ d->name);
+ continue;
+ }
if (TARGET_DEBUG_BUILTIN)
fprintf (stderr, "paired pred #%d, insn = %s [%d], mode = %s\n",
size_t i;
tree ftype;
tree decl;
+ HOST_WIDE_INT builtin_mask = rs6000_builtin_mask;
tree pvoid_type_node = build_pointer_type (void_type_node);
def_builtin ("__builtin_vec_stvrx", void_ftype_v16qi_long_pvoid, ALTIVEC_BUILTIN_VEC_STVRX);
def_builtin ("__builtin_vec_stvrxl", void_ftype_v16qi_long_pvoid, ALTIVEC_BUILTIN_VEC_STVRXL);
- def_builtin ("__builtin_altivec_stxvl", void_ftype_v16qi_pvoid_long,
- P9V_BUILTIN_STXVL);
+ if (TARGET_P9_VECTOR)
+ def_builtin ("__builtin_altivec_stxvl", void_ftype_v16qi_pvoid_long,
+ P9V_BUILTIN_STXVL);
/* Add the DST variants. */
d = bdesc_dst;
for (i = 0; i < ARRAY_SIZE (bdesc_dst); i++, d++)
- def_builtin (d->name, void_ftype_pcvoid_int_int, d->code);
+ {
+ HOST_WIDE_INT mask = d->mask;
+
+ if ((mask & builtin_mask) != mask)
+ {
+ if (TARGET_DEBUG_BUILTIN)
+ fprintf (stderr, "altivec_init_builtins, skip dst %s\n",
+ d->name);
+ continue;
+ }
+ def_builtin (d->name, void_ftype_pcvoid_int_int, d->code);
+ }
/* Initialize the predicates. */
d = bdesc_altivec_preds;
{
machine_mode mode1;
tree type;
+ HOST_WIDE_INT mask = d->mask;
+
+ if ((mask & builtin_mask) != mask)
+ {
+ if (TARGET_DEBUG_BUILTIN)
+ fprintf (stderr, "altivec_init_builtins, skip predicate %s\n",
+ d->name);
+ continue;
+ }
if (rs6000_overloaded_builtin_p (d->code))
mode1 = VOIDmode;
{
machine_mode mode0;
tree type;
+ HOST_WIDE_INT mask = d->mask;
+
+ if ((mask & builtin_mask) != mask)
+ {
+ if (TARGET_DEBUG_BUILTIN)
+ fprintf (stderr, "altivec_init_builtins, skip abs %s\n",
+ d->name);
+ continue;
+ }
mode0 = insn_data[d->icode].operand[0].mode;