qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/8] softfloat: use bits32 instead of uint32


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 2/8] softfloat: use bits32 instead of uint32
Date: Tue, 4 Jan 2011 16:34:09 +0000

On 4 January 2011 16:11, Aurelien Jarno <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]