[PATCH] RISC-V: Control fence.i and csr instructions by zifencei and zicsr.
Jim Wilson
jimw@sifive.com
Mon Dec 7 20:39:01 GMT 2020
On Wed, Dec 2, 2020 at 6:27 PM Nelson Chu <nelson.chu@sifive.com> wrote:
> + case INSN_CLASS_I_AND_ZICSR:
> + return (riscv_subset_supports ("i")
> + && riscv_subset_supports ("zicsr"));
> + case INSN_CLASS_I_AND_ZIFENCEI:
> + return (riscv_subset_supports ("i")
> + && riscv_subset_supports ("zifencei"));
>
Do we really need the 'i' check here? I don't think that either zicsr or
zifencei requires the 'i' extension. I don't see anything in the unpriv
spec about that. 'i' is just the category that the extension has been
placed into. zba doesn't require the B extension for instance. If we do
need the 'i' extension, maybe we should check that during parsing, once,
instead of everytime we see an instruction in that group. But I think the
check is unnecessary. If we drop the 'i' check, then we can delete 6
characters from the insn class name, which will make the riscv-opc.c file
look nicer.
Otherwise this all looks OK to me.
Jim
More information about the Binutils
mailing list