qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 04/13] target/i386: unify choice between single and repeated


From: Paolo Bonzini
Subject: Re: [PATCH 04/13] target/i386: unify choice between single and repeated string instructions
Date: Sun, 15 Dec 2024 15:39:36 +0100



Il dom 15 dic 2024, 15:10 Richard Henderson <richard.henderson@linaro.org> ha scritto:
On 12/15/24 03:06, Paolo Bonzini wrote:
> The same "if" is present in all generator functions for string instructions.
> Push it inside gen_repz() and gen_repz_nz() instead.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target/i386/tcg/translate.c | 12 +++++++++--
>   target/i386/tcg/emit.c.inc  | 42 +++++++------------------------------
>   2 files changed, 17 insertions(+), 37 deletions(-)
>
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index 8bf6aa1fcf6..63a39d9f15a 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -1340,13 +1340,21 @@ static void gen_repz(DisasContext *s, MemOp ot,
>                        void (*fn)(DisasContext *s, MemOp ot))
>   
>   {
> -    do_gen_rep(s, ot, fn, false);
> +    if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) {
> +        do_gen_rep(s, ot, fn, false);
> +    } else {
> +        fn(s, ot);
> +    }
>   }
>   
>   static void gen_repz_nz(DisasContext *s, MemOp ot,
>                           void (*fn)(DisasContext *s, MemOp ot))
>   {
> -    do_gen_rep(s, ot, fn, true);
> +    if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) {
> +        do_gen_rep(s, ot, fn, true);
> +    } else {
> +        fn(s, ot);
> +    }
>   }

Why not push it into do_gen_rep?

Just because do_gen_rep is already complicated enough by the end of the series.

Paolo 


r~


reply via email to

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