qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 22/22] fpu/softfloat: re-factor sqrt


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v4 22/22] fpu/softfloat: re-factor sqrt
Date: Tue, 13 Feb 2018 16:34:24 +0000

On 13 February 2018 at 16:23, Richard Henderson
<address@hidden> wrote:
> On 02/13/2018 07:50 AM, Peter Maydell wrote:
>>> +    /* We need two overflow bits at the top.  Adding room for that is
>>> +       a right shift.  If the exponent is odd, we can discard the low
>>> +       bit by multiplying the fraction by 2; that's a left shift.
>>> +       Combine those and we shift right if the exponent is even.  */
>>> +    a_frac = a.frac;
>>> +    if (!(a.exp & 1)) {
>>> +        a_frac >>= 1;
>>> +    }
>>> +    a.exp >>= 1;
>> Comment says "shift right if the exponent is even", but code
>> says "shift right by 1 if exponent is odd, by 2 if exponent is even".
>>
>
> The last line is dividing the exponent by 2, not shifting the fraction.

Doh, so it is.

-- PMM



reply via email to

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