This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix the incorrect assembling for ppc wait mnemonic
- From: Alan Modra <amodra at gmail dot com>
- To: Zavier Luo <zavier dot luo at gmail dot com>
- Cc: Peter Bergner <bergner at vnet dot ibm dot com>, binutils at sourceware dot org, Scott Wood <scott dot wood at nxp dot com>
- Date: Tue, 5 Jul 2016 10:30:57 +0930
- Subject: Re: [PATCH] Fix the incorrect assembling for ppc wait mnemonic
- Authentication-results: sourceware.org; auth=none
- References: <1466409386-12860-1-git-send-email-zavier.luo@gmail.com> <d9e9c79e-c759-ed77-0cea-8c85f40e6411@vnet.ibm.com> <CAJ2zpq6DK3zHy0BR1FKgqXpf4Rrf616tdOVnxVbLetrhEWN6Nw@mail.gmail.com> <be945e76-391b-7b49-3a97-7dfc64e11390@vnet.ibm.com> <CAJ2zpq56QesOhyzNBZrRtv_KAqm7HKo8+=Gkhpwjh2P2O5e-Fg@mail.gmail.com> <CAJ2zpq71MSGwT1SR3jL1_p+NSNoM6KmSDDaTFrnwiNtr0=ES3g@mail.gmail.com>
On Sun, Jul 03, 2016 at 09:37:23AM +0800, Zavier Luo wrote:
> I still have some different thought of the default setting of -mcpu.
> -mcpu=powerpc64 should *not* mean "latest server cpu"
It doesn't (and you're talking about a "gcc" option, not an "as" one).
What does happen is that in the absence of any -mcpu selection your
gcc is probably passing no -m<cpu> option to the assembler but is
passing -many. The mnemonic "wait" and its variants are not enabled
by the default assembler cpu (-mppc), and there are now two different
opcodes for "wait", the power9 one with major opcode 31, xop 30, and
the e500mc/a2 one with major opcode 31, xop 62. The power9 version
of "wait" thus appears in the opcode table first and is therefore the
opcode emitted when using just -many.
>(and that's a
> lousy default as well when -mcpu is not specified),
It is easy to change the default set of options passed from "gcc" to
"as". You should investigate how to do that (hint, start at rs6000.h
ASM_CPU_SPEC), or if you cannot do that yourself, complain to whomever
supplied your version of gcc. This problem ought to be fixed in gcc,
and preferably be submitted to the gcc project to benefit other e500mc
users.
>and even if we had
> specified -mcpu=power9 (or whatever) why is it producing the waitasec
> opcode in response to a plain "wait" mnemonic?
"waitasec" is "wait 0".
--
Alan Modra
Australia Development Lab, IBM