target/riscv: Reorg csr instructions
commita974879b4581b58369a1e5e01d8ce6736764c679
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 23 Aug 2021 19:55:23 +0000 (23 12:55 -0700)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 1 Sep 2021 01:59:12 +0000 (1 11:59 +1000)
treefab6220c40c81ec02f0b176c02a5eb966f863980
parent377cbb4bdbe2ee4155d740bf1d7fc9a081a61219
target/riscv: Reorg csr instructions

Introduce csrr and csrw helpers, for read-only and write-only insns.

Note that we do not properly implement this in riscv_csrrw, in that
we cannot distinguish true read-only (rs1 == 0) from any other zero
write_mask another source register -- this should still raise an
exception for read-only registers.

Only issue gen_io_start for CF_USE_ICOUNT.
Use ctx->zero for csrrc.
Use get_gpr and dest_gpr.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210823195529.560295-19-richard.henderson@linaro.org
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/helper.h
target/riscv/insn_trans/trans_rvi.c.inc
target/riscv/op_helper.c