All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Musta <tommusta@gmail.com>
To: Sorav Bansal <sbansal@cse.iitd.ernet.in>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [Qemu-ppc] Fwd: Patch: fix to gen_mcrxr() in target-ppc/translate.c
Date: Wed, 11 Jun 2014 13:24:26 -0500	[thread overview]
Message-ID: <53989EDA.5000903@gmail.com> (raw)
In-Reply-To: <CA+mWYFtsim=WXucQ9eNFW+Vqzhx+7k0mGqTZdNg5ELYjx=rJ5g@mail.gmail.com>

On 6/11/2014 9:23 AM, Sorav Bansal wrote:
>> Please read my comments again.  I agree that SO, OV and CA are stored in the LSB of their internal QEMU representation.  The problem is that, even with your patch, these bits are not being correctly shifted into the target four bit CR field.
>>
> 
> Ah, I forgot that PPC spec starts bit numbering at the MSB. Here is
> the revised patch.
> 
> 
> From da0a962a6d14fe699ebb7cc12450c7de9553b66a Mon Sep 17 00:00:00 2001
> From: Sorav Bansal <sbansal@cse.iitd.ernet.in>
> Date: Wed, 11 Jun 2014 19:49:49 +0530
> Subject: [PATCH] Fixed the translation of the mcrxr ppc instruction
> 
> ---
>  target-ppc/translate.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> index f089014..59a92b9 100644
> --- a/target-ppc/translate.c
> +++ b/target-ppc/translate.c
> @@ -4147,8 +4147,9 @@ static void gen_mcrxr(DisasContext *ctx)
>      tcg_gen_trunc_tl_i32(t0, cpu_so);
>      tcg_gen_trunc_tl_i32(t1, cpu_ov);
>      tcg_gen_trunc_tl_i32(dst, cpu_ca);
> -    tcg_gen_shri_i32(t0, t0, 2);
> -    tcg_gen_shri_i32(t1, t1, 1);
> +    tcg_gen_shli_i32(t0, t0, 3);
> +    tcg_gen_shli_i32(t1, t1, 2);
> +    tcg_gen_shli_i32(dst, dst, 1);
>      tcg_gen_or_i32(dst, dst, t0);
>      tcg_gen_or_i32(dst, dst, t1);
>      tcg_temp_free_i32(t0);
> 

Your patch is missing the signoff.

Other than that, this does properly shift into the CR field.  My other comments about using deposit and lack of handling XER[35] still stand, but I don't believe your patch makes things worse.

Reviewed-by: Tom Musta <tommusta@gmail.com>

  reply	other threads:[~2014-06-11 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+mWYFvkiGGexDEUpD9KXiBYFVWQAXDjVODeX=miM9udQtObDw@mail.gmail.com>
2014-06-11  8:01 ` [Qemu-devel] Fwd: Patch: fix to gen_mcrxr() in target-ppc/translate.c Sorav Bansal
2014-06-11 11:54   ` [Qemu-devel] [Qemu-ppc] " Tom Musta
2014-06-11 14:23     ` Sorav Bansal
2014-06-11 18:24       ` Tom Musta [this message]
2014-06-12  3:11         ` Sorav Bansal
2014-06-13 14:59           ` Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53989EDA.5000903@gmail.com \
    --to=tommusta@gmail.com \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sbansal@cse.iitd.ernet.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.