qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-ppc] [PATCH 14/15] target-ppc: Use tcg_gen_extrac


From: David Gibson
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 14/15] target-ppc: Use tcg_gen_extract_*
Date: Mon, 17 Oct 2016 14:38:06 +1100
User-agent: Mutt/1.7.0 (2016-08-17)

On Sat, Oct 15, 2016 at 08:37:49PM -0700, Richard Henderson wrote:
> Use the new primitives for RDWINM and RLDICL.
> 
> Cc: address@hidden
> Signed-off-by: Richard Henderson <address@hidden>

Applied to ppc-for-2.8, thanks.

> ---
>  target-ppc/translate.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> index bfc1301..724d95c 100644
> --- a/target-ppc/translate.c
> +++ b/target-ppc/translate.c
> @@ -1977,9 +1977,8 @@ static void gen_rlwinm(DisasContext *ctx)
>      if (mb == 0 && me == (31 - sh)) {
>          tcg_gen_shli_tl(t_ra, t_rs, sh);
>          tcg_gen_ext32u_tl(t_ra, t_ra);
> -    } else if (sh != 0 && me == 31 && sh == (32 - mb)) {
> -        tcg_gen_ext32u_tl(t_ra, t_rs);
> -        tcg_gen_shri_tl(t_ra, t_ra, mb);
> +    } else if (me == 31 && (me - mb + 1) + sh <= 32) {
> +        tcg_gen_extract_tl(t_ra, t_rs, sh, me - mb + 1);
>      } else {
>          target_ulong mask;
>  #if defined(TARGET_PPC64)
> @@ -2094,8 +2093,8 @@ static void gen_rldinm(DisasContext *ctx, int mb, int 
> me, int sh)
>  
>      if (sh != 0 && mb == 0 && me == (63 - sh)) {
>          tcg_gen_shli_tl(t_ra, t_rs, sh);
> -    } else if (sh != 0 && me == 63 && sh == (64 - mb)) {
> -        tcg_gen_shri_tl(t_ra, t_rs, mb);
> +    } else if (me == 63 && (me - mb + 1) + sh <= 64) {
> +        tcg_gen_extract_tl(t_ra, t_rs, sh, me - mb + 1);
>      } else {
>          tcg_gen_rotli_tl(t_ra, t_rs, sh);
>          tcg_gen_andi_tl(t_ra, t_ra, MASK(mb, me));

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

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