From dd4259b9f76fa8fd3690a91608d2e3a94e2d6713 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 24 May 2013 20:33:14 +0000 Subject: [PATCH] Test drem and pow10 in libm-test.inc. --- ChangeLog | 10 +++++ math/libm-test.inc | 68 ++++++++++++++++++++++++++++--- sysdeps/i386/fpu/libm-test-ulps | 9 ++++ sysdeps/x86_64/fpu/libm-test-ulps | 26 ++++++++++++ 4 files changed, 108 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8594fdaaa8..bddd4d5698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2013-05-24 Joseph Myers + * math/libm-test.inc: Add drem and pow10 to list of tested + functions. + (pow10_test): New function. + (drem_test): Likewise. + (drem_test_tonearest): Likewise. + (drem_test_towardzero): Likewise. + (drem_test_downward): Likewise. + (drem_test_upward): Likewise. + (main): Call the new functions. + * math/libm-test.inc (finite_test_data): Remove. (finite_test): Run tests from isfinite_test_data. (gamma_test_data): Remove. diff --git a/math/libm-test.inc b/math/libm-test.inc index a03647afa4..91af668e94 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -39,7 +39,7 @@ /* This testsuite has currently tests for: acos, acosh, asin, asinh, atan, atan2, atanh, - cbrt, ceil, copysign, cos, cosh, erf, erfc, exp, exp10, exp2, expm1, + 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, @@ -47,7 +47,7 @@ j0, j1, jn, ldexp, lgamma, log, log10, log1p, log2, logb, modf, nearbyint, nextafter, nexttoward, - pow, remainder, remquo, rint, lrint, llrint, + pow, pow10, remainder, remquo, rint, lrint, llrint, round, lround, llround, scalb, scalbn, scalbln, signbit, sin, sincos, sinh, sqrt, tan, tanh, tgamma, trunc, y0, y1, yn, significand @@ -58,10 +58,8 @@ csin, csinh, csqrt, ctan, ctanh. At the moment the following functions and macros aren't tested: - drem (alias for remainder), lgamma_r, - nan, - pow10 (alias for exp10). + nan. Parameter handling is primitive in the moment: --verbose=[0..3] for different levels of output: @@ -7953,6 +7951,15 @@ exp10_test (void) END; } +static void +pow10_test (void) +{ + START (pow10); + /* pow10 uses the same test data as exp10. */ + RUN_TEST_LOOP_f_f (pow10, exp10_test_data, ); + END; +} + static const struct test_f_f_data exp2_test_data[] = { @@ -12173,6 +12180,15 @@ remainder_test (void) END; } +static void +drem_test (void) +{ + START (drem); + /* drem uses the same test data as remainder. */ + RUN_TEST_LOOP_ff_f (drem, remainder_test_data, ); + END; +} + static const struct test_ff_f_data remainder_tonearest_test_data[] = { @@ -12209,6 +12225,15 @@ remainder_test_tonearest (void) END; } +static void +drem_test_tonearest (void) +{ + START (drem_tonearest); + /* drem uses the same test data as remainder. */ + RUN_TEST_LOOP_ff_f (drem, remainder_tonearest_test_data, FE_TONEAREST); + END; +} + static const struct test_ff_f_data remainder_towardzero_test_data[] = { @@ -12245,6 +12270,15 @@ remainder_test_towardzero (void) END; } +static void +drem_test_towardzero (void) +{ + START (drem_towardzero); + /* drem uses the same test data as remainder. */ + RUN_TEST_LOOP_ff_f (drem, remainder_towardzero_test_data, FE_TOWARDZERO); + END; +} + static const struct test_ff_f_data remainder_downward_test_data[] = { @@ -12281,6 +12315,15 @@ remainder_test_downward (void) END; } +static void +drem_test_downward (void) +{ + START (drem_downward); + /* drem uses the same test data as remainder. */ + RUN_TEST_LOOP_ff_f (drem, remainder_downward_test_data, FE_DOWNWARD); + END; +} + static const struct test_ff_f_data remainder_upward_test_data[] = { @@ -12317,6 +12360,15 @@ remainder_test_upward (void) END; } +static void +drem_test_upward (void) +{ + START (drem_upward); + /* drem uses the same test data as remainder. */ + RUN_TEST_LOOP_ff_f (drem, remainder_upward_test_data, FE_UPWARD); + END; +} + static const struct test_ffI_f1_data remquo_test_data[] = { TEST_ffI_f1 (remquo, 1, 0, qnan_value, IGNORE, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION), @@ -14688,6 +14740,7 @@ main (int argc, char **argv) logb_test (); logb_test_downward (); modf_test (); + pow10_test (); ilogb_test (); scalb_test (); scalbn_test (); @@ -14737,6 +14790,11 @@ main (int argc, char **argv) trunc_test (); /* Remainder functions: */ + drem_test (); + drem_test_tonearest (); + drem_test_towardzero (); + drem_test_downward (); + drem_test_upward (); fmod_test (); remainder_test (); remainder_test_tonearest (); diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps index 1d0e130871..aff617c353 100644 --- a/sysdeps/i386/fpu/libm-test-ulps +++ b/sysdeps/i386/fpu/libm-test-ulps @@ -5674,6 +5674,11 @@ Test "pow (0x0.ffffffp0, -0x1p24)": ildouble: 1 ldouble: 1 +# pow10 +Test "pow10 (0.75)": +ildouble: 1 +ldouble: 1 + # pow_downward Test "pow_downward (1.0625, 1.125)": double: 1 @@ -7572,6 +7577,10 @@ Function: "pow": ildouble: 1 ldouble: 1 +Function: "pow10": +ildouble: 1 +ldouble: 1 + Function: "pow_downward": double: 1 float: 1 diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps index 0c73de4820..db46ae127b 100644 --- a/sysdeps/x86_64/fpu/libm-test-ulps +++ b/sysdeps/x86_64/fpu/libm-test-ulps @@ -6791,6 +6791,26 @@ Test "pow (0x1.000002p0, 0x1p24)": float: 1 ifloat: 1 +# pow10 +Test "pow10 (-1)": +double: 1 +idouble: 1 +Test "pow10 (-305)": +double: 1 +idouble: 1 +Test "pow10 (-36)": +double: 1 +idouble: 1 +Test "pow10 (0.75)": +ildouble: 1 +ldouble: 1 +Test "pow10 (3)": +double: 1 +idouble: 1 +Test "pow10 (36)": +double: 1 +idouble: 1 + # pow_downward Test "pow_downward (1.0625, 1.125)": ildouble: 1 @@ -8637,6 +8657,12 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: "pow10": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 + Function: "pow_downward": float: 1 ifloat: 1