diff options
Diffstat (limited to 'math')
-rw-r--r-- | math/Makefile | 4 | ||||
-rw-r--r-- | math/Versions | 1 | ||||
-rw-r--r-- | math/libm-test.inc | 32 | ||||
-rw-r--r-- | math/math.h | 2 | ||||
-rw-r--r-- | math/s_iscanonicall.c | 1 |
5 files changed, 35 insertions, 5 deletions
diff --git a/math/Makefile b/math/Makefile index 7ccd59a1ee..d2b4fd1153 100644 --- a/math/Makefile +++ b/math/Makefile @@ -27,7 +27,7 @@ headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \ fpu_control.h complex.h bits/cmathcalls.h fenv.h \ bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \ bits/math-finite.h bits/math-vector.h \ - bits/libm-simd-decl-stubs.h + bits/libm-simd-decl-stubs.h bits/iscanonical.h # FPU support code. aux := setfpucw fpu_control @@ -94,7 +94,7 @@ types = $(type-ldouble-$(long-double-fcts)) double float # long double support type-ldouble-suffix := l -type-ldouble-routines := t_sincosl k_sincosl +type-ldouble-routines := t_sincosl k_sincosl s_iscanonicall type-ldouble-yes := ldouble # double support diff --git a/math/Versions b/math/Versions index a429221340..f702051451 100644 --- a/math/Versions +++ b/math/Versions @@ -216,5 +216,6 @@ libm { } GLIBC_2.25 { fesetexcept; fetestexceptflag; fegetmode; fesetmode; + __iscanonicall; } } diff --git a/math/libm-test.inc b/math/libm-test.inc index 872bafd9c7..cbc7226aea 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -46,9 +46,9 @@ cbrt, ceil, copysign, cos, cosh, drem, erf, erfc, exp, exp10, exp2, expm1, fabs, fdim, finite, floor, fma, fmax, fmin, fmod, fpclassify, frexp, gamma, hypot, - ilogb, isfinite, isinf, isnan, isnormal, issignaling, issubnormal, iszero, - isless, islessequal, isgreater, isgreaterequal, islessgreater, isunordered, - j0, j1, jn, + ilogb, iscanonical, isfinite, isinf, isnan, isnormal, issignaling, + issubnormal, iszero, isless, islessequal, isgreater, + isgreaterequal, islessgreater, isunordered, j0, j1, jn, ldexp, lgamma, log, log10, log1p, log2, logb, modf, nearbyint, nextafter, nexttoward, pow, pow10, remainder, remquo, rint, lrint, llrint, @@ -8160,6 +8160,31 @@ ilogb_test (void) ALL_RM_TEST (ilogb, 1, ilogb_test_data, RUN_TEST_LOOP_f_i, END); } +static const struct test_f_i_data iscanonical_test_data[] = + { + TEST_f_b (iscanonical, 0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, 10, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, -min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, min_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, -min_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, -max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_b (iscanonical, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + }; + +static void +iscanonical_test (void) +{ + ALL_RM_TEST (iscanonical, 1, iscanonical_test_data, RUN_TEST_LOOP_f_b_tg, END); +} + static const struct test_f_i_data isfinite_test_data[] = { TEST_f_b (isfinite, 0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -12713,6 +12738,7 @@ main (int argc, char **argv) /* Classification macros: */ finite_test (); fpclassify_test (); + iscanonical_test (); isfinite_test (); isinf_test (); isnan_test (); diff --git a/math/math.h b/math/math.h index 1382baa75a..8cd641688d 100644 --- a/math/math.h +++ b/math/math.h @@ -317,6 +317,8 @@ enum #endif /* Use ISO C99. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) +# include <bits/iscanonical.h> + /* Return nonzero value if X is a signaling NaN. */ # ifdef __NO_LONG_DOUBLE_MATH # define issignaling(x) \ diff --git a/math/s_iscanonicall.c b/math/s_iscanonicall.c new file mode 100644 index 0000000000..b5fd996ffe --- /dev/null +++ b/math/s_iscanonicall.c @@ -0,0 +1 @@ +/* Not needed by default. */ |