From a371684da99de63c6700f74c09e9250263d227b7 Mon Sep 17 00:00:00 2001 From: Bastian Koppelmann Date: Tue, 19 Mar 2019 05:36:46 -0400 Subject: [PATCH] target/riscv: Remove gen_system() with all 16 bit insns moved to decodetree no path is falling back to gen_system(), so we can remove it. Backports commit 8f7bc273868939f0821e07fb23792db63d45bffb from qemu --- qemu/target/riscv/translate.c | 36 ----------------------------------- 1 file changed, 36 deletions(-) diff --git a/qemu/target/riscv/translate.c b/qemu/target/riscv/translate.c index 95c6e74a..c62a87d0 100644 --- a/qemu/target/riscv/translate.c +++ b/qemu/target/riscv/translate.c @@ -492,35 +492,6 @@ static void gen_set_rm(DisasContext *ctx, int rm) tcg_temp_free_i32(tcg_ctx, t0); } -static void gen_system(DisasContext *ctx, uint32_t opc, int rd, int rs1, - int csr) -{ - TCGContext *tcg_ctx = ctx->uc->tcg_ctx; - - tcg_gen_movi_tl(tcg_ctx, tcg_ctx->cpu_pc_risc, ctx->base.pc_next); - - switch (opc) { - case OPC_RISC_ECALL: - switch (csr) { - case 0x0: /* ECALL */ - /* always generates U-level ECALL, fixed in do_interrupt handler */ - generate_exception(ctx, RISCV_EXCP_U_ECALL); - tcg_gen_exit_tb(tcg_ctx, NULL, 0); /* no chaining */ - ctx->base.is_jmp = DISAS_NORETURN; - break; - case 0x1: /* EBREAK */ - generate_exception(ctx, RISCV_EXCP_BREAKPOINT); - tcg_gen_exit_tb(tcg_ctx, NULL, 0); /* no chaining */ - ctx->base.is_jmp = DISAS_NORETURN; - break; - default: - gen_exception_illegal(ctx); - break; - } - break; - } -} - static void decode_RV32_64C0(DisasContext *ctx) { uint8_t funct3 = extract32(ctx->opcode, 13, 3); @@ -704,7 +675,6 @@ bool decode_insn16(DisasContext *ctx, uint16_t insn); static void decode_RV32_64G(DisasContext *ctx) { - int rs1, rd; uint32_t op; /* We do not do misaligned address check here: the address should never be @@ -713,14 +683,8 @@ static void decode_RV32_64G(DisasContext *ctx) * perform the misaligned instruction fetch */ op = MASK_OP_MAJOR(ctx->opcode); - rs1 = GET_RS1(ctx->opcode); - rd = GET_RD(ctx->opcode); switch (op) { - case OPC_RISC_SYSTEM: - gen_system(ctx, MASK_OP_SYSTEM(ctx->opcode), rd, rs1, - (ctx->opcode & 0xFFF00000) >> 20); - break; default: gen_exception_illegal(ctx); break;