qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] SPARC sdiv patch
@ 2008-08-25 19:12 Vince Weaver
  2008-08-25 19:45 ` Blue Swirl
  0 siblings, 1 reply; 2+ messages in thread
From: Vince Weaver @ 2008-08-25 19:12 UTC (permalink / raw)
  To: qemu-devel

Hello

the SPARC v9 manual specifies the sdiv instruction as computing
    Y concated with the *lower 32 bits* of r[rs1] / lower 32 bits of r[rs2]

The current code does not ensure that only the lowest 32 bits of rs1 are 
used.  The following patch fixes this.

This fix allows the "gcc" SPEC 2000 benchmark complete successfully.

The "udiv" helper might also need this fix.

Vince

--- target-sparc/op_helper.c.orig	2008-08-25 14:55:29.000000000 -0400
+++ target-sparc/op_helper.c	2008-08-25 15:04:51.000000000 -0400
@@ -2310,7 +2310,7 @@
      int64_t x0;
      int32_t x1;

-    x0 = a | ((int64_t) (env->y) << 32);
+    x0 = (a &0xffffffff) | ((int64_t) (env->y) << 32);
      x1 = b;

      if (x1 == 0) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] SPARC sdiv patch
  2008-08-25 19:12 [Qemu-devel] SPARC sdiv patch Vince Weaver
@ 2008-08-25 19:45 ` Blue Swirl
  0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2008-08-25 19:45 UTC (permalink / raw)
  To: qemu-devel

On 8/25/08, Vince Weaver <vince@csl.cornell.edu> wrote:
> Hello
>
>  the SPARC v9 manual specifies the sdiv instruction as computing
>    Y concated with the *lower 32 bits* of r[rs1] / lower 32 bits of r[rs2]
>
>  The current code does not ensure that only the lowest 32 bits of rs1 are
> used.  The following patch fixes this.
>
>  This fix allows the "gcc" SPEC 2000 benchmark complete successfully.
>
>  The "udiv" helper might also need this fix.

Thanks, applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-25 19:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-25 19:12 [Qemu-devel] SPARC sdiv patch Vince Weaver
2008-08-25 19:45 ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).