qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 05/14] softfloat: add float32_is_normal and f


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH v1 05/14] softfloat: add float32_is_normal and float64_is_normal
Date: Tue, 27 Mar 2018 12:34:57 +0100
User-agent: mu4e 1.1.0; emacs 26.0.91

Emilio G. Cota <address@hidden> writes:

> This paves the way for upcoming work.
>
> Signed-off-by: Emilio G. Cota <address@hidden>

Reviewed-by: Alex Bennée <address@hidden>

> ---
>  include/fpu/softfloat.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
> index 36626a5..7b9d31c 100644
> --- a/include/fpu/softfloat.h
> +++ b/include/fpu/softfloat.h
> @@ -402,6 +402,11 @@ static inline int float32_is_zero(float32 a)
>      return (float32_val(a) & 0x7fffffff) == 0;
>  }
>
> +static inline bool float32_is_normal(float32 a)
> +{
> +    return ((float32_val(a) + 0x00800000) & 0x7fffffff) >= 0x01000000;
> +}
> +
>  static inline int float32_is_any_nan(float32 a)
>  {
>      return ((float32_val(a) & ~(1 << 31)) > 0x7f800000UL);
> @@ -531,6 +536,11 @@ static inline int float64_is_zero(float64 a)
>      return (float64_val(a) & 0x7fffffffffffffffLL) == 0;
>  }
>
> +static inline bool float64_is_normal(float64 a)
> +{
> +    return ((float64_val(a) + (1ULL << 52)) & -1ULL >> 1) >= 1ULL << 53;
> +}
> +
>  static inline int float64_is_any_nan(float64 a)
>  {
>      return ((float64_val(a) & ~(1ULL << 63)) > 0x7ff0000000000000ULL);


--
Alex Bennée



reply via email to

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