Hi, During previous Power10 testing, I noticed that ISA 3.1 has dropped TM support. I think we should not generate TM related instructions for Power10 and later, or no?
This patch is to turn off HTM support once we know the cpu setting is power10 or later, and warn something if the explicit option -mhtm is specified. Is it reasonable? BR, Kewen ------ gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_option_override_internal): Disable HTM for Power10 and later.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d8ac2f0cd2f..e1b2bbf2142 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4266,6 +4266,14 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags &= ~OPTION_MASK_PCREL; } + /* ISA 3.1 removes transactional memory support. */ + if (TARGET_POWER10 && TARGET_HTM) + { + if (rs6000_isa_flags_explicit & OPTION_MASK_HTM) + warning (0, "%qs is not supported on power10 and later", "-mhtm"); + rs6000_isa_flags &= ~OPTION_MASK_HTM; + } + /* 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);