diff options
author | Nelson Chu <nelson.chu@sifive.com> | 2021-11-30 13:25:05 +0800 |
---|---|---|
committer | Nelson Chu <nelson.chu@sifive.com> | 2021-11-30 15:14:31 +0800 |
commit | ee083a9e7cca3f2946a259303b4594d6329602fd (patch) | |
tree | 221b5a5f47d3d9db8cce1b4ba43c8d36fcaed1e5 /opcodes/riscv-opc.c | |
parent | ae8e528122be3e0344b2ee533b4b050389e8dcad (diff) | |
download | gdb-ee083a9e7cca3f2946a259303b4594d6329602fd.zip gdb-ee083a9e7cca3f2946a259303b4594d6329602fd.tar.gz gdb-ee083a9e7cca3f2946a259303b4594d6329602fd.tar.bz2 |
RISC-V: Dump vset[i]vli immediate as numbers once vsew or vlmul is reserved.
Consider the following case,
vsetvli a0, a1, 0x4 # unrecognized vlmul
vsetvli a0, a1, 0x20 # unrecognized vsew
vsetivli a0, 0xb, 0x4 # unrecognized vlmul
vsetivli a0, 0xb, 0x20 # unrecognized vsew
For the current dis-assembler, we get the result,
0000000000000000 <.text>:
0: 0045f557 vsetvli a0,a1,e8,(null),tu,mu
4: 0205f557 vsetvli a0,a1,e128,m1,tu,mu
8: c045f557 vsetivli a0,11,e8,(null),tu,mu
c: c205f557 vsetivli a0,11,e128,m1,tu,mu
The vsew e128 and vlmul (null) are preserved according to the spec,
so dump these fields looks wrong. Consider that we are used to dump
the unrecognized csr as csr numbers directly, we should also dump
the whole vset[i]vli immediates as numbers, once the vsew or vlmul
is reserved. Therefore, following is what I expected,
0000000000000000 <.text>:
0: 0045f557 vsetvli a0,a1,4
4: 0205f557 vsetvli a0,a1,32
8: c045f557 vsetivli a0,11,4
c: c205f557 vsetivli a0,11,32
gas/
* testsuite/gas/riscv/vector-insns.d: Rewrite the vset[i]vli
testcases since we should dump the immediate as numbers once
the vsew or vlmul is reserved.
* testsuite/gas/riscv/vector-insns.s: Likewise.
opcodes/
* riscv-dis.c (print_insn_args): The reserved vsew and vlmul
are NULL string in the riscv_vsew and riscv_vlmul, so dump the
whole imm as numbers once one of them is NULL.
* riscv-opc.c (riscv_vsew): Set the reserved vsew to NULL.
(riscv_vlmul): Set the reserved vlmul to NULL.
Diffstat (limited to 'opcodes/riscv-opc.c')
-rw-r--r-- | opcodes/riscv-opc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c index bad77fb..40037db 100644 --- a/opcodes/riscv-opc.c +++ b/opcodes/riscv-opc.c @@ -76,13 +76,13 @@ const char * const riscv_vecm_names_numeric[NVECM] = /* The vsetvli vsew constants. */ const char * const riscv_vsew[8] = { - "e8", "e16", "e32", "e64", "e128", "e256", "e512", "e1024" + "e8", "e16", "e32", "e64", NULL, NULL, NULL, NULL }; /* The vsetvli vlmul constants. */ const char * const riscv_vlmul[8] = { - "m1", "m2", "m4", "m8", 0, "mf8", "mf4", "mf2" + "m1", "m2", "m4", "m8", NULL, "mf8", "mf4", "mf2" }; /* The vsetvli vta constants. */ |