qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tim Olson <tim@io.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] SSE 'maxps' instruction bug?
Date: Tue, 13 Mar 2007 18:07:22 -0500	[thread overview]
Message-ID: <41decffa258b38db92ab799d6c2990bc@io.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703121921580.14408@linmac.oyster.ru>


On Mar 12, 2007, at 11:27 AM, malc wrote:

>
> QEMU and Core 2 Duo disagree on the handling of NaNs it seems.
>
> http://courses.ece.uiuc.edu/ece390/books/labmanual/inst-ref-simd.html
> - this implies that MAXPS should leave the NaNs alone, no idea how
> normative that is though (and no IA32 manual at hand)

I compiled and ran the code that Julian supplied on an AMD processor 
with SSE, and on qemu-i386  version 0.8.2 built with that system, and 
both agreed with the Intel Core 2 results that Julian supplied.

That means that either qemu changed in this area between v 0.8.2 and 
0.9.0, or that the compiler/host combination used to build the qemu 
binary Julian is running generated bad code for the float compares.

The MAXPS instruction is defined to operate on NaNs in such a way that 
it can be used as a direct replacement for an iterated scalar max 
operation coded in C like:

	a = (a > b) ? a : b;

Which is exactly how it is coded in qemu (at least in v0.8.2).  This 
relies upon the fact that the greater-than comparison returns false 
anytime there is an unordered operand (NaN), for either operand -- in 
which case the result is the second argument.

	-- Tim Olson

  parent reply	other threads:[~2007-03-13 23:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 14:50 [Qemu-devel] SSE 'maxps' instruction bug? Julian Seward
2007-03-12 16:27 ` malc
2007-03-13 14:03   ` Julian Seward
2007-03-13 23:07   ` Tim Olson [this message]
2007-03-14  2:21     ` Julian Seward
2007-03-16 18:07       ` Rob Landley
2007-03-16 18:10         ` Julian Seward
2007-03-16 20:17           ` Rob Landley

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=41decffa258b38db92ab799d6c2990bc@io.com \
    --to=tim@io.com \
    --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 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).