PPC binutils opcodes

Dmitry Selyutin ghostmansd@gmail.com
Wed May 11 09:24:21 GMT 2022


Hello folks,

long time no news. We're still extending PowerPC with SVP64
extensions[0], and, as part of this large task, we're updating
binutils respectively[1].
With the recent commit[2], I've hit the limit on count of operands
stored in powerpc_operands array, and now I'm somewhat unsure of how
to address it.
The trivial and obvious solution to increase the size of the operand
index[3] can be done, but it appears there is another obstacle this
time[4].

Considering fx_pcrel_adjust field, it appears to be shared and it has
exactly 8 bits[5]. This is enforced by the assertion above, but also
by other places[6].
The logic around the fx_pcrel_adjust field prevents me from adding new
operands; even if I increase the operand index size, I will for sure
hit other limitations.

So I thought the best option would be to ask for your help and ideas
on this. Could you, please, suggest the correct way to add new
operands but keep the logic around this field intact or, well,
working?

I tried checking the code around regarding fixups, but I'm currently
struggling to understand what happens there. Any help or tips are
highly appreciated.
Ideally I'd like to re-use already existing mechanisms for adding new
instructions and keep the original code as intact as possible.

[0] https://libre-soc.org
[1] https://git.libre-soc.org/?p=binutils-gdb.git;a=log;h=refs/heads/svp64
[2] https://git.libre-soc.org/?p=binutils-gdb.git;a=commit;h=dfa9e48a625faee0f70252c7fbf2cd7a0343f8f1
[3] https://git.libre-soc.org/?p=binutils-gdb.git;a=commit;h=b4a728e26f4c364f1a4d365c3c4e5e2441f70a5e
[4] https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=gas/config/tc-ppc.c;h=c3439a6cd6098ba36d38b1ff55bf6430b45bd4e2;hb=refs/heads/svp64#l1642
[5] https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=gas/write.h;h=501bdd828fc96e423a689141ab425743f484da3c;hb=refs/heads/svp64#l78
[6] https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=gas/config/tc-ppc.c;h=c3439a6cd6098ba36d38b1ff55bf6430b45bd4e2;hb=refs/heads/svp64#l7061


More information about the Binutils mailing list