From: Dmitry Selyutin Date: Sun, 28 May 2023 22:04:57 +0000 (+0300) Subject: ppc/svp64: disassemble ld/st idx mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15d606b8c52d04707a8fb3427599ff52aeeed564;p=binutils-gdb.git ppc/svp64: disassemble ld/st idx mode --- diff --git a/opcodes/ppc-svp64-dis.c b/opcodes/ppc-svp64-dis.c index 137bdda4cdd..f82baf9ce8e 100644 --- a/opcodes/ppc-svp64-dis.c +++ b/opcodes/ppc-svp64-dis.c @@ -384,6 +384,14 @@ svp64_spec_els (struct disassemble_info *info, bool els) return 0; } +static size_t +svp64_spec_SEA (struct disassemble_info *info, bool SEA) +{ + if (SEA) + return svp64_spec_printf (info, "SEA"); + return 0; +} + static size_t svp64_spec_normal (const struct svp64_ctx *svp64, struct disassemble_info *info) @@ -555,6 +563,51 @@ svp64_spec_ldst_imm_sat (const struct svp64_ctx *svp64, return len; } +static size_t +svp64_spec_ldst_idx (const struct svp64_ctx *svp64, + struct disassemble_info *info) +{ + size_t len = 0; + + len += svp64_spec_width (svp64, info); + len += svp64_spec_mask (svp64, info); + len += svp64_spec_vec (svp64, info); + + return len; +} + +static size_t +svp64_spec_ldst_idx_simple (const struct svp64_ctx *svp64, + struct disassemble_info *info) +{ + size_t len = 0; + uint64_t SEA = svp64_insn_get_prefix_rm_ldst_idx_simple_SEA (&svp64->insn); + uint64_t dz = svp64_insn_get_prefix_rm_ldst_idx_simple_dz (&svp64->insn); + uint64_t sz = svp64_insn_get_prefix_rm_ldst_idx_simple_sz (&svp64->insn); + + len += svp64_spec_SEA (info, SEA); + len += svp64_spec_dz_sz_zz (info, dz, sz); + len += svp64_spec_ldst_idx (svp64, info); + + return len; +} + +static size_t +svp64_spec_ldst_idx_sat (const struct svp64_ctx *svp64, + struct disassemble_info *info) +{ + size_t len = 0; + uint64_t N = svp64_insn_get_prefix_rm_ldst_idx_sat_N (&svp64->insn); + uint64_t dz = svp64_insn_get_prefix_rm_ldst_idx_sat_dz (&svp64->insn); + uint64_t sz = svp64_insn_get_prefix_rm_ldst_idx_sat_sz (&svp64->insn); + + len += svp64_spec_sat (info, N); + len += svp64_spec_dz_sz_zz (info, dz, sz); + len += svp64_spec_ldst_idx (svp64, info); + + return len; +} + static size_t svp64_print_spec (const struct svp64_ctx *svp64, struct disassemble_info *info) @@ -575,9 +628,14 @@ svp64_print_spec (const struct svp64_ctx *svp64, {0x10, 0x31, svp64_spec_ldst_imm_ffrc0}, /* ffirst, Rc=0 */ {0x20, 0x30, svp64_spec_ldst_imm_sat}, /* saturation (no Rc) */ }; + static const struct svp64_spec_subtable ldst_idx[] = { + {0x00, 0x30, svp64_spec_ldst_idx_simple}, /* simple (no Rc) */ + {0x20, 0x30, svp64_spec_ldst_idx_sat}, /* saturation (no Rc) */ + }; static const struct svp64_spec_table tables[] = { [SVP64_MODE_NORMAL] = {normal, ARRAY_SIZE (normal)}, [SVP64_MODE_LDST_IMM] = {ldst_imm, ARRAY_SIZE (ldst_imm)}, + [SVP64_MODE_LDST_IDX] = {ldst_idx, ARRAY_SIZE (ldst_idx)}, }; const struct svp64_spec_table *table = &tables[svp64->desc->mode]; uint64_t mode = svp64_insn_get_prefix_rm_mode (&svp64->insn);