This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Group terminating nop in P9
- From: Alan Modra <amodra at gmail dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>, binutils at sourceware dot org
- Cc: Nicholas Piggin <npiggin at gmail dot com>, Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Thu, 8 Mar 2018 14:41:12 +1030
- Subject: Re: Group terminating nop in P9
- Authentication-results: sourceware.org; auth=none
- References: <20180305215458.3a04f68f@roar.ozlabs.ibm.com> <20180306071919.GM3812@bubble.grove.modra.org> <6ac0d030-174d-eac3-8b74-3b063129eac9@vnet.ibm.com> <20180308034838.GW3812@bubble.grove.modra.org>
On Thu, Mar 08, 2018 at 02:18:38PM +1030, Alan Modra wrote:
> 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.
Obviously not tested well enough. -mpower9 sets all the PPC_OPCODE_POWERn
for n <= 9.
* config/tc-ppc.c (ppc_handle_align): Correct last patch. Really
don't emit a group terminating nop for power9. Simplify cpu
tests.
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index dc63d60..ff76221 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -6549,8 +6549,7 @@ ppc_handle_align (struct frag *fragP)
md_number_to_chars (dest, 0x60000000, 4);
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)
{
/* For power6, power7, and power8, we want the last nop to
be a group terminating one. Do this by inserting an
@@ -6570,8 +6569,7 @@ ppc_handle_align (struct frag *fragP)
dest = group_nop->fr_literal;
}
- if ((ppc_cpu & PPC_OPCODE_POWER7) != 0
- || (ppc_cpu & PPC_OPCODE_POWER8) != 0)
+ if ((ppc_cpu & PPC_OPCODE_POWER7) != 0)
{
if (ppc_cpu & PPC_OPCODE_E500MC)
/* e500mc group terminating nop: "ori 0,0,0". */
--
Alan Modra
Australia Development Lab, IBM