diff options
author | Dmitry Selyutin <ghostmansd@gmail.com> | 2022-05-12 10:32:11 +0300 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-05-25 12:13:44 +0930 |
commit | 8e5eb8e1b0cb2a408008a3e40e571f193917dcc8 (patch) | |
tree | 57e88dbca3937b38a3dcb22cb7a316b27e5773c9 /opcodes/ppc-dis.c | |
parent | f59e7b128933d96b53ee948ab306334e87b2f03c (diff) | |
download | gdb-8e5eb8e1b0cb2a408008a3e40e571f193917dcc8.zip gdb-8e5eb8e1b0cb2a408008a3e40e571f193917dcc8.tar.gz gdb-8e5eb8e1b0cb2a408008a3e40e571f193917dcc8.tar.bz2 |
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.
Diffstat (limited to 'opcodes/ppc-dis.c')
-rw-r--r-- | opcodes/ppc-dis.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c index 38ddeca..45e8fae 100644 --- a/opcodes/ppc-dis.c +++ b/opcodes/ppc-dis.c @@ -546,7 +546,7 @@ operand_value_powerpc (const struct powerpc_operand *operand, /* Determine whether the optional operand(s) should be printed. */ static bool -skip_optional_operands (const unsigned char *opindex, +skip_optional_operands (const ppc_opindex_t *opindex, uint64_t insn, ppc_cpu_t dialect, bool *is_pcrel) { const struct powerpc_operand *operand; @@ -592,7 +592,7 @@ lookup_powerpc (uint64_t insn, ppc_cpu_t dialect) opcode < opcode_end; ++opcode) { - const unsigned char *opindex; + const ppc_opindex_t *opindex; const struct powerpc_operand *operand; int invalid; @@ -637,7 +637,7 @@ lookup_prefix (uint64_t insn, ppc_cpu_t dialect) opcode < opcode_end; ++opcode) { - const unsigned char *opindex; + const ppc_opindex_t *opindex; const struct powerpc_operand *operand; int invalid; @@ -691,7 +691,7 @@ lookup_vle (uint64_t insn, ppc_cpu_t dialect) uint64_t table_mask = opcode->mask; bool table_op_is_short = PPC_OP_SE_VLE(table_mask); uint64_t insn2; - const unsigned char *opindex; + const ppc_opindex_t *opindex; const struct powerpc_operand *operand; int invalid; @@ -746,7 +746,7 @@ lookup_spe2 (uint64_t insn, ppc_cpu_t dialect) uint64_t table_opcd = opcode->opcode; uint64_t table_mask = opcode->mask; uint64_t insn2; - const unsigned char *opindex; + const ppc_opindex_t *opindex; const struct powerpc_operand *operand; int invalid; @@ -925,7 +925,7 @@ print_insn_powerpc (bfd_vma memaddr, if (opcode != NULL) { - const unsigned char *opindex; + const ppc_opindex_t *opindex; const struct powerpc_operand *operand; enum { need_comma = 0, |