All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/3] target-ppc: fix default qNaN
Date: Thu, 6 Jan 2011 16:03:31 +0100	[thread overview]
Message-ID: <20110106150331.GC21099@hall.aurel32.net> (raw)
In-Reply-To: <B0851E5F-0711-4687-9259-52725ECC417A@suse.de>

On Wed, Jan 05, 2011 at 06:09:34PM +0100, Alexander Graf wrote:
> 
> On 02.01.2011, at 15:39, Aurelien Jarno wrote:
> 
> > On PPC the default qNaN doesn't have the sign bit set.
> 
> The spec says "don't care" for the sign bit. Did you extract the value empirically? I'm not saying it's wrong - the default 32 Bit value seems to be 0x7FC0_0000 (2.06 ISA 6.6.2.2).

"don't care" is for detecting a qNaN which can be represented by
thousands of different values. It's different from the default qNaN.

2.06 ISA 6.6.2.2 is for vector operations, which are always 32-bit. We 
are also using this value, this time through softfloat-specialize.h 
(look at float32_default_nan).

For 64-bit values, the default value is defined in 4.3. For the long
term, we should remove the default qNaN value from
target-ppc/op_helper.c and only use the one in softfloat-specialize.h.
However it needs reworking of part of the softfloat library first.

> Hrm ... reading section 5.4.2:
> 
> A special QNaN is sometimes supplied as the default QNaN for a disabled invalid-operation exception; it has a plus sign, the leftmost 6 bits of the combination field set to 0b111110 and remaining bits in the combination field and the trailing significand field set to zero.
> 

That's for decimal floating point, and not binary floating point,
however it seems they use the same convention.

Thanks for the review.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2011-01-06 15:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-02 14:39 [Qemu-devel] [PATCH 0/3] target-ppc: improve FPU emulation Aurelien Jarno
2011-01-02 14:39 ` [Qemu-devel] [PATCH 1/3] target-ppc: remove PRECISE_EMULATION define Aurelien Jarno
2011-01-05 17:02   ` [Qemu-devel] " Alexander Graf
2011-01-02 14:39 ` [Qemu-devel] [PATCH 2/3] target-ppc: fix default qNaN Aurelien Jarno
2011-01-05 17:09   ` [Qemu-devel] " Alexander Graf
2011-01-06 15:03     ` Aurelien Jarno [this message]
2011-01-02 14:39 ` [Qemu-devel] [PATCH 3/3] target-ppc: fix sNaN propagation Aurelien Jarno
2011-01-05 17:20   ` [Qemu-devel] " Alexander Graf
2011-01-10 19:26     ` Aurelien Jarno
2011-01-11  0:14   ` [Qemu-devel] " Peter Maydell
2011-01-11  6:23     ` Aurelien Jarno

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=20110106150331.GC21099@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=agraf@suse.de \
    --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.