softfloat: add float{32,64}_is_zero_or_normal

These will gain some users very soon.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Emilio G. Cota 2018-03-28 20:29:55 -04:00 committed by Alex Bennée
parent f9943c7f76
commit 315df0d193
1 changed files with 10 additions and 0 deletions

View File

@ -474,6 +474,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));
@ -625,6 +630,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)