From 5d3ccde6258cffa31acadb8ea028db10b998e85c Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Wed, 19 Dec 2018 10:31:07 -0500 Subject: [PATCH] softfloat: add float{32,64}_is_zero_or_normal These will gain some users very soon. Backports commit 315df0d193929b167b9d7be4665d5f2c0e2427e0 from qemu --- qemu/include/fpu/softfloat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qemu/include/fpu/softfloat.h b/qemu/include/fpu/softfloat.h index bc021524..457247e2 100644 --- a/qemu/include/fpu/softfloat.h +++ b/qemu/include/fpu/softfloat.h @@ -479,6 +479,11 @@ static inline bool float32_is_denormal(float32 a) return float32_is_zero_or_denormal(a) && !float32_is_zero(a); } +static inline bool float32_is_zero_or_normal(float32 a) +{ + return float32_is_normal(a) || float32_is_zero(a); +} + static inline float32 float32_set_sign(float32 a, int sign) { return make_float32((float32_val(a) & 0x7fffffff) | (sign << 31)); @@ -631,6 +636,11 @@ static inline bool float64_is_denormal(float64 a) return float64_is_zero_or_denormal(a) && !float64_is_zero(a); } +static inline bool float64_is_zero_or_normal(float64 a) +{ + return float64_is_normal(a) || float64_is_zero(a); +} + static inline float64 float64_set_sign(float64 a, int sign) { return make_float64((float64_val(a) & 0x7fffffffffffffffULL)