target/riscv: Set the opcode in DisasContext
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Message-id: 20211220064916.107241-2-alistair.francis@opensource.wdc.com
This commit is contained in:
parent
457c360f9c
commit
ea7b5d5af6
|
@ -846,6 +846,7 @@ static void decode_opc(CPURISCVState *env, DisasContext *ctx, uint16_t opcode)
|
||||||
if (!has_ext(ctx, RVC)) {
|
if (!has_ext(ctx, RVC)) {
|
||||||
gen_exception_illegal(ctx);
|
gen_exception_illegal(ctx);
|
||||||
} else {
|
} else {
|
||||||
|
ctx->opcode = opcode;
|
||||||
ctx->pc_succ_insn = ctx->base.pc_next + 2;
|
ctx->pc_succ_insn = ctx->base.pc_next + 2;
|
||||||
if (!decode_insn16(ctx, opcode)) {
|
if (!decode_insn16(ctx, opcode)) {
|
||||||
gen_exception_illegal(ctx);
|
gen_exception_illegal(ctx);
|
||||||
|
@ -856,6 +857,7 @@ static void decode_opc(CPURISCVState *env, DisasContext *ctx, uint16_t opcode)
|
||||||
opcode32 = deposit32(opcode32, 16, 16,
|
opcode32 = deposit32(opcode32, 16, 16,
|
||||||
translator_lduw(env, &ctx->base,
|
translator_lduw(env, &ctx->base,
|
||||||
ctx->base.pc_next + 2));
|
ctx->base.pc_next + 2));
|
||||||
|
ctx->opcode = opcode32;
|
||||||
ctx->pc_succ_insn = ctx->base.pc_next + 4;
|
ctx->pc_succ_insn = ctx->base.pc_next + 4;
|
||||||
if (!decode_insn32(ctx, opcode32)) {
|
if (!decode_insn32(ctx, opcode32)) {
|
||||||
gen_exception_illegal(ctx);
|
gen_exception_illegal(ctx);
|
||||||
|
|
Loading…
Reference in New Issue