[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
- [Qemu-devel] [PATCH v4 03/22] fpu/softfloat-types: new header to prevent excessive re-builds, (continued)
- [Qemu-devel] [PATCH v4 03/22] fpu/softfloat-types: new header to prevent excessive re-builds, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 06/22] include/fpu/softfloat: implement float16_chs helper, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 05/22] include/fpu/softfloat: implement float16_abs helper, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 02/22] include/fpu/softfloat: remove USE_SOFTFLOAT_STRUCT_TYPES, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 04/22] target/*/cpu.h: remove softfloat.h, Alex Bennée, 2018/02/06
- [Qemu-devel] [PATCH v4 08/22] include/fpu/softfloat: add some float16 constants, Alex Bennée, 2018/02/06
- [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
- Re: [Qemu-devel] [PATCH v4 14/22] fpu/softfloat: re-factor div,
Peter Maydell <=
- [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