diff mbox series

[PATCH/RFC] rs6000: Disable HTM for Power10 and later

Message ID 84e1df49-0509-461a-f5dd-765de1b83610@linux.ibm.com
State New
Headers show
Series [PATCH/RFC] rs6000: Disable HTM for Power10 and later | expand

Commit Message

Kewen.Lin Nov. 26, 2020, 10:15 a.m. UTC
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.

Comments

Segher Boessenkool Nov. 26, 2020, 9:11 p.m. UTC | #1
Hi!

On Thu, Nov 26, 2020 at 06:15:04PM +0800, Kewen.Lin wrote:
> 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.

We currently enable OPTION_MASK_HTM in ISA_2_7_MASKS_SERVER (in
rs6000-cpus.def), and include that in all later CPUs/archs.

Could you fix it there instead?  Easiest and most obvious is to just
add HTM to the power8, power9, and powerpc64le entries.


Segher
diff mbox series

Patch

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);