mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
decodetree: Add DisasContext argument to !function expanders
This does require adjusting all existing users. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
70e0711ab1
commit
451e4ffdb0
5 changed files with 32 additions and 31 deletions
|
@ -48,13 +48,13 @@ static bool trans_c_flw_ld(DisasContext *ctx, arg_c_flw_ld *a)
|
|||
REQUIRE_EXT(ctx, RVF);
|
||||
|
||||
arg_c_lw tmp;
|
||||
decode_insn16_extract_cl_w(&tmp, ctx->opcode);
|
||||
decode_insn16_extract_cl_w(ctx, &tmp, ctx->opcode);
|
||||
arg_flw arg = { .rd = tmp.rd, .rs1 = tmp.rs1, .imm = tmp.uimm };
|
||||
return trans_flw(ctx, &arg);
|
||||
#else
|
||||
/* C.LD ( RV64C/RV128C-only ) */
|
||||
arg_c_fld tmp;
|
||||
decode_insn16_extract_cl_d(&tmp, ctx->opcode);
|
||||
decode_insn16_extract_cl_d(ctx, &tmp, ctx->opcode);
|
||||
arg_ld arg = { .rd = tmp.rd, .rs1 = tmp.rs1, .imm = tmp.uimm };
|
||||
return trans_ld(ctx, &arg);
|
||||
#endif
|
||||
|
@ -80,13 +80,13 @@ static bool trans_c_fsw_sd(DisasContext *ctx, arg_c_fsw_sd *a)
|
|||
REQUIRE_EXT(ctx, RVF);
|
||||
|
||||
arg_c_sw tmp;
|
||||
decode_insn16_extract_cs_w(&tmp, ctx->opcode);
|
||||
decode_insn16_extract_cs_w(ctx, &tmp, ctx->opcode);
|
||||
arg_fsw arg = { .rs1 = tmp.rs1, .rs2 = tmp.rs2, .imm = tmp.uimm };
|
||||
return trans_fsw(ctx, &arg);
|
||||
#else
|
||||
/* C.SD ( RV64C/RV128C-only ) */
|
||||
arg_c_fsd tmp;
|
||||
decode_insn16_extract_cs_d(&tmp, ctx->opcode);
|
||||
decode_insn16_extract_cs_d(ctx, &tmp, ctx->opcode);
|
||||
arg_sd arg = { .rs1 = tmp.rs1, .rs2 = tmp.rs2, .imm = tmp.uimm };
|
||||
return trans_sd(ctx, &arg);
|
||||
#endif
|
||||
|
@ -107,7 +107,7 @@ static bool trans_c_jal_addiw(DisasContext *ctx, arg_c_jal_addiw *a)
|
|||
#ifdef TARGET_RISCV32
|
||||
/* C.JAL */
|
||||
arg_c_j tmp;
|
||||
decode_insn16_extract_cj(&tmp, ctx->opcode);
|
||||
decode_insn16_extract_cj(ctx, &tmp, ctx->opcode);
|
||||
arg_jal arg = { .rd = 1, .imm = tmp.imm };
|
||||
return trans_jal(ctx, &arg);
|
||||
#else
|
||||
|
|
|
@ -517,7 +517,7 @@ static void decode_RV32_64C(DisasContext *ctx)
|
|||
}
|
||||
|
||||
#define EX_SH(amount) \
|
||||
static int ex_shift_##amount(int imm) \
|
||||
static int ex_shift_##amount(DisasContext *ctx, int imm) \
|
||||
{ \
|
||||
return imm << amount; \
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ EX_SH(12)
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
static int ex_rvc_register(int reg)
|
||||
static int ex_rvc_register(DisasContext *ctx, int reg)
|
||||
{
|
||||
return 8 + reg;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue