[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/7] softfloat: Add float16_is_normal
From: |
Richard Henderson |
Subject: |
[PULL 3/7] softfloat: Add float16_is_normal |
Date: |
Sat, 29 Aug 2020 19:31:59 -0700 |
From: Stephen Long <steplong@quicinc.com>
This float16 predicate was missing from the normal set.
Signed-off-by: Stephen Long <steplong@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/fpu/softfloat.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 0a5a5e5d0b..863dfc6151 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -272,6 +272,11 @@ static inline bool float16_is_zero_or_denormal(float16 a)
return (float16_val(a) & 0x7c00) == 0;
}
+static inline bool float16_is_normal(float16 a)
+{
+ return (((float16_val(a) >> 10) + 1) & 0x1f) >= 2;
+}
+
static inline float16 float16_abs(float16 a)
{
/* Note that abs does *not* handle NaN specially, nor does
--
2.25.1
- [PULL 0/7] softfloat patch queue, Richard Henderson, 2020/08/29
- [PULL 1/7] softfloat: Implement the full set of comparisons for float16, Richard Henderson, 2020/08/29
- [PULL 2/7] softfloat: Add fp16 and uint8/int8 conversion functions, Richard Henderson, 2020/08/29
- [PULL 3/7] softfloat: Add float16_is_normal,
Richard Henderson <=
- [PULL 4/7] softfloat: Define operations for bfloat16, Richard Henderson, 2020/08/29
- [PULL 6/7] softfloat: Define misc operations for bfloat16, Richard Henderson, 2020/08/29
- [PULL 5/7] softfloat: Define convert operations for bfloat16, Richard Henderson, 2020/08/29
- [PULL 7/7] softfloat: Define comparison operations for bfloat16, Richard Henderson, 2020/08/29
- Re: [PULL 0/7] softfloat patch queue, Peter Maydell, 2020/08/31