ppc/svp64: disassemble ld/st idx mode
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 11 Apr 2023 18:27:26 +0000 (21:27 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Thu, 27 Apr 2023 05:17:08 +0000 (08:17 +0300)
opcodes/ppc-svp64-dis.c

index 137bdda4cddc77693a22dce17b26c82ff2111c84..f82baf9ce8ea4cd37490f8f7b4f18e3458450744 100644 (file)
@@ -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);