[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 02/19] include/fpu/softfloat: implement float
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v1 02/19] include/fpu/softfloat: implement float16_abs helper |
Date: |
Fri, 15 Dec 2017 08:35:52 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
On 12/11/2017 09:56 AM, Alex Bennée wrote:
> This will be required when expanding the MINMAX() macro for 16
> bit/half-precision operations.
>
> Signed-off-by: Alex Bennée <address@hidden>
> Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> include/fpu/softfloat.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
> index d5e99667b6..edf402d422 100644
> --- a/include/fpu/softfloat.h
> +++ b/include/fpu/softfloat.h
> @@ -374,6 +374,13 @@ static inline int float16_is_zero_or_denormal(float16 a)
> return (float16_val(a) & 0x7c00) == 0;
> }
>
> +static inline float16 float16_abs(float16 a)
> +{
> + /* Note that abs does *not* handle NaN specially, nor does
> + * it flush denormal inputs to zero.
> + */
> + return make_float16(float16_val(a) & 0x7fff);
> +}
>
> /*----------------------------------------------------------------------------
> | The pattern for a default generated half-precision NaN.
>
> *----------------------------------------------------------------------------*/
>
- [Qemu-devel] [PATCH v1 00/19] re-factor softfloat and add fp16 functions, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 02/19] include/fpu/softfloat: implement float16_abs helper, Alex Bennée, 2017/12/11
- Re: [Qemu-devel] [PATCH v1 02/19] include/fpu/softfloat: implement float16_abs helper,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v1 03/19] include/fpu/softfloat: implement float16_chs helper, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 01/19] fpu/softfloat: implement float16_squash_input_denormal, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 05/19] include/fpu/softfloat: add some float16 contants, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 06/19] fpu/softfloat: propagate signalling NaNs in MINMAX, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 04/19] include/fpu/softfloat: implement float16_set_sign helper, Alex Bennée, 2017/12/11