[PATCH] RISC-V: Control fence.i and csr instructions by zifencei and zicsr.
Andrew Waterman
andrew@sifive.com
Mon Dec 7 23:09:58 GMT 2020
On Mon, Dec 7, 2020 at 12:39 PM Jim Wilson <jimw@sifive.com> wrote:
>
> 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.
Agreed, both in general and also in this particular case (e.g.
RV32E_Zifencei is valid).
>
> Otherwise this all looks OK to me.
>
> Jim
>
More information about the Binutils
mailing list