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>
This commit is contained in:
parent
506c6698fb
commit
5fc0fc8788
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue