PowerPC: Add new xxmr and xxlnot extended mnemonics [committed]
Peter Bergner
bergner@linux.ibm.com
Fri May 28 13:29:00 GMT 2021
On 5/27/21 10:56 PM, Alan Modra wrote:
> Should these disassemble to xxlor and xxlnor with -Mraw? This isn't a
> new problem, lots of other instructions don't disassemble to the
> underlying machine insn with -Mraw. For example:
To be honest, I didn't even know about -Mraw :-)
> The following hack produces this. The idea is of course that we can
> detect a specialisation involving matching register operands or the
> like by simply counting the number of operands.
>
> I'm going to glare at our opcode table a bit more before I commit
> this. :-)
This probably catches most of the usage, since extended mnemonics
usually have fewer operands then the base mnemonic. That isn't always
the case though. Extended mnemonics like subi, subis, etc. and some
of the extended mnemonics for the ridiculous insns have the same
number of operands. I doubt there are any extended mnemonics which
have more operands than the base mnemonic.
You patch doesn't seem to do anything for the case when they have
the same number of operands. In that case, we probably defer to
the first one found in the table which (normally, but not always)
is the extended mnemonic.
> * ppc-dis.c (lookup_powerpc): When mask is the same, count
> operands to find underlying hardware insn for -Mraw.
> (lookup_prefix): Likewise.
If this works, I'm all for it.
If that doesn't work, one other option is to add a RAW mask to the
deprecated field in the extended mnemonics. That way, our existing
machinery will automatically disable them.
Peter
More information about the Binutils
mailing list