[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
- [Qemu-devel] [PATCH v4 10/22] fpu/softfloat: move the extract functions to the top of the file, (continued)
- [Qemu-devel] [PATCH v4 10/22] fpu/softfloat: move the extract functions to the top of the file, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 09/22] fpu/softfloat: improve comments on ARM NaN propagation, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 07/22] include/fpu/softfloat: implement float16_set_sign helper, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 14/22] fpu/softfloat: re-factor div, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 16/22] fpu/softfloat: re-factor round_to_int, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 22/22] fpu/softfloat: re-factor sqrt, Alex Bennée, 2018/02/06
- Re: [Qemu-devel] [PATCH v4 22/22] fpu/softfloat: re-factor sqrt, Richard Henderson, 2018/02/13
[Qemu-devel] [PATCH v4 20/22] fpu/softfloat: re-factor minmax, Alex Bennée, 2018/02/06
[Qemu-devel] [PATCH v4 19/22] fpu/softfloat: re-factor scalbn, Alex Bennée, 2018/02/06
[Qemu-devel] [PATCH v4 21/22] fpu/softfloat: re-factor compare, Alex Bennée, 2018/02/06
[Qemu-devel] [PATCH v4 11/22] fpu/softfloat: define decompose structures, Alex Bennée, 2018/02/06
[Qemu-devel] [PATCH v4 18/22] fpu/softfloat: re-factor int/uint to float, Alex Bennée, 2018/02/06
[Qemu-devel] [PATCH v4 13/22] fpu/softfloat: re-factor mul, Alex Bennée, 2018/02/06