All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Christophe Lyon <christophe.lyon@st.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3] Softfloat: Add support to softfloat to return floatxx_default_nan when, the corresponding target status flag is set.
Date: Wed, 9 Feb 2011 19:35:26 +0100	[thread overview]
Message-ID: <20110209183526.GA3131@volta.aurel32.net> (raw)
In-Reply-To: <AANLkTimu0eF9cbFFiOmUmARMVB8+uMOZo19eL96fhnX3@mail.gmail.com>

Hi,

On Tue, Feb 08, 2011 at 08:06:57PM +0000, Peter Maydell wrote:
> On 8 February 2011 18:53, Peter Maydell <peter.maydell@linaro.org> wrote:
> > On 8 February 2011 17:51, Christophe Lyon <christophe.lyon@st.com> wrote:
> >> - this means implementing float16ToCommonNaN, thus float16_is_signaling_nan()
> >
> > ...like that, yes.
> 
> I have a slightly-tested implementation of these functions on my
> hard disk now; I'll try to finish testing them tomorrow (my testing
> is still falling over on some inputs to VCVTT/VCVTB).
> 
> (cc: Aurelien for the softfloat style questions:)
> 
> I think we should go ahead and define a float16 type.

I fully agree with that. I have seen you have already sent patches about
that, will look at them later.

> Also, at the moment the commonNaNToFloatX(floatYToCommonNaN())
> idiom doesn't do anything to avoid signaling NaNs showing up in
> the output. On ARM this got fixed by having the helper.c wrappers
> call float*_maybe_silence_nan() but maybe we should do it
> in the generic softfloat code?
> 
> ie instead of:
> 
>     if ( mantissa )
>         return make_float32(
>             ( ( (bits32) a.sign )<<31 ) | 0x7F800000 | ( a.high>>41 ) );
>     else
>         return float32_default_nan;
> 
> do:
>    float32 r = make_float32(
>             ( ( (bits32) a.sign )<<31 ) | 0x7F800000 | ( a.high>>41 ) );

On an unrelated note, if we changes in this function, it might be a good
idea to use mantissa instead of a.high>>41. It's the same, but probably 
easier to read.

>    if (!mantissa) {
>       /* target specific, !SNAN_BIT_IS_ONE targets probably
>        * just set the QNAN bit (true for ARM, SPARC)
>        * others likely return the default NaN ?
>        */
>    } else {
>       return float32_maybe_silence_nan(r);
>    }
> 
> I'm pretty sure the existing code is wrong for SPARC, for instance,
> which is supposed to return a float32 qNaN with just the QNAN bit set
> if it is presented with a float64 signalling NaN all of whose non-zero
> mantissa bits are at the bottom end and don't make it into the float32.
> (ARM dodges a bullet here because as it happens our float32
> default_nan has only the QNAN bit set, but SPARC's has all the
> mantissa bits set.)
> 
> Opinions?
> 

It makes sense. I will play a bit with a real MIPS machine to see how it
behaves and come back with my results.

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

  reply	other threads:[~2011-02-09 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 17:00 [Qemu-devel] [PATCH v3] Softfloat: Add support to softfloat to return floatxx_default_nan when, the corresponding target status flag is set Christophe Lyon
2011-02-08 15:59 ` Peter Maydell
2011-02-08 17:51   ` Christophe Lyon
2011-02-08 18:53     ` Peter Maydell
2011-02-08 20:06       ` Peter Maydell
2011-02-09 18:35         ` Aurelien Jarno [this message]
2011-02-09 18:56           ` Peter Maydell
2011-02-21 16:44             ` Aurelien Jarno
2011-02-21 17:52               ` 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=20110209183526.GA3131@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=christophe.lyon@st.com \
    --cc=peter.maydell@linaro.org \
    --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.