mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
target/riscv: Update check for Zca/Zcf/Zcd
Even though Zca/Zcf/Zcd can be included by C/F/D, however, their priv version is higher than the priv version of C/F/D. So if we use check for them instead of check for C/F/D totally, it will trigger new problem when we try to disable the extensions based on the configured priv version. Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20230517135714.211809-7-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
61a33ea95a
commit
d33e39f995
4 changed files with 21 additions and 15 deletions
|
@ -30,10 +30,12 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#define REQUIRE_ZCF(ctx) do { \
|
||||
if (!ctx->cfg_ptr->ext_zcf) { \
|
||||
return false; \
|
||||
} \
|
||||
#define REQUIRE_ZCF_OR_FC(ctx) do { \
|
||||
if (!ctx->cfg_ptr->ext_zcf) { \
|
||||
if (!has_ext(ctx, RVF) || !has_ext(ctx, RVC)) { \
|
||||
return false; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static bool trans_flw(DisasContext *ctx, arg_flw *a)
|
||||
|
@ -69,13 +71,13 @@ static bool trans_fsw(DisasContext *ctx, arg_fsw *a)
|
|||
|
||||
static bool trans_c_flw(DisasContext *ctx, arg_flw *a)
|
||||
{
|
||||
REQUIRE_ZCF(ctx);
|
||||
REQUIRE_ZCF_OR_FC(ctx);
|
||||
return trans_flw(ctx, a);
|
||||
}
|
||||
|
||||
static bool trans_c_fsw(DisasContext *ctx, arg_fsw *a)
|
||||
{
|
||||
REQUIRE_ZCF(ctx);
|
||||
REQUIRE_ZCF_OR_FC(ctx);
|
||||
return trans_fsw(ctx, a);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue