target/riscv: Compute mstatus.sd on demand
commitb550f89457ef5022231f8255ae1a6ba496c492b1
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 20 Oct 2021 03:17:09 +0000 (19 20:17 -0700)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 22 Oct 2021 13:35:47 +0000 (22 23:35 +1000)
treedc8f410a57ffb289dafcefb81efbc066ff7dbf99
parent665b90d8a4aa7d90bbeee9ff279e37edcd573635
target/riscv: Compute mstatus.sd on demand

The position of this read-only field is dependent on the current xlen.
Rather than having to compute that difference in many places, compute
it only on read.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20211020031709.359469-16-richard.henderson@linaro.org
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu_helper.c
target/riscv/csr.c
target/riscv/translate.c