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: Gunther Nikl <gnikl at justmail dot de>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: Alan Modra <amodra at gmail dot com>, binutils <binutils at sourceware dot org>
- Date: Mon, 2 Apr 2018 21:29:47 +0200
- 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> <20180401181757.00004783@justmail.de> <76551ac4-96b1-7a05-51c2-09f05b3dba45@vnet.ibm.com>
Hello,
> On 4/1/18 11:17 AM, Gunther Nikl wrote:
> > Hello,
> >
> >> 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
> >> + | 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;
> >
> > Don't you need parentheses to not change the logic?
>
> In the end, I went with:
>
> - 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_parse_cpu (ppc_cpu, &sticky, "power8");
My remark was about the "if..else.." replacing the previous single
statement. I didn't realize that your change is inside a if..else if
block. I guess that makes it clear for the compiler. I think having
your new "if..else.." inside a {} block would make the code easier
to follow.
Sorry for the noise.
Regards,
Gunther Nikl