summaryrefslogtreecommitdiff
path: root/opcodes/riscv-dis.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/riscv-dis.c')
-rw-r--r--opcodes/riscv-dis.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
index 86e2e5ab214..fac80b4fc3d 100644
--- a/opcodes/riscv-dis.c
+++ b/opcodes/riscv-dis.c
@@ -291,6 +291,73 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info
}
break;
+ case 'V': /* RVV */
+ switch (*++oparg)
+ {
+ case 'd':
+ case 'f':
+ print (info->stream, "%s",
+ riscv_vecr_names_numeric[EXTRACT_OPERAND (VD, l)]);
+ break;
+ case 'e':
+ if (!EXTRACT_OPERAND (VWD, l))
+ print (info->stream, "%s", riscv_gpr_names[0]);
+ else
+ print (info->stream, "%s",
+ riscv_vecr_names_numeric[EXTRACT_OPERAND (VD, l)]);
+ break;
+ case 's':
+ print (info->stream, "%s",
+ riscv_vecr_names_numeric[EXTRACT_OPERAND (VS1, l)]);
+ break;
+ case 't':
+ case 'u': /* VS1 == VS2 already verified at this point. */
+ case 'v': /* VD == VS1 == VS2 already verified at this point. */
+ print (info->stream, "%s",
+ riscv_vecr_names_numeric[EXTRACT_OPERAND (VS2, l)]);
+ break;
+ case '0':
+ print (info->stream, "%s", riscv_vecr_names_numeric[0]);
+ break;
+ case 'b':
+ case 'c':
+ {
+ int imm = (*oparg == 'b') ? EXTRACT_RVV_VB_IMM (l)
+ : EXTRACT_RVV_VC_IMM (l);
+ unsigned int imm_vlmul = EXTRACT_OPERAND (VLMUL, imm);
+ unsigned int imm_vsew = EXTRACT_OPERAND (VSEW, imm);
+ unsigned int imm_vta = EXTRACT_OPERAND (VTA, imm);
+ unsigned int imm_vma = EXTRACT_OPERAND (VMA, imm);
+ unsigned int imm_vtype_res = EXTRACT_OPERAND (VTYPE_RES, imm);
+
+ if (imm_vsew < ARRAY_SIZE (riscv_vsew)
+ && imm_vlmul < ARRAY_SIZE (riscv_vlmul)
+ && imm_vta < ARRAY_SIZE (riscv_vta)
+ && imm_vma < ARRAY_SIZE (riscv_vma)
+ && !imm_vtype_res)
+ print (info->stream, "%s,%s,%s,%s", riscv_vsew[imm_vsew],
+ riscv_vlmul[imm_vlmul], riscv_vta[imm_vta],
+ riscv_vma[imm_vma]);
+ else
+ print (info->stream, "%d", imm);
+ }
+ break;
+ case 'i':
+ print (info->stream, "%d", (int)EXTRACT_RVV_VI_IMM (l));
+ break;
+ case 'j':
+ print (info->stream, "%d", (int)EXTRACT_RVV_VI_UIMM (l));
+ break;
+ case 'k':
+ print (info->stream, "%d", (int)EXTRACT_RVV_OFFSET (l));
+ break;
+ case 'm':
+ if (! EXTRACT_OPERAND (VMASK, l))
+ print (info->stream, ",%s", riscv_vecm_names_numeric[0]);
+ break;
+ }
+ break;
+
case ',':
case '(':
case ')':