qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 16/23] target/mips: Extract trap code into env->error_code


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 16/23] target/mips: Extract trap code into env->error_code
Date: Wed, 3 Nov 2021 16:21:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

On 11/3/21 15:08, Richard Henderson wrote:
> Simplify cpu_loop by doing all of the decode in translate.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  linux-user/mips/cpu_loop.c                | 41 +----------------------
>  target/mips/tcg/translate.c               | 24 ++++++++++---
>  target/mips/tcg/micromips_translate.c.inc |  4 +--
>  target/mips/tcg/nanomips_translate.c.inc  |  4 +--
>  4 files changed, 25 insertions(+), 48 deletions(-)

> diff --git a/target/mips/tcg/micromips_translate.c.inc 
> b/target/mips/tcg/micromips_translate.c.inc
> index f91f7a96cd..7e7d26a91b 100644
> --- a/target/mips/tcg/micromips_translate.c.inc
> +++ b/target/mips/tcg/micromips_translate.c.inc
> @@ -1047,7 +1047,7 @@ static void gen_pool32axf(CPUMIPSState *env, 
> DisasContext *ctx, int rt, int rs)
>      case TNE:
>          mips32_op = OPC_TNE;
>      do_trap:
> -        gen_trap(ctx, mips32_op, rs, rt, -1);
> +        gen_trap(ctx, mips32_op, rs, rt, -1, extract32(ctx->opcode, 12, 4));
>          break;
>  #ifndef CONFIG_USER_ONLY
>      case MFC0:
> @@ -2439,7 +2439,7 @@ static void decode_micromips32_opc(CPUMIPSState *env, 
> DisasContext *ctx)
>              check_insn_opc_removed(ctx, ISA_MIPS_R6);
>              mips32_op = OPC_TEQI;
>          do_trapi:
> -            gen_trap(ctx, mips32_op, rs, -1, imm);
> +            gen_trap(ctx, mips32_op, rs, -1, imm, 0);

IIUC the microMIPS manual (MD00594):

               gen_trap(ctx, mips32_op, rs, -1, imm,
                        extract32(ctx->opcode, 12, 4));

>              break;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]