[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 4/7] softfloat: define floatx80_round()
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v2 4/7] softfloat: define floatx80_round() |
Date: |
Tue, 27 Jun 2017 17:13:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
Aurélien or Peter, could you ACK this one?
Thanks,
Laurent
Le 27/06/2017 à 00:03, Laurent Vivier a écrit :
> Add a function to round a floatx80 to the defined precision
> (floatx80_rounding_precision)
>
> Signed-off-by: Laurent Vivier <address@hidden>
> Reviewed-by: Richard Henderson <address@hidden>
> ---
> fpu/softfloat.c | 15 +++++++++++++++
> include/fpu/softfloat.h | 1 +
> 2 files changed, 16 insertions(+)
>
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index 7af14e2..e9bf359 100644
> --- a/fpu/softfloat.c
> +++ b/fpu/softfloat.c
> @@ -5086,6 +5086,21 @@ float128 floatx80_to_float128(floatx80 a, float_status
> *status)
> }
>
>
> /*----------------------------------------------------------------------------
> +| Rounds the extended double-precision floating-point value `a'
> +| and returns the result as an extended double-precision floating-point
> +| value. The operation is performed according to the IEC/IEEE Standard for
> +| Binary Floating-Point Arithmetic.
> +*----------------------------------------------------------------------------*/
> +
> +floatx80 floatx80_round(floatx80 a, float_status *status)
> +{
> + return roundAndPackFloatx80(status->floatx80_rounding_precision,
> + extractFloatx80Sign(a),
> + extractFloatx80Exp(a),
> + extractFloatx80Frac(a), 0, status);
> +}
> +
> +/*----------------------------------------------------------------------------
> | Rounds the extended double-precision floating-point value `a' to an
> integer,
> | and returns the result as an extended quadruple-precision floating-point
> | value. The operation is performed according to the IEC/IEEE Standard for
> diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
> index f1288ef..d9689ec 100644
> --- a/include/fpu/softfloat.h
> +++ b/include/fpu/softfloat.h
> @@ -621,6 +621,7 @@ float128 floatx80_to_float128(floatx80, float_status
> *status);
>
> /*----------------------------------------------------------------------------
> | Software IEC/IEEE extended double-precision operations.
>
> *----------------------------------------------------------------------------*/
> +floatx80 floatx80_round(floatx80 a, float_status *status);
> floatx80 floatx80_round_to_int(floatx80, float_status *status);
> floatx80 floatx80_add(floatx80, floatx80, float_status *status);
> floatx80 floatx80_sub(floatx80, floatx80, float_status *status);
>
- [Qemu-devel] [PATCH v2 0/7] target/m68k: implement 680x0 FPU (part 2), Laurent Vivier, 2017/06/26
- [Qemu-devel] [PATCH v2 2/7] target/m68k: add fmovecr, Laurent Vivier, 2017/06/26
- [Qemu-devel] [PATCH v2 1/7] target/m68k: add fscc., Laurent Vivier, 2017/06/26
- [Qemu-devel] [PATCH v2 6/7] target/m68k: add explicit single and double precision operations (part 2), Laurent Vivier, 2017/06/26
- [Qemu-devel] [PATCH v2 3/7] target/m68k: add explicit single and double precision operations, Laurent Vivier, 2017/06/26
- [Qemu-devel] [PATCH v2 4/7] softfloat: define floatx80_round(), Laurent Vivier, 2017/06/26
- Re: [Qemu-devel] [PATCH v2 4/7] softfloat: define floatx80_round(),
Laurent Vivier <=
- [Qemu-devel] [PATCH v2 7/7] target/m68k: add fmovem, Laurent Vivier, 2017/06/26
- [Qemu-devel] [PATCH v2 5/7] target/m68k: add fsglmul and fsgldiv, Laurent Vivier, 2017/06/26