target/riscv: Fix endianness swap on compressed instructions
Three instructions were not using the endianness swap flag, which resulted in a bug on big-endian architectures.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3131
Buglink: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2123828
Fixes: e0a3054f18 ("target/riscv: add support for Zcb extension")
Signed-off-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250929115543.1648157-1-valentin.haudiquet@canonical.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
15abfced80
commit
b25133d38f
1 changed files with 3 additions and 3 deletions
|
|
@ -88,13 +88,13 @@ static bool trans_c_lbu(DisasContext *ctx, arg_c_lbu *a)
|
|||
static bool trans_c_lhu(DisasContext *ctx, arg_c_lhu *a)
|
||||
{
|
||||
REQUIRE_ZCB(ctx);
|
||||
return gen_load(ctx, a, MO_UW);
|
||||
return gen_load(ctx, a, MO_TEUW);
|
||||
}
|
||||
|
||||
static bool trans_c_lh(DisasContext *ctx, arg_c_lh *a)
|
||||
{
|
||||
REQUIRE_ZCB(ctx);
|
||||
return gen_load(ctx, a, MO_SW);
|
||||
return gen_load(ctx, a, MO_TESW);
|
||||
}
|
||||
|
||||
static bool trans_c_sb(DisasContext *ctx, arg_c_sb *a)
|
||||
|
|
@ -106,7 +106,7 @@ static bool trans_c_sb(DisasContext *ctx, arg_c_sb *a)
|
|||
static bool trans_c_sh(DisasContext *ctx, arg_c_sh *a)
|
||||
{
|
||||
REQUIRE_ZCB(ctx);
|
||||
return gen_store(ctx, a, MO_UW);
|
||||
return gen_store(ctx, a, MO_TEUW);
|
||||
}
|
||||
|
||||
#define X_S0 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue