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: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v4 22/22] fpu/softfloat: re-factor sqrt
Date: Tue, 13 Feb 2018 08:23:01 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

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.


r~



reply via email to

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