[Qemu-devel] [PATCH v1 06/14] softfloat: add float32_is_denormal and float64_is_denormal

Emilio G. Cota posted 14 patches 7 years, 7 months ago
[Qemu-devel] [PATCH v1 06/14] softfloat: add float32_is_denormal and float64_is_denormal
Posted by Emilio G. Cota 7 years, 7 months ago
This paves the way for upcoming work.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 include/fpu/softfloat.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 7b9d31c..8fb44a8 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -417,6 +417,11 @@ static inline int float32_is_zero_or_denormal(float32 a)
     return (float32_val(a) & 0x7f800000) == 0;
 }
 
+static inline bool float32_is_denormal(float32 a)
+{
+    return float32_is_zero_or_denormal(a) && !float32_is_zero(a);
+}
+
 static inline float32 float32_set_sign(float32 a, int sign)
 {
     return make_float32((float32_val(a) & 0x7fffffff) | (sign << 31));
@@ -551,6 +556,11 @@ static inline int float64_is_zero_or_denormal(float64 a)
     return (float64_val(a) & 0x7ff0000000000000LL) == 0;
 }
 
+static inline bool float64_is_denormal(float64 a)
+{
+    return float64_is_zero_or_denormal(a) && !float64_is_zero(a);
+}
+
 static inline float64 float64_set_sign(float64 a, int sign)
 {
     return make_float64((float64_val(a) & 0x7fffffffffffffffULL)
-- 
2.7.4


Re: [Qemu-devel] [PATCH v1 06/14] softfloat: add float32_is_denormal and float64_is_denormal
Posted by Alex Bennée 7 years, 7 months ago
Emilio G. Cota <cota@braap.org> writes:

> This paves the way for upcoming work.
>
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  include/fpu/softfloat.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
> index 7b9d31c..8fb44a8 100644
> --- a/include/fpu/softfloat.h
> +++ b/include/fpu/softfloat.h
> @@ -417,6 +417,11 @@ static inline int float32_is_zero_or_denormal(float32 a)
>      return (float32_val(a) & 0x7f800000) == 0;
>  }
>
> +static inline bool float32_is_denormal(float32 a)
> +{
> +    return float32_is_zero_or_denormal(a) && !float32_is_zero(a);
> +}
> +
>  static inline float32 float32_set_sign(float32 a, int sign)
>  {
>      return make_float32((float32_val(a) & 0x7fffffff) | (sign << 31));
> @@ -551,6 +556,11 @@ static inline int float64_is_zero_or_denormal(float64 a)
>      return (float64_val(a) & 0x7ff0000000000000LL) == 0;
>  }
>
> +static inline bool float64_is_denormal(float64 a)
> +{
> +    return float64_is_zero_or_denormal(a) && !float64_is_zero(a);
> +}
> +
>  static inline float64 float64_set_sign(float64 a, int sign)
>  {
>      return make_float64((float64_val(a) & 0x7fffffffffffffffULL)


--
Alex Bennée

Re: [Qemu-devel] [PATCH v1 05/14] softfloat: add float32_is_normal and float64_is_normal
Posted by Emilio G. Cota 7 years, 7 months ago
On Tue, Mar 27, 2018 at 12:34:57 +0100, Alex Bennée wrote:
> 
> Emilio G. Cota <cota@braap.org> writes:
> 
> > This paves the way for upcoming work.
> >
> > Signed-off-by: Emilio G. Cota <cota@braap.org>
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

(snip)
On Tue, Mar 27, 2018 at 12:35:07 +0100, Alex Bennée wrote:
> 
> Emilio G. Cota <cota@braap.org> writes:
> 
> > This paves the way for upcoming work.
> >
> > Signed-off-by: Emilio G. Cota <cota@braap.org>
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

In v2 I merged these two into the same commit, so I've added your
R-b tag to the corresponding commit in v3.

Thanks,

		Emilio