https://gcc.gnu.org/g:7b3aab01b840314a6e50811dc98d3cf641056ead
commit 7b3aab01b840314a6e50811dc98d3cf641056ead Author: Michael Meissner <[email protected]> Date: Thu Nov 6 19:49:41 2025 -0500 Revert changes Diff: --- gcc/config/rs6000/rs6000-c.cc | 16 ++---- gcc/config/rs6000/rs6000-cpus.def | 4 -- gcc/config/rs6000/rs6000-opts.h | 2 - gcc/config/rs6000/rs6000-protos.h | 5 +- gcc/config/rs6000/rs6000-tables.opt | 3 -- gcc/config/rs6000/rs6000.cc | 79 ++++++++--------------------- gcc/config/rs6000/rs6000.h | 10 ---- gcc/config/rs6000/rs6000.opt | 7 --- gcc/testsuite/gcc.target/powerpc/future-1.c | 13 ----- gcc/testsuite/gcc.target/powerpc/future-2.c | 24 --------- 10 files changed, 26 insertions(+), 137 deletions(-) diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc index 9e65af553305..d3b0a5668212 100644 --- a/gcc/config/rs6000/rs6000-c.cc +++ b/gcc/config/rs6000/rs6000-c.cc @@ -338,19 +338,13 @@ rs6000_define_or_undefine_macro (bool define_p, const char *name) #pragma GCC target, we need to adjust the macros dynamically. */ void -rs6000_target_modify_macros (bool define_p, - HOST_WIDE_INT flags, - bool change_future_p, - bool future_p) +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 - ", %s, %s)\n", + "rs6000_target_modify_macros (%s, " HOST_WIDE_INT_PRINT_HEX ")\n", (define_p) ? "define" : "undef", - flags, - change_future_p, - future_p); + flags); /* Each of the flags mentioned below controls whether certain preprocessor macros will be automatically defined when @@ -443,8 +437,6 @@ rs6000_target_modify_macros (bool define_p, rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR10"); if ((flags & OPTION_MASK_POWER11) != 0) rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR11"); - if (change_future_p) - rs6000_define_or_undefine_macro (future_p, "_ARCH_FUTURE"); if ((flags & OPTION_MASK_SOFT_FLOAT) != 0) rs6000_define_or_undefine_macro (define_p, "_SOFT_FLOAT"); if ((flags & OPTION_MASK_RECIP_PRECISION) != 0) @@ -613,7 +605,7 @@ void rs6000_cpu_cpp_builtins (cpp_reader *pfile) { /* Define all of the common macros. */ - rs6000_target_modify_macros (true, rs6000_isa_flags, true, TARGET_FUTURE); + rs6000_target_modify_macros (true, rs6000_isa_flags); if (TARGET_FRE) builtin_define ("__RECIP__"); diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def index 4cbbe94a0107..4a1037616d7f 100644 --- a/gcc/config/rs6000/rs6000-cpus.def +++ b/gcc/config/rs6000/rs6000-cpus.def @@ -92,9 +92,6 @@ | OPTION_MASK_FLOAT128_HW \ | OPTION_MASK_P9_MINMAX) -/* Options for -mcpu=future. */ -#define FUTURE_MASKS_SERVER POWER11_MASKS_SERVER - /* Flags that need to be turned off if -mno-altivec. */ #define OTHER_ALTIVEC_MASKS (OTHER_VSX_VECTOR_MASKS \ | OPTION_MASK_VSX) @@ -258,4 +255,3 @@ RS6000_CPU ("powerpc64", PROCESSOR_POWERPC64, OPTION_MASK_PPC_GFXOPT RS6000_CPU ("powerpc64le", PROCESSOR_POWER8, MASK_POWERPC64 | ISA_2_7_MASKS_SERVER | OPTION_MASK_HTM) RS6000_CPU ("rs64", PROCESSOR_RS64A, OPTION_MASK_PPC_GFXOPT | MASK_POWERPC64) -RS6000_CPU ("future", PROCESSOR_FUTURE, MASK_POWERPC64 | FUTURE_MASKS_SERVER) diff --git a/gcc/config/rs6000/rs6000-opts.h b/gcc/config/rs6000/rs6000-opts.h index be2cacbd5e6a..c31d2975f046 100644 --- a/gcc/config/rs6000/rs6000-opts.h +++ b/gcc/config/rs6000/rs6000-opts.h @@ -71,8 +71,6 @@ enum processor_type PROCESSOR_TITAN }; -/* Treat -mcpu=future as -mcpu=power11. */ -#define PROCESSOR_FUTURE PROCESSOR_POWER11 /* Types of costly dependences. */ enum rs6000_dependence_cost diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 5392eaf6309e..234eb0ae2b3a 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -324,9 +324,8 @@ extern void rs6000_cpu_cpp_builtins (struct cpp_reader *); extern bool rs6000_pragma_target_parse (tree, tree); #endif extern void rs6000_activate_target_options (tree new_tree); -extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT, bool, bool); -extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT, bool, - bool); +extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT); +extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT); #ifdef NO_DOLLAR_IN_LABEL const char * rs6000_xcoff_strip_dollar (const char *); diff --git a/gcc/config/rs6000/rs6000-tables.opt b/gcc/config/rs6000/rs6000-tables.opt index 9e68c5a66e13..f5bbed5ea746 100644 --- a/gcc/config/rs6000/rs6000-tables.opt +++ b/gcc/config/rs6000/rs6000-tables.opt @@ -200,6 +200,3 @@ Enum(rs6000_cpu_opt_value) String(powerpc64le) Value(56) EnumValue Enum(rs6000_cpu_opt_value) String(rs64) Value(57) -EnumValue -Enum(rs6000_cpu_opt_value) String(future) Value(58) - diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 782977c83a8a..1d5cd25c0f08 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -277,7 +277,7 @@ bool cpu_builtin_p = false; /* 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, bool, bool); +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 @@ -1170,7 +1170,7 @@ enum reg_class (*rs6000_preferred_reload_class_ptr) (rtx, enum reg_class) const int INSN_NOT_AVAILABLE = -1; static void rs6000_print_isa_options (FILE *, int, const char *, - HOST_WIDE_INT, bool); + HOST_WIDE_INT); static HOST_WIDE_INT rs6000_disable_incompatible_switches (void); static enum rs6000_reg_type register_to_reg_type (rtx, bool *); @@ -2398,11 +2398,9 @@ rs6000_debug_reg_global (void) const char *name = processor_target_table[rs6000_cpu_index].name; HOST_WIDE_INT flags = processor_target_table[rs6000_cpu_index].target_enable; - bool future = strcmp (processor_target_table[rs6000_cpu_index].name, - "future") == 0; sprintf (flags_buffer, "-mcpu=%s flags", name); - rs6000_print_isa_options (stderr, 0, flags_buffer, flags, future); + rs6000_print_isa_options (stderr, 0, flags_buffer, flags); } else fprintf (stderr, DEBUG_FMT_S, "cpu", "<none>"); @@ -2412,24 +2410,21 @@ rs6000_debug_reg_global (void) const char *name = processor_target_table[rs6000_tune_index].name; HOST_WIDE_INT flags = processor_target_table[rs6000_tune_index].target_enable; - bool future = strcmp (processor_target_table[rs6000_tune_index].name, - "future") == 0; sprintf (flags_buffer, "-mtune=%s flags", name); - rs6000_print_isa_options (stderr, 0, flags_buffer, flags, future); + rs6000_print_isa_options (stderr, 0, flags_buffer, flags); } else fprintf (stderr, DEBUG_FMT_S, "tune", "<none>"); cl_target_option_save (&cl_opts, &global_options, &global_options_set); rs6000_print_isa_options (stderr, 0, "rs6000_isa_flags", - rs6000_isa_flags, TARGET_FUTURE); + rs6000_isa_flags); rs6000_print_isa_options (stderr, 0, "rs6000_isa_flags_explicit", - rs6000_isa_flags_explicit, false); + rs6000_isa_flags_explicit); - rs6000_print_isa_options (stderr, 0, "TARGET_DEFAULT", TARGET_DEFAULT, - false); + rs6000_print_isa_options (stderr, 0, "TARGET_DEFAULT", TARGET_DEFAULT); fprintf (stderr, DEBUG_FMT_S, "--with-cpu default", OPTION_TARGET_CPU_DEFAULT ? OPTION_TARGET_CPU_DEFAULT : "<none>"); @@ -3626,8 +3621,7 @@ rs6000_option_override_internal (bool global_init_p) /* Print defaults. */ if ((TARGET_DEBUG_REG || TARGET_DEBUG_TARGET) && global_init_p) - rs6000_print_isa_options (stderr, 0, "TARGET_DEFAULT", TARGET_DEFAULT, - false); + rs6000_print_isa_options (stderr, 0, "TARGET_DEFAULT", TARGET_DEFAULT); /* Remember the explicit arguments. */ if (global_init_p) @@ -3731,8 +3725,6 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags &= ~set_masks; rs6000_isa_flags |= (processor_target_table[cpu_index].target_enable & set_masks); - TARGET_FUTURE = strcmp (processor_target_table[cpu_index].name, - "future") == 0; } else { @@ -3758,7 +3750,6 @@ rs6000_option_override_internal (bool global_init_p) flags = processor_target_table[default_cpu_index].target_enable; } rs6000_isa_flags |= (flags & ~rs6000_isa_flags_explicit); - TARGET_FUTURE = false; } /* Don't expect powerpc64 enabled on those OSes with OS_MISSING_POWERPC64, @@ -3880,8 +3871,7 @@ rs6000_option_override_internal (bool global_init_p) & ~rs6000_isa_flags_explicit); if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET) - rs6000_print_isa_options (stderr, 0, "before defaults", rs6000_isa_flags, - TARGET_FUTURE); + rs6000_print_isa_options (stderr, 0, "before defaults", rs6000_isa_flags); #ifdef XCOFF_DEBUGGING_INFO /* For AIX default to 64-bit DWARF. */ @@ -4242,8 +4232,7 @@ rs6000_option_override_internal (bool global_init_p) /* Print the options after updating the defaults. */ if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET) - rs6000_print_isa_options (stderr, 0, "after defaults", rs6000_isa_flags, - TARGET_FUTURE); + rs6000_print_isa_options (stderr, 0, "after defaults", rs6000_isa_flags); /* E500mc does "better" if we inline more aggressively. Respect the user's opinion, though. */ @@ -4350,8 +4339,7 @@ rs6000_option_override_internal (bool global_init_p) TARGET_NO_FP_IN_TOC = 1; if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET) - rs6000_print_isa_options (stderr, 0, "before subtarget", rs6000_isa_flags, - TARGET_FUTURE); + rs6000_print_isa_options (stderr, 0, "before subtarget", rs6000_isa_flags); #ifdef SUBTARGET_OVERRIDE_OPTIONS SUBTARGET_OVERRIDE_OPTIONS; @@ -4418,8 +4406,7 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags &= ~OPTION_MASK_PCREL_OPT; if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET) - rs6000_print_isa_options (stderr, 0, "after subtarget", rs6000_isa_flags, - TARGET_FUTURE); + rs6000_print_isa_options (stderr, 0, "after subtarget", rs6000_isa_flags); rs6000_always_hint = (rs6000_tune != PROCESSOR_POWER4 && rs6000_tune != PROCESSOR_POWER5 @@ -24892,7 +24879,6 @@ rs6000_pragma_target_parse (tree args, tree pop_target) tree cur_tree; struct cl_target_option *prev_opt, *cur_opt; HOST_WIDE_INT prev_flags, cur_flags, diff_flags; - bool prev_future, cur_future, diff_future; if (TARGET_DEBUG_TARGET) { @@ -24945,28 +24931,21 @@ rs6000_pragma_target_parse (tree args, tree pop_target) { prev_opt = TREE_TARGET_OPTION (prev_tree); prev_flags = prev_opt->x_rs6000_isa_flags; - prev_future = prev_opt->x_TARGET_FUTURE; cur_opt = TREE_TARGET_OPTION (cur_tree); cur_flags = cur_opt->x_rs6000_isa_flags; - cur_future = cur_opt->x_TARGET_FUTURE; diff_flags = (prev_flags ^ cur_flags); - diff_future = (prev_future ^ cur_future); - if (diff_flags != 0 || diff_future) + if (diff_flags != 0) { /* Delete old macros. */ rs6000_target_modify_macros_ptr (false, - prev_flags & diff_flags, - diff_future, - prev_future); + prev_flags & diff_flags); /* Define new macros. */ rs6000_target_modify_macros_ptr (true, - cur_flags & diff_flags, - diff_future, - cur_future); + cur_flags & diff_flags); } } @@ -25080,7 +25059,6 @@ rs6000_function_specific_save (struct cl_target_option *ptr, { ptr->x_rs6000_isa_flags = opts->x_rs6000_isa_flags; ptr->x_rs6000_isa_flags_explicit = opts->x_rs6000_isa_flags_explicit; - ptr->x_TARGET_FUTURE = opts->x_TARGET_FUTURE; } /* Restore the current options */ @@ -25093,7 +25071,6 @@ rs6000_function_specific_restore (struct gcc_options *opts, { opts->x_rs6000_isa_flags = ptr->x_rs6000_isa_flags; opts->x_rs6000_isa_flags_explicit = ptr->x_rs6000_isa_flags_explicit; - opts->x_TARGET_FUTURE = ptr->x_TARGET_FUTURE; (void) rs6000_option_override_internal (false); } @@ -25104,12 +25081,10 @@ rs6000_function_specific_print (FILE *file, int indent, struct cl_target_option *ptr) { rs6000_print_isa_options (file, indent, "Isa options set", - ptr->x_rs6000_isa_flags, - ptr->x_TARGET_FUTURE); + ptr->x_rs6000_isa_flags); rs6000_print_isa_options (file, indent, "Isa options explicit", - ptr->x_rs6000_isa_flags_explicit, - ptr->x_TARGET_FUTURE); + ptr->x_rs6000_isa_flags_explicit); } /* Helper function to print the current isa or misc options on a line. */ @@ -25121,8 +25096,7 @@ rs6000_print_options_internal (FILE *file, HOST_WIDE_INT flags, const char *prefix, const struct rs6000_opt_mask *opts, - size_t num_elements, - bool future) + size_t num_elements) { size_t i; size_t start_column = 0; @@ -25188,18 +25162,6 @@ rs6000_print_options_internal (FILE *file, comma_len = strlen (", "); } - if (future) - { - cur_column += sizeof ("-mcpu=future") - 1; - if (cur_column > max_column) - { - fprintf (stderr, ", \\\n%*s", (int)start_column, ""); - comma = ""; - } - - fprintf (file, "%s%s", comma, "-mcpu=future"); - } - fputs ("\n", file); } @@ -25207,12 +25169,11 @@ rs6000_print_options_internal (FILE *file, static void rs6000_print_isa_options (FILE *file, int indent, const char *string, - HOST_WIDE_INT flags, bool future) + HOST_WIDE_INT flags) { rs6000_print_options_internal (file, indent, string, flags, "-m", &rs6000_opt_masks[0], - ARRAY_SIZE (rs6000_opt_masks), - future); + ARRAY_SIZE (rs6000_opt_masks)); } /* If the user used -mno-vsx, we need turn off all of the implicit ISA 2.06, diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index c857a155bd2e..db6112a09e11 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -555,16 +555,6 @@ extern int rs6000_vector_align[]; #define TARGET_DIRECT_MOVE_64BIT (TARGET_DIRECT_MOVE \ && TARGET_POWERPC64) -/* Is this a future machine with potentially new feaatures? */ -#ifndef TARGET_FUTURE -#ifdef GENERATOR_FILE -#define TARGET_FUTURE false -#else -#define TARGET_FUTURE global_options.x_TARGET_FUTURE -#endif -#endif - - /* Inlining allows targets to define the meanings of bits in target_info field of ipa_fn_summary by itself, the used bits for rs6000 are listed below. */ diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt index 489c85c9bb3b..88cf16ca581a 100644 --- a/gcc/config/rs6000/rs6000.opt +++ b/gcc/config/rs6000/rs6000.opt @@ -44,13 +44,6 @@ enum processor_type rs6000_cpu = PROCESSOR_PPC603 TargetVariable enum processor_type rs6000_tune = PROCESSOR_PPC603 -;; Whether the current processor is a potential future processor -Variable -bool TARGET_FUTURE = false - -TargetSave -bool x_TARGET_FUTURE - ;; Always emit branch hint bits. TargetVariable unsigned char rs6000_always_hint diff --git a/gcc/testsuite/gcc.target/powerpc/future-1.c b/gcc/testsuite/gcc.target/powerpc/future-1.c deleted file mode 100644 index 7bd8e5ddbd00..000000000000 --- a/gcc/testsuite/gcc.target/powerpc/future-1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mdejagnu-cpu=future -O2" } */ - -/* Basic check to see if the compiler supports -mcpu=future and if it defines - _ARCH_FUTURE. */ - -#ifndef _ARCH_FUTURE -#error "-mcpu=future is not supported" -#endif - -void foo (void) -{ -} diff --git a/gcc/testsuite/gcc.target/powerpc/future-2.c b/gcc/testsuite/gcc.target/powerpc/future-2.c deleted file mode 100644 index 5552cefa3c2e..000000000000 --- a/gcc/testsuite/gcc.target/powerpc/future-2.c +++ /dev/null @@ -1,24 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2" } */ - -/* Check if we can set the future target via a target attribute. */ - -__attribute__((__target__("cpu=power9"))) -void foo_p9 (void) -{ -} - -__attribute__((__target__("cpu=power10"))) -void foo_p10 (void) -{ -} - -__attribute__((__target__("cpu=power11"))) -void foo_p11 (void) -{ -} - -__attribute__((__target__("cpu=future"))) -void foo_future (void) -{ -}
