From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu3yX-0001Y4-59 for qemu-devel@nongnu.org; Fri, 20 Dec 2013 12:35:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vu3yO-00015V-TW for qemu-devel@nongnu.org; Fri, 20 Dec 2013 12:35:01 -0500 Received: from mail-qe0-x22c.google.com ([2607:f8b0:400d:c02::22c]:37191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu3yO-00015G-PI for qemu-devel@nongnu.org; Fri, 20 Dec 2013 12:34:52 -0500 Received: by mail-qe0-f44.google.com with SMTP id nd7so2624852qeb.17 for ; Fri, 20 Dec 2013 09:34:51 -0800 (PST) Sender: Richard Henderson Message-ID: <52B47FB7.2030409@twiddle.net> Date: Fri, 20 Dec 2013 09:34:47 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1387490251-15944-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1387490251-15944-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] softfloat: Fix factor 2 error for scalbn on denormal inputs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Tom Musta , patches@linaro.org On 12/19/2013 01:57 PM, Peter Maydell wrote: > If the input to float*_scalbn() is denormal then it represents > a number 0.[mantissabits] * 2^(1-exponentbias) (and the actual > exponent field is all zeroes). This means that when we convert > it to our unpacked encoding the unpacked exponent must be one > greater than for a normal number, which represents > 1.[mantissabits] * 2^(e-exponentbias) for an exponent field e. > > This meant we were giving answers too small by a factor of 2 for > all denormal inputs. > > Note that the float-to-int routines also have this behaviour > of not adjusting the exponent for denormals; however there it is > harmless because denormals will all convert to integer zero anyway. > > Signed-off-by: Peter Maydell > --- At least the float128 routine needs the same fix. I'm less certain about the floatx80 routine, since IIRC that format has no implicit 1 bit -- it's always explicit. r~