From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCUq4-000526-Vx for qemu-devel@nongnu.org; Wed, 20 Apr 2011 06:40:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCUq4-0000Kh-0K for qemu-devel@nongnu.org; Wed, 20 Apr 2011 06:40:52 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:61387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCUq3-0000KX-UO for qemu-devel@nongnu.org; Wed, 20 Apr 2011 06:40:51 -0400 Received: by vxb41 with SMTP id 41so473249vxb.4 for ; Wed, 20 Apr 2011 03:40:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1303294329-22634-8-git-send-email-aurelien@aurel32.net> References: <1303294329-22634-1-git-send-email-aurelien@aurel32.net> <1303294329-22634-8-git-send-email-aurelien@aurel32.net> Date: Wed, 20 Apr 2011 11:40: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 07/20] softfloat: fix float*_scalnb() corner cases 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: > float*_scalnb() were not taking into account all cases. This patch fixes > some corner cases: > - NaN values in input were not properly propagated and the invalid flag > =C2=A0not correctly raised. Use propagateFloat*NaN() for that. > - NaN or infinite values in input of floatx80_scalnb() were not correctly > =C2=A0detected due to a typo. > - The sum of exponent and n could overflow, leading to strange results. > =C2=A0Additionally having int16 defined to int make that happening for a = very > =C2=A0small range of values. Fix that by saturating n to the maximum expo= nent > =C2=A0range, and using an explicit wider type if needed. > > Signed-off-by: Aurelien Jarno > --- > =C2=A0fpu/softfloat.c | =C2=A0 47 +++++++++++++++++++++++++++++++++++++++= +++----- > =C2=A01 files changed, 42 insertions(+), 5 deletions(-) > > v1 -> v2: fix condition for float32 Reviewed-by: Peter Maydell -- PMM