提交 6f3300ad 编写于 作者: P Peter Maydell 提交者: Aurelien Jarno

softfloat: Add float32_is_zero_or_denormal() function

Add a utility function to softfloat to test whether a float32
is zero or denormal.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NAurelien Jarno <aurelien@aurel32.net>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 3bd4be3a
......@@ -336,6 +336,11 @@ INLINE int float32_is_any_nan(float32 a)
return ((float32_val(a) & ~(1 << 31)) > 0x7f800000UL);
}
INLINE int float32_is_zero_or_denormal(float32 a)
{
return (float32_val(a) & 0x7f800000) == 0;
}
#define float32_zero make_float32(0)
#define float32_one make_float32(0x3f800000)
#define float32_ln2 make_float32(0x3f317218)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册