}
/* Define or undefine macros based on the current target. If the user does
- #pragma GCC target, we need to adjust the macros dynamically. Note, some of
- the options needed for builtins have been moved to separate variables, so
- have both the target flags and the builtin flags as arguments. */
+ #pragma GCC target, we need to adjust the macros dynamically. */
void
-rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags,
- HOST_WIDE_INT bu_mask)
+rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags)
{
if (TARGET_DEBUG_BUILTIN || TARGET_DEBUG_TARGET)
fprintf (stderr,
- "rs6000_target_modify_macros (%s, " HOST_WIDE_INT_PRINT_HEX
- ", " HOST_WIDE_INT_PRINT_HEX ")\n",
+ "rs6000_target_modify_macros (%s, " HOST_WIDE_INT_PRINT_HEX ")\n",
(define_p) ? "define" : "undef",
- flags, bu_mask);
+ flags);
/* Each of the flags mentioned below controls whether certain
preprocessor macros will be automatically defined when
if ((flags & OPTION_MASK_FLOAT128_HW) != 0)
rs6000_define_or_undefine_macro (define_p, "__FLOAT128_HARDWARE__");
- /* options from the builtin masks. */
- /* Note that OPTION_MASK_FPRND is enabled only if
- (rs6000_cpu == PROCESSOR_CELL) (e.g. -mcpu=cell). */
- if ((bu_mask & OPTION_MASK_FPRND) != 0)
+ /* Tell the user if we are targeting CELL. */
+ if (rs6000_cpu == PROCESSOR_CELL)
rs6000_define_or_undefine_macro (define_p, "__PPU__");
/* Tell the user if we support the MMA instructions. */
rs6000_cpu_cpp_builtins (cpp_reader *pfile)
{
/* Define all of the common macros. */
- rs6000_target_modify_macros (true, rs6000_isa_flags,
- rs6000_builtin_mask_calculate ());
+ rs6000_target_modify_macros (true, rs6000_isa_flags);
if (TARGET_FRE)
builtin_define ("__RECIP__");
/* Pointer to function (in rs6000-c.cc) that can define or undefine target
macros that have changed. Languages that don't support the preprocessor
don't link in rs6000-c.cc, so we can't call it directly. */
-void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT, HOST_WIDE_INT);
+void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT);
/* Simplfy register classes into simpler classifications. We assume
GPR_REG_TYPE - FPR_REG_TYPE are ordered so that we can use a simple range
static void rs6000_print_isa_options (FILE *, int, const char *,
HOST_WIDE_INT);
-static void rs6000_print_builtin_options (FILE *, int, const char *,
- HOST_WIDE_INT);
static HOST_WIDE_INT rs6000_disable_incompatible_switches (void);
static enum rs6000_reg_type register_to_reg_type (rtx, bool *);
rs6000_print_isa_options (stderr, 0, "rs6000_isa_flags_explicit",
rs6000_isa_flags_explicit);
- rs6000_print_builtin_options (stderr, 0, "rs6000_builtin_mask",
- rs6000_builtin_mask);
-
rs6000_print_isa_options (stderr, 0, "TARGET_DEFAULT", TARGET_DEFAULT);
fprintf (stderr, DEBUG_FMT_S, "--with-cpu default",
#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 64
#endif
-/* Return the builtin mask of the various options used that could affect which
- builtins were used. In the past we used target_flags, but we've run out of
- bits, and some options are no longer in target_flags. */
-
-HOST_WIDE_INT
-rs6000_builtin_mask_calculate (void)
-{
- return (((TARGET_ALTIVEC) ? OPTION_MASK_ALTIVEC : 0)
- | ((TARGET_CMPB) ? OPTION_MASK_CMPB : 0)
- | ((TARGET_VSX) ? OPTION_MASK_VSX : 0)
- | ((TARGET_FRE) ? OPTION_MASK_POPCNTB : 0)
- | ((TARGET_FRES) ? OPTION_MASK_PPC_GFXOPT : 0)
- | ((TARGET_FRSQRTE) ? OPTION_MASK_PPC_GFXOPT : 0)
- | ((TARGET_FRSQRTES) ? OPTION_MASK_POPCNTB : 0)
- | ((TARGET_POPCNTD) ? OPTION_MASK_POPCNTD : 0)
- | ((rs6000_cpu == PROCESSOR_CELL) ? OPTION_MASK_FPRND : 0)
- | ((TARGET_P8_VECTOR) ? OPTION_MASK_P8_VECTOR : 0)
- | ((TARGET_P9_VECTOR) ? OPTION_MASK_P9_VECTOR : 0)
- | ((TARGET_P9_MISC) ? OPTION_MASK_P9_MISC : 0)
- | ((TARGET_MODULO) ? OPTION_MASK_MODULO : 0)
- | ((TARGET_64BIT) ? MASK_64BIT : 0)
- | ((TARGET_POWERPC64) ? MASK_POWERPC64 : 0)
- | ((TARGET_CRYPTO) ? OPTION_MASK_CRYPTO : 0)
- | ((TARGET_HTM) ? OPTION_MASK_HTM : 0)
- | ((TARGET_DFP) ? OPTION_MASK_DFP : 0)
- | ((TARGET_HARD_FLOAT) ? OPTION_MASK_SOFT_FLOAT : 0)
- | ((TARGET_LONG_DOUBLE_128
- && TARGET_HARD_FLOAT
- && !TARGET_IEEEQUAD) ? OPTION_MASK_MULTIPLE : 0)
- | ((TARGET_FLOAT128_TYPE) ? OPTION_MASK_FLOAT128_KEYWORD : 0)
- | ((TARGET_FLOAT128_HW) ? OPTION_MASK_FLOAT128_HW : 0)
- | ((TARGET_MMA) ? OPTION_MASK_MMA : 0)
- | ((TARGET_POWER10) ? OPTION_MASK_POWER10 : 0));
-}
-
/* Implement TARGET_MD_ASM_ADJUST. All asm statements are considered
to clobber the XER[CA] bit because clobbering that bit without telling
the compiler worked just fine with versions of GCC before GCC 5, and
generally defined to test the corresponding bit of the
rs6000_isa_flags variable.
- The variable rs6000_builtin_mask is set to represent the target
- options for the most current compilation efforts, consistent with
- the current contents of rs6000_isa_flags. This variable controls
- expansion of built-in functions.
-
Various other global variables and fields of global structures
(over 50 in all) are initialized to reflect the desired options
for the most current compilation efforts. */
}
}
- /* Set the builtin mask of the various options used that could affect which
- builtins were used. In the past we used target_flags, but we've run out
- of bits, and some options are no longer in target_flags. */
- rs6000_builtin_mask = rs6000_builtin_mask_calculate ();
- if (TARGET_DEBUG_BUILTIN || TARGET_DEBUG_TARGET)
- rs6000_print_builtin_options (stderr, 0, "builtin mask",
- rs6000_builtin_mask);
-
/* Initialize all of the registers. */
rs6000_init_hard_regno_mode_ok (global_init_p);
{ "string", 0, false, false },
};
-/* Builtin mask mapping for printing the flags. */
-static struct rs6000_opt_mask const rs6000_builtin_mask_names[] =
-{
- { "altivec", OPTION_MASK_ALTIVEC, false, false },
- { "vsx", OPTION_MASK_VSX, false, false },
- { "fre", OPTION_MASK_POPCNTB, false, false },
- { "fres", OPTION_MASK_PPC_GFXOPT, false, false },
- { "frsqrte", OPTION_MASK_PPC_GFXOPT, false, false },
- { "frsqrtes", OPTION_MASK_POPCNTB, false, false },
- { "popcntd", OPTION_MASK_POPCNTD, false, false },
- { "cell", OPTION_MASK_FPRND, false, false },
- { "power8-vector", OPTION_MASK_P8_VECTOR, false, false },
- { "power9-vector", OPTION_MASK_P9_VECTOR, false, false },
- { "power9-misc", OPTION_MASK_P9_MISC, false, false },
- { "crypto", OPTION_MASK_CRYPTO, false, false },
- { "htm", OPTION_MASK_HTM, false, false },
- { "hard-dfp", OPTION_MASK_DFP, false, false },
- { "hard-float", OPTION_MASK_SOFT_FLOAT, false, false },
- { "long-double-128", OPTION_MASK_MULTIPLE, false, false },
- { "powerpc64", MASK_POWERPC64, false, false },
- { "float128", OPTION_MASK_FLOAT128_KEYWORD, false, false },
- { "float128-hw", OPTION_MASK_FLOAT128_HW,false, false },
- { "mma", OPTION_MASK_MMA, false, false },
- { "power10", OPTION_MASK_POWER10, false, false },
-};
-
/* Option variables that we want to support inside attribute((target)) and
#pragma GCC target operations. */
tree cur_tree;
struct cl_target_option *prev_opt, *cur_opt;
HOST_WIDE_INT prev_flags, cur_flags, diff_flags;
- HOST_WIDE_INT prev_bumask, cur_bumask, diff_bumask;
if (TARGET_DEBUG_TARGET)
{
if (rs6000_target_modify_macros_ptr)
{
prev_opt = TREE_TARGET_OPTION (prev_tree);
- prev_bumask = prev_opt->x_rs6000_builtin_mask;
prev_flags = prev_opt->x_rs6000_isa_flags;
cur_opt = TREE_TARGET_OPTION (cur_tree);
cur_flags = cur_opt->x_rs6000_isa_flags;
- cur_bumask = cur_opt->x_rs6000_builtin_mask;
- diff_bumask = (prev_bumask ^ cur_bumask);
diff_flags = (prev_flags ^ cur_flags);
- if ((diff_flags != 0) || (diff_bumask != 0))
+ if (diff_flags != 0)
{
/* Delete old macros. */
rs6000_target_modify_macros_ptr (false,
- prev_flags & diff_flags,
- prev_bumask & diff_bumask);
+ prev_flags & diff_flags);
/* Define new macros. */
rs6000_target_modify_macros_ptr (true,
- cur_flags & diff_flags,
- cur_bumask & diff_bumask);
+ cur_flags & diff_flags);
}
}
ARRAY_SIZE (rs6000_opt_masks));
}
-static void
-rs6000_print_builtin_options (FILE *file, int indent, const char *string,
- HOST_WIDE_INT flags)
-{
- rs6000_print_options_internal (file, indent, string, flags, "",
- &rs6000_builtin_mask_names[0],
- ARRAY_SIZE (rs6000_builtin_mask_names));
-}
-
/* If the user used -mno-vsx, we need turn off all of the implicit ISA 2.06,
2.07, and 3.0 options that relate to the vector unit (-mdirect-move,
-mupper-regs-df, etc.).