From 213ff4e6df0f74e93995a5d3d7429acb4ad3ee86 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Wed, 19 Sep 2012 04:23:51 +0400 Subject: softfloat: add NO_SIGNALING_NANS Architectures that don't have signaling NaNs can define NO_SIGNALING_NANS, it will make float*_is_quiet_nan return 1 for any NaN and float*_is_signaling_nan always return 0. Signed-off-by: Max Filippov Signed-off-by: Blue Swirl --- fpu/softfloat.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fpu/softfloat.h') diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 2860ca0175..d8999b311a 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -251,6 +251,11 @@ int float16_is_quiet_nan( float16 ); int float16_is_signaling_nan( float16 ); float16 float16_maybe_silence_nan( float16 ); +INLINE int float16_is_any_nan(float16 a) +{ + return ((float16_val(a) & ~0x8000) > 0x7c00); +} + /*---------------------------------------------------------------------------- | The pattern for a default generated half-precision NaN. *----------------------------------------------------------------------------*/ -- cgit v1.2.3-55-g7522