qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 22/33] target/nios2: Introduce dest_gpr


From: Peter Maydell
Subject: Re: [PATCH v4 22/33] target/nios2: Introduce dest_gpr
Date: Tue, 8 Mar 2022 11:07:26 +0000

On Tue, 8 Mar 2022 at 07:20, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Constrain all references to cpu_R[] to load_gpr and dest_gpr.
> This will be required for supporting shadow register sets.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/nios2/translate.c | 144 +++++++++++++++------------------------
>  1 file changed, 55 insertions(+), 89 deletions(-)



> @@ -449,15 +435,11 @@ static void rdctl(DisasContext *dc, uint32_t code, 
> uint32_t flags)
>      g_assert_not_reached();
>  #else
>      R_TYPE(instr, code);
> -    TCGv t1, t2;
> -
> -    if (unlikely(instr.c == R_ZERO)) {
> -        return;
> -    }
> +    TCGv t1, t2, dest = dest_gpr(dc, instr.c);
>
>      /* Reserved registers read as zero. */
>      if (nios2_cr_reserved(&dc->cr_state[instr.imm5])) {
> -        tcg_gen_movi_tl(cpu_R[instr.c], 0);
> +        tcg_gen_movi_tl(dest, 0);
>          return;
>      }

I assume the TCG dead-code elimination will mostly throw away the
write-to-R_ZERO stuff, but here for rdctl I suspect it won't.
But probably real code doesn't do that kind of silly thing.



Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM



reply via email to

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