Skip to content

riscv_dis_shift_xlen_2

Tsukasa OI edited this page Oct 19, 2022 · 6 revisions

Disassembler: Check shift amount against XLEN (Idea 2)

Issue Solved

In the disassembler, there's no validation whether shift amount is valid on specific architecture.

Idea 1 patchset fixes that by adding xlen argument to match_func (in opcode entries).

Idea 2 patchset (this patchset) fixes that by printing invalid0x[SHAMT] instead of actual shift width (SHAMT in hexadecimal). If we don't have to print "unrecognized instruction" (such as .4byte) on instrucitons with invalid shift amounts, this patch would be the simplest solution for the invalid shift amount checking support on the disassembler.

Styling Support

This patchset supports styling. Invalid shift amounts are printed as text, not immediate.

invalid0x20 (an invalid shift amount) has different color than 0x15 (a valid shift amount)

Clone this wiki locally