diff options
Diffstat (limited to 'math')
-rw-r--r-- | math/libm-test.inc | 2 | ||||
-rw-r--r-- | math/math.h | 9 | ||||
-rw-r--r-- | math/test-double.h | 1 | ||||
-rw-r--r-- | math/test-float.h | 1 | ||||
-rw-r--r-- | math/test-ldouble.h | 1 |
5 files changed, 14 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 7106338..88420ee 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -8901,6 +8901,8 @@ static const struct test_f_i_data issignaling_test_data[] = TEST_f_b (issignaling, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_b (issignaling, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_b (issignaling, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (issignaling, snan_value_MACRO, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (issignaling, -snan_value_MACRO, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), }; static void diff --git a/math/math.h b/math/math.h index 7c0c709..70d9b86 100644 --- a/math/math.h +++ b/math/math.h @@ -45,6 +45,15 @@ __BEGIN_DECLS # include <bits/nan.h> #endif /* __USE_ISOC99 */ +#if __GLIBC_USE (IEC_60559_BFP_EXT) +/* Signaling NaN macros, if supported. */ +# if __GNUC_PREREQ (3, 3) +# define SNANF (__builtin_nansf ("")) +# define SNAN (__builtin_nans ("")) +# define SNANL (__builtin_nansl ("")) +# endif +#endif + /* Get the architecture specific values describing the floating-point evaluation. The following symbols will get defined: diff --git a/math/test-double.h b/math/test-double.h index b9e8cd8..e172b8f 100644 --- a/math/test-double.h +++ b/math/test-double.h @@ -27,3 +27,4 @@ #define TYPE_STR "double" #define LITM(x) x #define FTOSTR snprintf +#define snan_value_MACRO SNAN diff --git a/math/test-float.h b/math/test-float.h index e783c09..ea096c8 100644 --- a/math/test-float.h +++ b/math/test-float.h @@ -28,3 +28,4 @@ /* Use the double variants of macro constants. */ #define LITM(x) x #define FTOSTR snprintf +#define snan_value_MACRO SNANF diff --git a/math/test-ldouble.h b/math/test-ldouble.h index b877711..62c9eb8 100644 --- a/math/test-ldouble.h +++ b/math/test-ldouble.h @@ -27,3 +27,4 @@ #define LIT(x) (x ## L) #define LITM(x) x ## l #define FTOSTR snprintf +#define snan_value_MACRO SNANL |