qemu-devel
[Top][All Lists]
Advanced

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

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


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v4 14/22] fpu/softfloat: re-factor div
Date: Tue, 13 Feb 2018 15:22:20 +0000

On 6 February 2018 at 16:48, Alex Bennée <address@hidden> wrote:
> We can now add float16_div and use the common decompose and
> canonicalize functions to have a single implementation for
> float16/32/64 versions.
>
> Signed-off-by: Alex Bennée <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>

> +static FloatParts div_floats(FloatParts a, FloatParts b, float_status *s)
> +{
> +    bool sign = a.sign ^ b.sign;
> +
> +    if (a.cls == float_class_normal && b.cls == float_class_normal) {
> +        uint64_t temp_lo, temp_hi;
> +        int exp = a.exp - b.exp;
> +        if (a.frac < b.frac) {
> +            exp -= 1;
> +            shortShift128Left(0, a.frac, DECOMPOSED_BINARY_POINT + 1,
> +                              &temp_hi, &temp_lo);
> +        } else {
> +            shortShift128Left(0, a.frac, DECOMPOSED_BINARY_POINT,
> +                              &temp_hi, &temp_lo);
> +        }
> +        /* LSB of quot is set if inexact which roundandpack will use
> +         * to set flags. Yet again we re-use a for the result */
> +        a.frac = div128To64(temp_lo, temp_hi, b.frac);

...and this is even worse as a cost increase for the float32
and float16 cases. Still:

Reviewed-by: Peter Maydell <address@hidden>

thanks
-- PMM



reply via email to

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