This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PR binutils/23013: Assembler not recognizing 3-opt dcbt instruction form on Power systems
- From: Alan Modra <amodra at gmail dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: binutils <binutils at sourceware dot org>, Michael Godfrey <7mg5 at queensu dot ca>
- Date: Fri, 30 Mar 2018 11:59:35 +1030
- Subject: Re: PR binutils/23013: Assembler not recognizing 3-opt dcbt instruction form on Power systems
- References: <6db14e06-b37d-f3a7-43ac-615c7d3ccc65@vnet.ibm.com>
On Thu, Mar 29, 2018 at 02:56:24PM -0500, Peter Bergner wrote:
> The 3 operand dcbt instruction was added to the Power (server) ISA in the
> power4 time frame. The problem is that gas defaults to assembling for an
> older cpu than power4, so you need to pass -mpower4 (or newer) to assemble
> the 3 operand form of dcbt.
>
> That said, Michael was trying to assemble on a 64-bit LE system and those
> system's minimum support cpu is power8, therefore, gas really should default
> to power8 when we're targeting powerpc64le-*. The following patch accomplishes
> that with no testsuite regressions.
>
> Alan, does this look reasonable to you?
Yes, I think this is a good idea.
> diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
> index ff76221..e3d5d84 100644
> --- a/gas/config/tc-ppc.c
> +++ b/gas/config/tc-ppc.c
> @@ -1403,7 +1403,14 @@ ppc_set_cpu (void)
> if ((ppc_cpu & ~(ppc_cpu_t) PPC_OPCODE_ANY) == 0)
> {
> if (ppc_obj64)
> - ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_64;
> + if (target_big_endian)
> + ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_64;
> + else
> + /* The minimum supported cpu for 64-bit little-endian is power8. */
> + ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
Write the above line as
ppc_cpu |= (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
ie. add a syntactially unnecessary parenthesis for emacs to
auto-indent the code properly.
https://www.gnu.org/prep/standards/standards.html#Formatting
> + | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
> + | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8
> + | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX;
> else if (strncmp (default_os, "aix", 3) == 0
> && default_os[3] >= '4' && default_os[3] <= '9')
> ppc_cpu |= PPC_OPCODE_COMMON;
>
--
Alan Modra
Australia Development Lab, IBM