PPC binutils opcodes

Dmitry Selyutin ghostmansd@gmail.com
Wed May 11 16:39:28 GMT 2022


On Wed, May 11, 2022 at 4:13 PM Alan Modra <amodra@gmail.com> wrote:
> Increasing the size of fx_pcrel_adjust should be fine, adjusting the
> assertion and removing the silly mask to 8 bits.  Another option
> is to add a field to tc-ppc.h:_ppc_fix_extra and use that instead of
> fx_pcrel_adjust in tc-ppc.c.

As I've just found, to my confusion, we actually have a way to reach
the desired goal by simpler actions. Right above fx_pcrel_adjust,
there's yet another 10-bit field, called fx_unused. It's indeed not
used yet. I suggest allocating 8 bits out of it, and make opindex at
include/opcode/ppc.h:powerpc_opcode an unsigned short (or, ideally, I
suggest using uint16_t: ppc.h already uses stdint.h anyway).

We could use less bits than 8, but, since the operand size is going to
take at least 16 bits anyway and to avoid similar problems in the
future. Hopefully 16 bits will be sufficient.
I'll prepare the patch. Alan, could you, please, help me with tests I
need to check? It'd be great if there's some CI to use: my environment
is somewhat rusty and slow.


More information about the Binutils mailing list