Group terminating nop in P9

Alan Modra amodra@gmail.com
Thu Mar 8 03:48:00 GMT 2018


On Wed, Mar 07, 2018 at 09:59:03AM -0600, Peter Bergner wrote:
> P9 does not have a group ending nop, unlike P8, P7, etc.
> 
> That said, Segher just mentioned that when GCC is targetting P9,
> gas is generating a P8 group ending nop for a .p2align, which is
> a bug.  I'll fix gas so that it doesn't do that.

I already had a patch, now tested and committed, so no need to worry.

	* config/tc-ppc.c (ppc_handle_align): Don't emit a group
	terminating nop for power9.

diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index f63003b..dc63d60 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -6550,14 +6550,13 @@ ppc_handle_align (struct frag *fragP)
 
       if ((ppc_cpu & PPC_OPCODE_POWER6) != 0
 	  || (ppc_cpu & PPC_OPCODE_POWER7) != 0
-	  || (ppc_cpu & PPC_OPCODE_POWER8) != 0
-	  || (ppc_cpu & PPC_OPCODE_POWER9) != 0)
+	  || (ppc_cpu & PPC_OPCODE_POWER8) != 0)
 	{
-	  /* For power6, power7, power8 and power9, we want the last nop to be
-	     a group terminating one.  Do this by inserting an rs_fill frag
-	     immediately after this one, with its address set to the last nop
-	     location.  This will automatically reduce the number of nops in
-	     the current frag by one.  */
+	  /* For power6, power7, and power8, we want the last nop to
+	     be a group terminating one.  Do this by inserting an
+	     rs_fill frag immediately after this one, with its address
+	     set to the last nop location.  This will automatically
+	     reduce the number of nops in the current frag by one.  */
 	  if (count > 4)
 	    {
 	      struct frag *group_nop = xmalloc (SIZEOF_STRUCT_FRAG + 4);
@@ -6572,14 +6571,13 @@ ppc_handle_align (struct frag *fragP)
 	    }
 
 	  if ((ppc_cpu & PPC_OPCODE_POWER7) != 0
-	      || (ppc_cpu & PPC_OPCODE_POWER8) != 0
-	      || (ppc_cpu & PPC_OPCODE_POWER9) != 0)
+	      || (ppc_cpu & PPC_OPCODE_POWER8) != 0)
 	    {
 	      if (ppc_cpu & PPC_OPCODE_E500MC)
 		/* e500mc group terminating nop: "ori 0,0,0".  */
 		md_number_to_chars (dest, 0x60000000, 4);
 	      else
-		/* power7/power8/power9 group terminating nop: "ori 2,2,0".  */
+		/* power7/power8 group terminating nop: "ori 2,2,0".  */
 		md_number_to_chars (dest, 0x60420000, 4);
 	    }
 	  else

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list