summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2021-12-20 16:49:14 +1000
committerAlistair Francis <alistair.francis@wdc.com>2022-01-08 15:46:10 +1000
commitea7b5d5af6c3f994b10caa80c7f41964678eb2bb (patch)
tree2cf84eed72682b101e83c2fd74061c27d709970f
parent457c360f9c72f86ac6dd57f46a016dd361aaf3f7 (diff)
downloadfocaccia-qemu-ea7b5d5af6c3f994b10caa80c7f41964678eb2bb.tar.gz
focaccia-qemu-ea7b5d5af6c3f994b10caa80c7f41964678eb2bb.zip
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
-rw-r--r--target/riscv/translate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index 4ae4345691..9e4f9c3342 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -846,6 +846,7 @@ static void decode_opc(CPURISCVState *env, DisasContext *ctx, uint16_t opcode)
         if (!has_ext(ctx, RVC)) {
             gen_exception_illegal(ctx);
         } else {
+            ctx->opcode = opcode;
             ctx->pc_succ_insn = ctx->base.pc_next + 2;
             if (!decode_insn16(ctx, opcode)) {
                 gen_exception_illegal(ctx);
@@ -856,6 +857,7 @@ static void decode_opc(CPURISCVState *env, DisasContext *ctx, uint16_t opcode)
         opcode32 = deposit32(opcode32, 16, 16,
                              translator_lduw(env, &ctx->base,
                                              ctx->base.pc_next + 2));
+        ctx->opcode = opcode32;
         ctx->pc_succ_insn = ctx->base.pc_next + 4;
         if (!decode_insn32(ctx, opcode32)) {
             gen_exception_illegal(ctx);