https://gcc.gnu.org/g:aeb37fbc6a69d79ec80e5c7041fb084bd6a3fa67
commit aeb37fbc6a69d79ec80e5c7041fb084bd6a3fa67 Author: Michael Meissner <meiss...@linux.ibm.com> Date: Thu Jan 16 12:22:08 2025 -0500 Change TARGET_MODULO to TARGET_POWER9. This patch changes TARGET_MODULO to TARGET_POWER9. The -mmodulo switch is not being changed, just the name of the macros used to determine if the PowerPC processor supports ISA 3.0 (Power9). 2025-01-16 Michael Meissner <meiss...@linux.ibm.com> gcc/ * gcc/config/rs6000/rs6000-builtin.cc (rs6000_builtin_is_supported): Change TARGET_MODULO to TARGET_POWER9. * gcc/config/rs6000/rs6000.cc (rs6000_option_override_internal): Likewise. * gcc/config/rs6000/rs6000.h (TARGET_CTZ): Likewise. (TARGET_EXTSWSLI): Likewise. (TARGET_MADDLD): Likewise. (TARGET_POWER9): New macro. * gcc/config/rs6000/rs6000.md (enabled attribute): Change TARGET_MODULO to TARGET_POWER9. (mod<mode>3): Likewise. (umod<mode>3): Likewise. (divide/modulo peephole2): Likewise. Diff: --- gcc/config/rs6000/rs6000-builtin.cc | 4 ++-- gcc/config/rs6000/rs6000.cc | 4 ++-- gcc/config/rs6000/rs6000.h | 7 ++++--- gcc/config/rs6000/rs6000.md | 14 +++++++------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc index 2366b2aee00a..d8ff7cf32dfd 100644 --- a/gcc/config/rs6000/rs6000-builtin.cc +++ b/gcc/config/rs6000/rs6000-builtin.cc @@ -169,9 +169,9 @@ rs6000_builtin_is_supported (enum rs6000_gen_builtins fncode) case ENB_P8V: return TARGET_P8_VECTOR; case ENB_P9: - return TARGET_MODULO; + return TARGET_POWER9; case ENB_P9_64: - return TARGET_MODULO && TARGET_POWERPC64; + return TARGET_POWER9 && TARGET_POWERPC64; case ENB_P9V: return TARGET_P9_VECTOR; case ENB_P10: diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 1bba77244c25..06d1bac5aa83 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -3888,7 +3888,7 @@ rs6000_option_override_internal (bool global_init_p) /* For the newer switches (vsx, dfp, etc.) set some of the older options, unless the user explicitly used the -mno-<option> to disable the code. */ - if (TARGET_P9_VECTOR || TARGET_MODULO || TARGET_P9_MISC) + if (TARGET_P9_VECTOR || TARGET_POWER9 || TARGET_P9_MISC) rs6000_isa_flags |= (ISA_3_0_MASKS_SERVER & ~ignore_masks); else if (TARGET_P9_MINMAX) { @@ -22358,7 +22358,7 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code, *total = rs6000_cost->divsi; } /* Add in shift and subtract for MOD unless we have a mod instruction. */ - if ((!TARGET_MODULO + if ((!TARGET_POWER9 || (RS6000_DISABLE_SCALAR_MODULO && SCALAR_INT_MODE_P (mode))) && (code == MOD || code == UMOD)) *total += COSTS_N_INSNS (2); diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 856d268d2d27..caf8cddf905e 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -463,9 +463,9 @@ extern int rs6000_vector_align[]; #define TARGET_FCTIWUZ TARGET_POWER7 /* Only powerpc64 and powerpc476 support fctid. */ #define TARGET_FCTID (TARGET_POWERPC64 || rs6000_cpu == PROCESSOR_PPC476) -#define TARGET_CTZ TARGET_MODULO -#define TARGET_EXTSWSLI (TARGET_MODULO && TARGET_POWERPC64) -#define TARGET_MADDLD TARGET_MODULO +#define TARGET_CTZ TARGET_POWER9 +#define TARGET_EXTSWSLI (TARGET_POWER9 && TARGET_POWERPC64) +#define TARGET_MADDLD TARGET_POWER9 /* TARGET_DIRECT_MOVE is redundant to TARGET_P8_VECTOR, so alias it to that. */ #define TARGET_DIRECT_MOVE TARGET_P8_VECTOR @@ -504,6 +504,7 @@ extern int rs6000_vector_align[]; #define TARGET_POWER5X TARGET_FPRND #define TARGET_POWER6 TARGET_CMPB #define TARGET_POWER7 TARGET_POPCNTD +#define TARGET_POWER9 TARGET_MODULO /* In switching from using target_flags to using rs6000_isa_flags, the options machinery creates OPTION_MASK_<xxx> instead of MASK_<xxx>. The MASK_<xxxx> diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 87ec37a9f8e4..db1b6c2d1164 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -403,7 +403,7 @@ (const_int 1) (and (eq_attr "isa" "p9") - (match_test "TARGET_MODULO")) + (match_test "TARGET_POWER9")) (const_int 1) (and (eq_attr "isa" "p9v") @@ -3457,7 +3457,7 @@ || INTVAL (operands[2]) <= 0 || (i = exact_log2 (INTVAL (operands[2]))) < 0) { - if (!TARGET_MODULO) + if (!TARGET_POWER9) FAIL; operands[2] = force_reg (<MODE>mode, operands[2]); @@ -3491,7 +3491,7 @@ [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r,r") (mod:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r") (match_operand:GPR 2 "gpc_reg_operand" "r,r")))] - "TARGET_MODULO && !RS6000_DISABLE_SCALAR_MODULO" + "TARGET_POWER9 && !RS6000_DISABLE_SCALAR_MODULO" "mods<wd> %0,%1,%2" [(set_attr "type" "div") (set_attr "size" "<bits>")]) @@ -3502,7 +3502,7 @@ [(set (match_operand:GPR 0 "gpc_reg_operand") (umod:GPR (match_operand:GPR 1 "gpc_reg_operand") (match_operand:GPR 2 "gpc_reg_operand")))] - "TARGET_MODULO" + "TARGET_POWER9" { if (RS6000_DISABLE_SCALAR_MODULO) { @@ -3520,7 +3520,7 @@ [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r,r") (umod:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r") (match_operand:GPR 2 "gpc_reg_operand" "r,r")))] - "TARGET_MODULO && !RS6000_DISABLE_SCALAR_MODULO" + "TARGET_POWER9 && !RS6000_DISABLE_SCALAR_MODULO" "modu<wd> %0,%1,%2" [(set_attr "type" "div") (set_attr "size" "<bits>")]) @@ -3536,7 +3536,7 @@ (set (match_operand:GPR 3 "gpc_reg_operand") (mod:GPR (match_dup 1) (match_dup 2)))] - "TARGET_MODULO + "TARGET_POWER9 && ! reg_mentioned_p (operands[0], operands[1]) && ! reg_mentioned_p (operands[0], operands[2]) && ! reg_mentioned_p (operands[3], operands[1]) @@ -3558,7 +3558,7 @@ (set (match_operand:GPR 3 "gpc_reg_operand") (umod:GPR (match_dup 1) (match_dup 2)))] - "TARGET_MODULO + "TARGET_POWER9 && ! reg_mentioned_p (operands[0], operands[1]) && ! reg_mentioned_p (operands[0], operands[2]) && ! reg_mentioned_p (operands[3], operands[1])