From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCUlF-0002kk-A1 for qemu-devel@nongnu.org; Wed, 20 Apr 2011 06:35:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCUlE-00080s-Eo for qemu-devel@nongnu.org; Wed, 20 Apr 2011 06:35:53 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:33940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCUlE-00080l-Cd for qemu-devel@nongnu.org; Wed, 20 Apr 2011 06:35:52 -0400 Received: by vxb41 with SMTP id 41so470737vxb.4 for ; Wed, 20 Apr 2011 03:35:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1303294329-22634-2-git-send-email-aurelien@aurel32.net> References: <1303294329-22634-1-git-send-email-aurelien@aurel32.net> <1303294329-22634-2-git-send-email-aurelien@aurel32.net> Date: Wed, 20 Apr 2011 11:35:51 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 01/20] softfloat: fix floatx80 handling of NaN List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 20 April 2011 11:11, Aurelien Jarno wrote: > @@ -624,10 +630,11 @@ static floatx80 commonNaNToFloatx80( commonNaNT a S= TATUS_PARAM) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 return z; > =C2=A0 =C2=A0 } > > - =C2=A0 =C2=A0if (a.high) > - =C2=A0 =C2=A0 =C2=A0 =C2=A0z.low =3D a.high; > - =C2=A0 =C2=A0else > + =C2=A0 =C2=A0if (a.high >> 1) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0z.low =3D LIT64( 0x8000000000000000 ) | a.hi= gh >> 1; > + =C2=A0 =C2=A0} else { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 z.low =3D floatx80_default_nan_low; > + =C2=A0 =C2=A0} > =C2=A0 =C2=A0 z.high =3D ( ( (uint16_t) a.sign )<<15 ) | 0x7FFF; > =C2=A0 =C2=A0 return z; > =C2=A0} This is still retaining the sign bit from the input if it generates a default NaN because the mantissa would have been zero. This isn't consistent with the commonNaNToFloat64/32, which just return the float64/32_default_nan with whatever sign it has. -- PMM