qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] softfloat: Fix factor 2 error for scalbn on den


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] softfloat: Fix factor 2 error for scalbn on denormal inputs
Date: Fri, 20 Dec 2013 09:34:47 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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 <address@hidden>
> ---

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~



reply via email to

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