All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Torbjorn Granlund <tg@gmplib.org>
Cc: "<qemu-ppc@nongnu.org>" <qemu-ppc@nongnu.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Incorrect handling of PPC64 rldcl insn
Date: Mon, 06 May 2013 19:47:25 +0200	[thread overview]
Message-ID: <5187ECAD.4050901@suse.de> (raw)
In-Reply-To: <86sj20rql4.fsf@shell.gmplib.org>

On 05/06/2013 07:00 PM, Torbjorn Granlund wrote:
> I could finally make Debian GNU/Linux install and run under
> qemu-system-ppc64.  I used Debian 7.0.0 and qemu from the main git repo,
> updated a few days ago.
>
> While Debian runs well and not too slowly, GMP fails badly under all
> ABIs, and in many different ways.  I have isolated the first problem.
>
> Test case:
>
> #include<stdio.h>
> int
> main ()
> {
>    unsigned long r;
>    asm ("rldcl\t%0, %1, %2, 0" : "=r" (r) : "r" (0xcafebabedeadbeeful), "r" (16));
>    printf ("%lx\n", r);
>    return 0;
> }
>
> Expected output:
> babedeadbeefcafe
>
> Output under qemu:
> 0
>
> I have single stepped in gdb to determine that it is indeed rldcl that
> misbehaves.

Thanks a lot for the bug report and test case! Please CC qemu-ppc 
whenever you find issues or have patches for PPC. That makes filtering 
for important mails a lot easier.

Does the patch below fix the issue for you?


Alex

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 0886f4d..a018616 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -1733,8 +1733,6 @@ static inline void gen_rldnm(DisasContext *ctx, 
uint32_t mb, uint32_t me)
  {
      TCGv t0;

-    mb = MB(ctx->opcode);
-    me = ME(ctx->opcode);
      t0 = tcg_temp_new();
      tcg_gen_andi_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x3f);
      tcg_gen_rotl_tl(t0, cpu_gpr[rS(ctx->opcode)], t0);

  reply	other threads:[~2013-05-06 17:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 17:00 [Qemu-devel] Incorrect handling of PPC64 rldcl insn Torbjorn Granlund
2013-05-06 17:47 ` Alexander Graf [this message]
2013-05-06 18:13   ` Torbjorn Granlund
2013-05-06 22:14     ` Alexander Graf
2013-05-06 23:12       ` Aurelien Jarno
2013-05-07 10:27       ` [Qemu-devel] Incorrect handling of more PPC64 insns Torbjorn Granlund
2013-05-07 10:39         ` Peter Maydell
2013-05-07 11:48           ` Torbjorn Granlund
2013-05-07 11:51             ` Peter Maydell
2013-05-07 15:58         ` [Qemu-devel] Incorrect handling of more PPC64 insns (PATCH) Torbjorn Granlund
2013-05-07 17:12           ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2013-05-07 18:10             ` Torbjorn Granlund
2013-05-07 19:30               ` Torbjorn Granlund
2013-05-07 22:00                 ` Alexander Graf
2013-05-08  6:50                 ` Aurelien Jarno
2013-05-08  6:52                   ` Alexander Graf
2013-05-08  9:20                   ` Torbjorn Granlund
2013-05-08  9:32                     ` Alexander Graf
2013-05-08  9:57                       ` Alexander Graf
2013-05-08 10:07                         ` Torbjorn Granlund
2013-05-08 10:45                           ` 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=5187ECAD.4050901@suse.de \
    --to=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=tg@gmplib.org \
    /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.