qemu-s390x
[Top][All Lists]
Advanced

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

Re: [PATCH 18/26] target/s390x: Split per_branch


From: Ilya Leoshkevich
Subject: Re: [PATCH 18/26] target/s390x: Split per_branch
Date: Thu, 3 Nov 2022 15:45:19 +0100

On Wed, Oct 05, 2022 at 08:44:13PM -0700, Richard Henderson wrote:
> Split into per_branch_dest and per_branch_disp, which can be
> used for direct and indirect.  In preperation for TARGET_TB_PCREL,
> call per_branch_* before indirect branches.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/s390x/tcg/translate.c | 32 ++++++++++++++++++--------------
>  1 file changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
> index 712f6d5795..bd2ee1c96e 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -350,21 +350,25 @@ static inline bool per_enabled(DisasContext *s)
>  #endif
>  }
>  
> -static void per_branch(DisasContext *s, bool to_next)
> +static void per_branch_dest(DisasContext *s, TCGv_i64 dest)
>  {
>  #ifndef CONFIG_USER_ONLY
>      gen_psw_addr_disp(s, gbea, 0);
> +    if (s->base.tb->flags & FLAG_MASK_PER) {
> +        gen_helper_per_branch(cpu_env, gbea, dest);
> +    }
> +#endif
> +}
>  
> -    if (per_enabled(s)) {
> -        if (to_next) {
> -            TCGv_i64 next_pc = tcg_temp_new_i64();
> -
> -            gen_psw_addr_disp(s, next_pc, s->ilen);
> -            gen_helper_per_branch(cpu_env, gbea, next_pc);
> -            tcg_temp_free_i64(next_pc);
> -        } else {
> -            gen_helper_per_branch(cpu_env, gbea, psw_addr);
> -        }
> +static void per_branch_disp(DisasContext *s, int64_t disp)
> +{
> +#ifndef CONFIG_USER_ONLY
> +    gen_psw_addr_disp(s, gbea, 0);
> +    if (s->base.tb->flags & FLAG_MASK_PER) {
> +        TCGv_i64 dest = tcg_temp_new_i64();
> +        gen_psw_addr_disp(s, dest, disp);
> +        gen_helper_per_branch(cpu_env, gbea, dest);
> +        tcg_temp_free_i64(dest);
>      }
>  #endif
>  }

...

Nit: maybe use per_enabled(s) instead of testing the mask manually?

Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>



reply via email to

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