aboutsummaryrefslogtreecommitdiff
path: root/fpu/softfloat.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-09-19 04:23:51 +0400
committerBlue Swirl <blauwirbel@gmail.com>2012-09-22 17:59:12 +0000
commit213ff4e6df0f74e93995a5d3d7429acb4ad3ee86 (patch)
tree24f94b22f625d5789547a9917a1a84881f55c992 /fpu/softfloat.h
parent66176802960ad1f7c3d061d17b784088c2e28d59 (diff)
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 <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'fpu/softfloat.h')
-rw-r--r--fpu/softfloat.h5
1 files changed, 5 insertions, 0 deletions
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.
*----------------------------------------------------------------------------*/