All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [BUG] QEMU x86_64 SSE bug in modf() + MMX bug
Date: Tue, 16 Jan 2007 18:50:32 +0100	[thread overview]
Message-ID: <45AD1068.40507@aurel32.net> (raw)
In-Reply-To: <45ACFB1E.4020803@linbox.com>

Ludovic Drolez a écrit :
> I've also found the buggy SSE instruction by tracing modf() with gdb.
> It's similar to the MMX bug found below: only the 32 bits part of the register 
> is stored instead of the whole 64 bits.
> 
> The bug is in the movd instruction in 64 bits emulation.
> Under gdb, just before the movd I had %rsi=0x3FF0000000000000
> and, after movd, %xmm0=0 ! Only the 32bits part seems to be copied when
> the source is a 64bits register.
> 
>     2edaa:       48 d3 e0                shl    %cl,%rax
>     2edad:       48 21 c6                and    %rax,%rsi
>     2edb0:       66 48 0f 6e c6          movd   %rsi,%xmm0
> 
> So in fact the valgrind mmx bug and the modf() bug have the same cause.
> 

I have just looked at the documentation from AMD. I confirm that in
32-bit mode, the 32 bits of the register have to be copied in the lower
part of mmx or xmm register. In 64-bit mode, the 64 bits of the register
have to be copied in the mmx register or in the lower part of the xmm
register.

So that confirms the implementation in QEMU is wrong.

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

  reply	other threads:[~2007-01-16 17:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 10:18 [Qemu-devel] [BUG] QEMU x86_64 SSE bug in modf() Ludovic Drolez
2007-01-15 11:54 ` Carlo Marcelo Arenas Belon
2007-01-15 14:00   ` [Qemu-devel] " Ludovic Drolez
2007-01-15 14:16   ` [Qemu-devel] " Julian Seward
2007-01-16 11:22     ` [Qemu-devel] Re: [BUG] QEMU x86_64 SSE bug in modf() + MMX bug Ludovic Drolez
2007-01-16 16:19       ` Ludovic Drolez
2007-01-16 17:50         ` Aurelien Jarno [this message]
2007-01-15 12:02 ` [Qemu-devel] [BUG] QEMU x86_64 SSE bug in modf() Thiemo Seufer
2007-01-15 13:54   ` Ludovic Drolez

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=45AD1068.40507@aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.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.