All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Christophe Lyon <christophe.lyon@st.com>
Cc: "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: Tue, 8 Feb 2011 18:53:21 +0000	[thread overview]
Message-ID: <AANLkTi=uDtGamByjJ3ZA0uMHU446N3=01bTPrgXmeLTM@mail.gmail.com> (raw)
In-Reply-To: <4D5182BF.9050002@st.com>

On 8 February 2011 17:51, Christophe Lyon <christophe.lyon@st.com> wrote:
> On 08.02.2011 16:59, Peter Maydell wrote:
>> This is float32_to_float16() but it looks like you've missed
>> float16_to_float32() ?
>
> Well, actually I somewhat managed to persuade myself that it was not necessary to patch float16_to_float32(), but looking at it again it seems there are more bugs in that function:
> - the ieee parameter shouldn't be used (my ARM ARM does not mention a different behaviour when AH bit is set)

In the ARM ARM pseudocode, FPUnpack() of a 16 bit value looks
at the FPSCR AH bit, so float16_to_float32() does need to depend
on the ieee flag.

> - it calls float32ToCommonNaN(a) where 'a' is a float16 instead of a float32

It's only doing that to raise the exception, but you're right that
it ought to do things properly...

> - this means implementing float16ToCommonNaN, thus float16_is_signaling_nan()

...like that, yes.

I'm just working through a set of bugs in float32_to_float16
and float16_to_float32 where they generally mishandle
various things.

I have also just noticed this error in your patch:

+static bits16 commonNaNToFloat16( commonNaNT a STATUS_PARAM)
+{
+    bits16 mantissa = a.high>>57;

That should be ">> 54". (We're shifting a mantissa which is
in a 64 bit value down so that the top bits of it end up in
the bottom 10 bits (corresponding to the size of mantissa
on a float16); so we want to shift by 64-10 == 54.)

-- PMM

  reply	other threads:[~2011-02-08 18:53 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 [this message]
2011-02-08 20:06       ` Peter Maydell
2011-02-09 18:35         ` Aurelien Jarno
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='AANLkTi=uDtGamByjJ3ZA0uMHU446N3=01bTPrgXmeLTM@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=christophe.lyon@st.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 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.