aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorVladimir Isaev <vladimir.isaev@syntacore.com>2023-02-04 11:23:12 +0300
committerAlistair Francis <alistair.francis@wdc.com>2023-02-07 08:19:23 +1000
commit5fc0fc8788e08f151f5d0c47d205e009aeb33844 (patch)
treee898f43897d6a7c0e803a18c0fb729f82e068aa2 /target
parent506c6698fbe53e88fba3160fc3842e5d41a9ee25 (diff)
downloadqemu-5fc0fc8788e08f151f5d0c47d205e009aeb33844.zip
qemu-5fc0fc8788e08f151f5d0c47d205e009aeb33844.tar.gz
qemu-5fc0fc8788e08f151f5d0c47d205e009aeb33844.tar.bz2
target/riscv: fix ctzw behavior
According to spec, ctzw should work with 32-bit register, not 64. For example, previous implementation returns 33 for (1<<33) input when the new one returns 32. Signed-off-by: Vladimir Isaev <vladimir.isaev@syntacore.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Suggested-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230204082312.43557-1-vladimir.isaev@syntacore.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target')
-rw-r--r--target/riscv/insn_trans/trans_rvb.c.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/target/riscv/insn_trans/trans_rvb.c.inc b/target/riscv/insn_trans/trans_rvb.c.inc
index e2b8329..990bc94 100644
--- a/target/riscv/insn_trans/trans_rvb.c.inc
+++ b/target/riscv/insn_trans/trans_rvb.c.inc
@@ -401,6 +401,7 @@ static bool trans_ctzw(DisasContext *ctx, arg_ctzw *a)
{
REQUIRE_64BIT(ctx);
REQUIRE_ZBB(ctx);
+ ctx->ol = MXL_RV32;
return gen_unary(ctx, a, EXT_ZERO, gen_ctzw);
}