qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 2/8] softfloat: use bits32 instead of uint32
Date: Tue, 4 Jan 2011 16:34:09 +0000	[thread overview]
Message-ID: <AANLkTimqWbv2pWnn3kvkmjawV9xqW3S3+igr5YJcuuma@mail.gmail.com> (raw)
In-Reply-To: <20110104161134.GA15256@volta.aurel32.net>

On 4 January 2011 16:11, Aurelien Jarno <aurelien@aurel32.net> wrote:
> On Tue, Jan 04, 2011 at 03:51:37PM +0000, Peter Maydell wrote:
>> >  int float32_is_quiet_nan( float32 a1 )
>> >  {
>> >     float32u u;
>> > -    uint64_t a;
>> > +    bits32 a;
>> >     u.f = a1;
>> >     a = u.i;
>> >     return ( 0xFF800000 < ( a<<1 ) );
>>
>> This change is actually changing the type: shouldn't it be bits64 ?
>
> Yes, I should have mentioned it in the changelog. For me this looks like
> a typo, as we are manipulating 32 bits values. Look at
> float32_is_signaling_nan().

Well, it does affect whether that left-shift of a loses the sign bit
or not. However having thought about it it doesn't make any
difference to the result of the comparison, so bits32 would be OK.

On the other hand, this should be a "<=" compare, not "<", I think.
0x7FC00000 is a valid QNaN but this function will return false for
it. Contrast the softfloat-specialize.h float32_is_quiet_nan()
implementation for !SNAN_BIT_IS_ONE, which does use <=.

(On the third hand if you're using softfloat-native then you
probably didn't care about the niceties of NaN usage :-))

-- PMM

  reply	other threads:[~2011-01-04 16:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 15:15 [Qemu-devel] (no subject) Aurelien Jarno
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 1/8] softfloat: remove HPPA specific code Aurelien Jarno
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 2/8] softfloat: use bits32 instead of uint32 Aurelien Jarno
2011-01-04 15:51   ` Peter Maydell
2011-01-04 16:11     ` Aurelien Jarno
2011-01-04 16:34       ` Peter Maydell [this message]
2011-01-04 19:23       ` Andreas Färber
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 3/8] softfloat: rename *IsNaN variables to *IsQuietNaN Aurelien Jarno
2011-01-04 16:01   ` Peter Maydell
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 4/8] softfloat: fix float{32, 64}_maybe_silence_nan() for MIPS Aurelien Jarno
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 5/8] softfloat: add float{x80, 128}_maybe_silence_nan() Aurelien Jarno
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 6/8] softfloat: use float{32, 64, x80, 128}_maybe_silence_nan() Aurelien Jarno
2011-01-04 16:03   ` Peter Maydell
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 7/8] target-mips: Implement correct NaN propagation rules Aurelien Jarno
2011-01-04 15:15 ` [Qemu-devel] [PATCH v2 8/8] target-ppc: " Aurelien Jarno
2011-01-04 15:38   ` Peter Maydell
2011-01-04 15:41     ` Aurelien Jarno
2011-01-04 16:06 ` [Qemu-devel] (no subject) Peter Maydell
2011-01-04 16:12   ` 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=AANLkTimqWbv2pWnn3kvkmjawV9xqW3S3+igr5YJcuuma@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=aurelien@aurel32.net \
    --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).