ppc: extend opindex to 16 bits
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 12 May 2022 07:32:11 +0000 (10:32 +0300)
committerAlan Modra <amodra@gmail.com>
Wed, 25 May 2022 02:43:44 +0000 (12:13 +0930)
commit8e5eb8e1b0cb2a408008a3e40e571f193917dcc8
tree57e88dbca3937b38a3dcb22cb7a316b27e5773c9
parentf59e7b128933d96b53ee948ab306334e87b2f03c
ppc: extend opindex to 16 bits

With the upcoming SVP64 extension[0] to PowerPC architecture, it became
evident that PowerPC operand indices no longer fit 8 bits. This patch
switches the underlying type to uint16_t, also introducing a special
typedef so that any future extension goes even smoother.

[0] https://libre-soc.org

include/
* opcode/ppc.h (ppc_opindex_t): New typedef.
(struct powerpc_opcode): Use it.
(PPC_OPINDEX_MAX): Define.
gas/
* write.h (struct fix): Increase size of fx_pcrel_adjust.
Reorganise.
* config/tc-ppc.c (insn_validate): Use ppc_opindex_t for operands.
(md_assemble): Likewise.
(md_apply_fix): Likewise.  Mask fx_pcrel_adjust with PPC_OPINDEX_MAX.
(ppc_setup_opcodes): Adjust opcode index assertion.
opcodes/
* ppc-dis.c (skip_optional_operands): Use ppc_opindex_t for
operand pointer.
(lookup_powerpc, lookup_prefix, lookup_vle, lookup_spe2): Likewise.
(print_insn_powerpc): Likewise.
gas/config/tc-ppc.c
gas/write.h
include/opcode/ppc.h
opcodes/ppc-dis.c