-
Notifications
You must be signed in to change notification settings - Fork 2
riscv_dis_rv32e
- Status: Waiting for a prerequisite to be Merged
- Branch:
riscv-dis-rv32e - Tracking PR: #21 (view Pull Request and Diff)
- Mailing List:
- Not yet
RV32E is a subset of RV32I which has 16 general purpose registers instead of 32 on RV32I and all instructions accessing x16-x31 GPRs are reserved.
That's fairly simple but... how do we tell users whether an instruction is RVE-reserved? Directly detecting such RVE-reserved instructions require many changes to the core disassembler that will make changes to the core disassembler harder and more complex.
Instead, I chose rather simple approach here: print x16-x31 as an invalid operand. This patch replaces register name set with the RVE one when the E-extension is enabled. Even if we define a vendor-specific instruction in the RVE-reserved encoding space, that's fine if:
- we add
INSN_CLASS_E_AND_XVENDOR(to detectE && XVendorextensions) and - define that instruction before corresponding non-
RVEinstruction.
I chose names invalid16-invalid31 to represent original register names (x16-x31) but is it okay? If we don't have to print "unrecognized instruction" (such as .4byte) on such RVE-reserved instrucitons, this patch would be the simplest solution for the RV32E diassembler support.