diff mbox series

Rename __builtin_rs6000_speculation_barrier

Message ID 83796b73-cc62-5112-0838-8c4d541dbe75@linux.vnet.ibm.com
State New
Headers show
Series Rename __builtin_rs6000_speculation_barrier | expand

Commit Message

Bill Schmidt March 4, 2018, 7:52 p.m. UTC
Hi,

We realized recently that the use of "rs6000" in a builtin name doesn't agree
with our normal naming conventions.  Thus this patch changes such a builtin
to __builtin_powerpc_speculation_barrier instead.

Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.  Is
this okay for trunk?

Thanks,
Bill


[gcc]

2018-03-04  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000-builtin.def (rs6000_speculation_barrier):
	Rename to powerpc_speculation_barrier.
	* config/rs6000/rs6000.c (rs6000_expand_builtin): Rename called
	function to gen_powerpc_speculation_barrier.
	(rs6000_init_builtins): Rename builtin to
	__builtin_powerpc_speculation_barrier.
	* config/rs6000/rs6000.md (rs6000_speculation_barrier): Rename
	define_insn to powerpc_speculation_barrier.

[gcc/testsuite]

2018-03-04  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/spec-barr-1.c: Change called function name to
	__builtin_powerpc_speculation_barrier.

Comments

Segher Boessenkool March 5, 2018, 3:04 p.m. UTC | #1
Hi!

On Sun, Mar 04, 2018 at 01:52:20PM -0600, Bill Schmidt wrote:
> We realized recently that the use of "rs6000" in a builtin name doesn't agree
> with our normal naming conventions.  Thus this patch changes such a builtin
> to __builtin_powerpc_speculation_barrier instead.
> 
> Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.  Is
> this okay for trunk?

Most of our builtins have *no* powerpc or similar in the name, and the
two that do have "ppc".

Should we use __builtin_speculation_barrier?  It sounds more likely
that other archs will want that as well, than that it will conflict.

For the .md patterns we already have various that are named rs6000_*
(and none ppc* or power*).


Segher
Bill Schmidt March 5, 2018, 3:58 p.m. UTC | #2
> On Mar 5, 2018, at 9:04 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> 
> Hi!
> 
> On Sun, Mar 04, 2018 at 01:52:20PM -0600, Bill Schmidt wrote:
>> We realized recently that the use of "rs6000" in a builtin name doesn't agree
>> with our normal naming conventions.  Thus this patch changes such a builtin
>> to __builtin_powerpc_speculation_barrier instead.
>> 
>> Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.  Is
>> this okay for trunk?
> 
> Most of our builtins have *no* powerpc or similar in the name, and the
> two that do have "ppc".
> 
> Should we use __builtin_speculation_barrier?  It sounds more likely
> that other archs will want that as well, than that it will conflict.

That was my initial proposal.  Richard asked me to insert the "rs6000_" to keep this
in a separate namespace for the time being.  There is still discussion about a
more general speculation barrier builtin for all targets, though that has languished
for over a month now.
> 
> For the .md patterns we already have various that are named rs6000_*
> (and none ppc* or power*).
> 
Would it be reasonable to go with __builtin_ppc_speculation_barrier for the
builtin name and revert to rs6000_* in the .md patterns, etc.?

Thanks,
Bill

> 
> Segher
>
Segher Boessenkool March 5, 2018, 4:29 p.m. UTC | #3
On Mon, Mar 05, 2018 at 09:58:50AM -0600, Bill Schmidt wrote:
> 
> > On Mar 5, 2018, at 9:04 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> > 
> > Hi!
> > 
> > On Sun, Mar 04, 2018 at 01:52:20PM -0600, Bill Schmidt wrote:
> >> We realized recently that the use of "rs6000" in a builtin name doesn't agree
> >> with our normal naming conventions.  Thus this patch changes such a builtin
> >> to __builtin_powerpc_speculation_barrier instead.
> >> 
> >> Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.  Is
> >> this okay for trunk?
> > 
> > Most of our builtins have *no* powerpc or similar in the name, and the
> > two that do have "ppc".
> > 
> > Should we use __builtin_speculation_barrier?  It sounds more likely
> > that other archs will want that as well, than that it will conflict.
> 
> That was my initial proposal.  Richard asked me to insert the "rs6000_" to keep this
> in a separate namespace for the time being.  There is still discussion about a
> more general speculation barrier builtin for all targets, though that has languished
> for over a month now.
> > 
> > For the .md patterns we already have various that are named rs6000_*
> > (and none ppc* or power*).
> > 
> Would it be reasonable to go with __builtin_ppc_speculation_barrier for the
> builtin name and revert to rs6000_* in the .md patterns, etc.?

Yeah that sounds fine.  Okay for trunk with such changes.  Thanks!


Segher
diff mbox series

Patch

Index: gcc/config/rs6000/rs6000-builtin.def
===================================================================
--- gcc/config/rs6000/rs6000-builtin.def	(revision 258157)
+++ gcc/config/rs6000/rs6000-builtin.def	(working copy)
@@ -2348,7 +2348,7 @@  BU_DFP_MISC_2 (DSCRIQ,		"dscriq",	CONST,	dfp_dscri
 /* 0 argument void function that we pretend was added in ISA 2.06.
    It's a special nop recognized by 2018+ firmware for P7 and up,
    with speculation barrier semantics.  */
-BU_P7_MISC_X (SPEC_BARRIER,	"rs6000_speculation_barrier",	MISC)
+BU_P7_MISC_X (SPEC_BARRIER,	"powerpc_speculation_barrier",	MISC)
 
 /* 1 argument BCD functions added in ISA 2.06.  */
 BU_P7_MISC_1 (CDTBCD,		"cdtbcd",	CONST,	cdtbcd)
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 258157)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -16874,7 +16874,7 @@  rs6000_expand_builtin (tree exp, rtx target, rtx s
 
     case MISC_BUILTIN_SPEC_BARRIER:
       {
-	emit_insn (gen_rs6000_speculation_barrier ());
+	emit_insn (gen_powerpc_speculation_barrier ());
 	return NULL_RTX;
       }
 
@@ -17250,7 +17250,7 @@  rs6000_init_builtins (void)
 
   ftype = build_function_type_list (void_type_node, NULL_TREE);
   def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
-  def_builtin ("__builtin_rs6000_speculation_barrier", ftype,
+  def_builtin ("__builtin_powerpc_speculation_barrier", ftype,
 	       MISC_BUILTIN_SPEC_BARRIER);
 
   ftype = build_function_type_list (bool_int_type_node, const_ptr_type_node,
Index: gcc/config/rs6000/rs6000.md
===================================================================
--- gcc/config/rs6000/rs6000.md	(revision 258157)
+++ gcc/config/rs6000/rs6000.md	(working copy)
@@ -12574,7 +12574,7 @@ 
   return "ori 2,2,0";
 })
 
-(define_insn "rs6000_speculation_barrier"
+(define_insn "powerpc_speculation_barrier"
   [(unspec_volatile:BLK [(const_int 0)] UNSPECV_SPEC_BARRIER)]
   ""
   "ori 31,31,0")
Index: gcc/testsuite/gcc.target/powerpc/spec-barr-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/spec-barr-1.c	(revision 258157)
+++ gcc/testsuite/gcc.target/powerpc/spec-barr-1.c	(working copy)
@@ -4,7 +4,7 @@ 
 
 void foo ()
 {
-  __builtin_rs6000_speculation_barrier ();
+  __builtin_powerpc_speculation_barrier ();
 }
 
 /* { dg-final { scan-assembler "ori 31,31,0" } } */