qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [BUG] QEMU x86_64 SSE bug in modf() + MMX bug


From: Aurelien Jarno
Subject: Re: [Qemu-devel] Re: [BUG] QEMU x86_64 SSE bug in modf() + MMX bug
Date: Tue, 16 Jan 2007 18:50:32 +0100
User-agent: IceDove 1.5.0.9 (X11/20061220)

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
 `. `'   address@hidden         | address@hidden
   `-    people.debian.org/~aurel32 | www.aurel32.net




reply via email to

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