https://gcc.gnu.org/g:4d9ccfc12fa1c534d01eb7c3aac57fe0268fc913
commit 4d9ccfc12fa1c534d01eb7c3aac57fe0268fc913 Author: Michael Meissner <meiss...@linux.ibm.com> Date: Tue Jul 30 18:19:52 2024 -0400 Revert changes Diff: --- gcc/ChangeLog.meissner | 26 ++------------------------ gcc/config/rs6000/rs6000-arch.def | 3 ++- gcc/config/rs6000/rs6000-c.cc | 2 +- gcc/config/rs6000/rs6000-opts.h | 9 +++++---- gcc/config/rs6000/rs6000.cc | 12 ++++++++++-- 5 files changed, 20 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner index 86cc52c8636d..75d085b17f0c 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -1,27 +1,5 @@ -==================== Branch work174, patch #9 ==================== - -Add a2 processor to arch flags. - -2024-07-30 Michael Meissner <meiss...@linux.ibm.com> - - * config/rs6000/rs6000-arch.def: Add a2 processor. - -==================== Branch work174, patch #8 ==================== - -Remove arch flags power4 and power5. Use const HOST_WIDE_INT for arch masks. - -2024-07-30 Michael Meissner <meiss...@linux.ibm.com> - - * config/rs6000/rs6000-arch.def: Remove power4 and power5 architecture - masks. - * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Use arch flags - for power6. - * config/rs6000/rs6000-opts.h (ARCH_MASK_*): Encode the masks as const - HOST_WIDE_INT and not as an enumeratio. - * config/rs6000/rs6000.cc (get_arch_flags): Drop power4 and power5 arch - flags support. - (rs6000_machine_from_flags): Likewise. - +==================== Branch work174, patch #9 was reverted ==================== +==================== Branch work174, patch #8 was reverted ==================== ==================== Branch work174, patch #7 was reverted ==================== ==================== Branch work174, patch #6 ==================== diff --git a/gcc/config/rs6000/rs6000-arch.def b/gcc/config/rs6000/rs6000-arch.def index 89b1b87c89ac..6725736076da 100644 --- a/gcc/config/rs6000/rs6000-arch.def +++ b/gcc/config/rs6000/rs6000-arch.def @@ -37,7 +37,8 @@ the appropriate architecture flags based on the actual processor enumeration. */ -ARCH_EXPAND(PPCA2, "a2") +ARCH_EXPAND(POWER4, "power4") +ARCH_EXPAND(POWER5, "power5") ARCH_EXPAND(POWER6, "power6") ARCH_EXPAND(POWER7, "power7") ARCH_EXPAND(POWER8, "power8") diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc index 7d0b24b7c09e..a8a6a956874f 100644 --- a/gcc/config/rs6000/rs6000-c.cc +++ b/gcc/config/rs6000/rs6000-c.cc @@ -426,7 +426,7 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags, rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR5"); if ((flags & OPTION_MASK_FPRND) != 0) rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR5X"); - if ((arch_flags & ARCH_MASK_POWER6) != 0) + if ((flags & OPTION_MASK_CMPB) != 0) rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR6"); if ((arch_flags & ARCH_MASK_POWER7) != 0) rs6000_define_or_undefine_macro (define_p, "_ARCH_PWR7"); diff --git a/gcc/config/rs6000/rs6000-opts.h b/gcc/config/rs6000/rs6000-opts.h index c7764e66cd03..9a52a1d4b147 100644 --- a/gcc/config/rs6000/rs6000-opts.h +++ b/gcc/config/rs6000/rs6000-opts.h @@ -80,14 +80,15 @@ enum { ARCH_ENUM_LAST }; -/* Create an architecture mask for the newer architectures (power6 and +/* Create an architecture mask for the newer architectures (power7 and up).. */ #undef ARCH_EXPAND -#define ARCH_EXPAND(PROC, NAME) \ - static const HOST_WIDE_INT ARCH_MASK_ ## PROC \ - = HOST_WIDE_INT_1 << ARCH_ENUM_ ## PROC; +#define ARCH_EXPAND(PROC, NAME) ARCH_MASK_ ## PROC = 1 << ARCH_ENUM_ ## PROC, +enum { #include "rs6000-arch.def" + ARCH_MASK_ZERO = 0 +}; #undef ARCH_EXPAND diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index bccf30a44b20..19adc66cc801 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -1852,6 +1852,14 @@ get_arch_flags (int cpu_index) case PROCESSOR_POWER6: ret |= ARCH_MASK_POWER6; + /* fall through. */ + + case PROCESSOR_POWER5: + ret |= ARCH_MASK_POWER5; + /* fall through. */ + + case PROCESSOR_POWER4: + ret |= ARCH_MASK_POWER4; break; default: @@ -5929,9 +5937,9 @@ rs6000_machine_from_flags (void) return "power7"; if ((arch_flags & ARCH_MASK_POWER6) != 0) return "power6"; - if ((flags & (ISA_2_4_MASKS & ~ISA_2_1_MASKS)) != 0) + if ((arch_flags & ARCH_MASK_POWER5) != 0) return "power5"; - if ((flags & ISA_2_1_MASKS) != 0) + if ((arch_flags & ARCH_MASK_POWER4) != 0) return "power4"; if ((flags & OPTION_MASK_POWERPC64) != 0) return "ppc64";