qemu-devel.nongnu.org archive mirror
 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 15:59:46 +0000	[thread overview]
Message-ID: <AANLkTim_TSvJVnyHFzmOiu52bmMu3_d=4Uz690S15o=1@mail.gmail.com> (raw)
In-Reply-To: <4D50252A.2000100@st.com>

On 7 February 2011 17:00, Christophe Lyon <christophe.lyon@st.com> wrote:
>
> Some CPUs have a status flag imposing to return floatxx_default_nan
> whatever the input value, when converting from one FP format to
> another. Implement this, using the already existing default_nan_mode
> status flag (currently used on ARM and SH4 at the moment).
>
> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

Your subject is a bit long, which can make it wrap annoyingly in git logs.
I'd suggest something like:

===begin===
softfloat: Honour default_nan_mode for float-to-float conversions

Honour the default_nan_mode flag when doing conversions between
different floating point formats, as well as when returning a NaN from
a two-operand floating point function. This corrects the behaviour
of float<->double conversions on both ARM and SH4.
===endit===

> +/*----------------------------------------------------------------------------
> +| The pattern for a default generated haft-precision NaN.
> +*----------------------------------------------------------------------------*/

"half-precision".

> @@ -2767,11 +2767,7 @@ bits16 float32_to_float16( float32 a, flag ieee STATUS_PARAM)
>     aExp = extractFloat32Exp( a );
>     aSign = extractFloat32Sign( a );
>     if ( aExp == 0xFF ) {
> -        if (aSig) {
> -            /* Make sure correct exceptions are raised.  */
> -            float32ToCommonNaN(a STATUS_VAR);
> -            aSig |= 0x00400000;
> -        }
> +        if ( aSig ) return commonNaNToFloat16( float32ToCommonNaN( a STATUS_VAR ) STATUS_VAR );
>         return packFloat16(aSign, 0x1f, aSig >> 13);
>     }
>     if (aExp == 0 && aSign == 0) {

This is float32_to_float16() but it looks like you've missed
float16_to_float32() ?

Otherwise, looks good, and I can confirm that it fixes
behaviour of VCVT.F32.F64 and VCVT.F64.F32 when
the FPSCR.DN bit is set.

-- PMM

  reply	other threads:[~2011-02-08 16:03 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 [this message]
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
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='AANLkTim_TSvJVnyHFzmOiu52bmMu3_d=4Uz690S15o=1@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 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).