about summary refs log tree commit diff
path: root/math/gen-libm-test.pl
Commit message (Collapse)AuthorAgeFilesLines
* Prepare libm-test.inc structures for multi-rounding-mode testing.Joseph Myers2014-03-061-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present, libm-test.inc tests are run in multiple rounding modes by having a separate array for each rounding mode (which might or might not have the same test inputs as the other such arrays), a separate function calling a RUN_TEST_LOOP_* macro over that array, and a separate call to that function in main. The number of functions tested in multiple rounding modes has gradually increased as rounding-mode-specific bugs have been found and fixed in different functions. It would be better to be able to use a single macro call, in a single function, to run tests for a function over all rounding modes, with this being done for all libm functions except in cases where it's deferred until some bugs can be fixed because XFAILing all affected tests would be painful (that's why the full set of pow tests isn't currently run in all rounding modes). This patch helps prepare for that by making the structures storing expected results for tests store results for all four rounding modes. After this patch, the results for all modes are just duplicates, but tests access the appropriate field in the structure, so helping to pave the way for when the fields stop being duplicates and multiple rounding modes can be tested from a single array. Tests might in future specify a single set of results, to be used in all rounding modes; separate results for each rounding mode, specified manually; or use of auto-libm-tests-* to generate results for each rounding mode. Tested x86_64. * math/libm-test.inc (struct test_f_f_data): Move expected results into structure for each rounding mode. (struct test_ff_f_data): Likewise. (struct test_ff_f_data_nexttoward): Likewise. (struct test_fi_f_data): Likewise. (struct test_fl_f_data): Likewise. (struct test_if_f_data): Likewise. (struct test_fff_f_data): Likewise. (struct test_c_f_data): Likewise. (struct test_f_f1_data): Likewise. (struct test_fF_f1_data): Likewise. (struct test_ffI_f1_data): Likewise. (struct test_c_c_data): Likewise. (struct test_cc_c_data): Likewise. (struct test_f_i_data): Likewise. (struct test_ff_i_data): Likewise. (struct test_f_l_data): Likewise. (struct test_f_L_data): Likewise. (struct test_fFF_11_data): Likewise. (RM_): New macro. (RM_FE_DOWNWARD): Likewise. (RM_FE_TONEAREST): Likewise. (RM_FE_TOWARDZERO): Likewise. (RM_FE_UPWARD): Likewise. (RUN_TEST_LOOP_f_f): Update references to expected results. (RUN_TEST_LOOP_2_f): Likewise. (RUN_TEST_LOOP_fff_f): Likewise. (RUN_TEST_LOOP_c_f): Likewise. (RUN_TEST_LOOP_f_f1): Likewise. (RUN_TEST_LOOP_fF_f1): Likewise. (RUN_TEST_LOOP_fI_f1): Likewise. (RUN_TEST_LOOP_ffI_f1): Likewise. (RUN_TEST_LOOP_c_c): Likewise. (RUN_TEST_LOOP_cc_c): Likewise. (RUN_TEST_LOOP_f_i): Likewise. (RUN_TEST_LOOP_f_i_tg): Likewise. (RUN_TEST_LOOP_ff_i_tg): Likewise. (RUN_TEST_LOOP_f_b): Likewise. (RUN_TEST_LOOP_f_b_tg): Likewise. (RUN_TEST_LOOP_f_l): Likewise. (RUN_TEST_LOOP_f_L): Likewise. (RUN_TEST_LOOP_fFF_11): Likewise. * math/gen-libm-test.pl (parse_args): Output four copies of expected results for each test.
* Adjust how gen-auto-libm-tests handles before-rounding/after-rounding cases.Joseph Myers2014-03-061-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes gen-auto-libm-tests so that, when generating test results that depend on whether the architecture has before-rounding or after-rounding tininess detection, the :before-rounding or :after-rounding conditions go on the exception / errno flags generated, rather than generating two separate lines in auto-libm-test-out for e.g. flt-32:before-rounding and flt-32:after-rounding. The rationale for this is as follows. It would be desirable for testing a libm function in all rounding modes to require just one function and array in libm-test.inc, not four (or five), with the array of test data including expected results for all rounding modes rather than separate arrays for each rounding mode that also need to repeat all the test inputs. For gen-libm-test.pl to generate data for such an array from auto-libm-test-out, it would be helpful if each (format, test input) pair has exactly four lines in auto-libm-test-out, one for each rounding mode, rather than some rounding modes having just one line and some having two because the exceptions depend on tininess detection. Tested x86_64 and x86. * math/gen-auto-libm-tests.c: Update comment on output format. (output_for_one_input_case): Generate before-rounding and after-rounding information as conditions on output flags not floating-point format. * math/auto-libm-test-out: Regenerated. * math/gen-libm-test.pl (cond_value): New function. (or_cond_value): Use cond_value. (generate_testfile): Handle conditional exceptions.
* Don't include individual test ulps in libm-test-ulps.Joseph Myers2014-03-051-73/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As recently discussed <https://sourceware.org/ml/libc-alpha/2014-02/msg00670.html>, it doesn't seem particularly useful for libm-test-ulps files to contain huge amounts of data on ulps for individual tests; just the global maximum observed ulps for each function, together with the verification of exceptions, errno and special results such as infinities and NaNs for each test, suffices to verify that a function's behavior on the given test inputs is within the expected accuracy. Removing this data reduces source tree churn caused by updates to these files when libm tests are added, and reduces the frequency with which testsuite additions actually need libm-test-ulps changes at all. Accordingly, this patch removes that data, so that individual tests get checked against the global bounds for the given function and only generate an error if those are exceeded. Tested x86_64 (including verifying that if an ulps value is artificially reduced, the tests do indeed fail as they should and "make regen-ulps" generates the expected changes). * math/libm-test.inc (struct ulp_data): Don't refer to ulps for individual tests in comment. (libm-test-ulps.h): Don't refer to test_ulps in #include comment. (prev_max_error): New variable. (prev_real_max_error): Likewise. (prev_imag_max_error): Likewise. (compare_ulp_data): Don't refer to test names in comment. (find_test_ulps): Remove function. (find_function_ulps): Likewise. (find_complex_function_ulps): Likewise. (init_max_error): Take function name as argument. Look up ulps for that function. (print_ulps): Remove function. (print_max_error): Use prev_max_error instead of calling find_function_ulps. (print_complex_max_error): Use prev_real_max_error and prev_imag_max_error instead of calling find_complex_function_ulps. (check_float_internal): Take max_ulp parameter instead of calling find_test_ulps. Don't call print_ulps. (check_float): Update call to check_float_internal. (check_complex): Update calls to check_float_internal. (START): Pass argument to init_max_error. * math/gen-libm-test.pl (%results): Don't include "kind" information. (parse_ulps): Don't handle ulps of individual tests. (print_ulps_file): Likewise. (output_ulps): Likewise. * math/README.libm-test: Update. * manual/libm-err-tab.pl (parse_ulps): Don't handle ulps of individual tests. * sysdeps/aarch64/libm-test-ulps: Remove individual test ulps. * sysdeps/alpha/fpu/libm-test-ulps: Likewise. * sysdeps/arm/libm-test-ulps: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/ia64/fpu/libm-test-ulps: Likewise. * sysdeps/m68k/coldfire/fpu/libm-test-ulps: Likewise. * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Likewise. * sysdeps/microblaze/libm-test-ulps: Likewise. * sysdeps/mips/mips32/libm-test-ulps: Likewise. * sysdeps/mips/mips64/libm-test-ulps: Likewise. * sysdeps/powerpc/fpu/libm-test-ulps: Likewise. * sysdeps/powerpc/nofpu/libm-test-ulps: Likewise. * sysdeps/s390/fpu/libm-test-ulps: Likewise. * sysdeps/sh/libm-test-ulps: Likewise. * sysdeps/sparc/fpu/libm-test-ulps: Likewise. * sysdeps/tile/libm-test-ulps: Likewise. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise. * sysdeps/hppa/fpu/libm-test-ulps: Remove individual test ulps.
* Let gen-libm-test.pl find itself when run outside source directoryAndreas Schwab2014-01-271-2/+3
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Disable libm-test test name beautification for M_* constants.Joseph Myers2013-12-191-17/+0
| | | | | | | | | | | | | | | | | | | | | math/gen-libm-test.pl has code to beautify names of various constants, transforming the source form in libm-test.inc into the version appearing in test names in libm-test-ulps files. This has become decreasingly relevant over time for the M_* constants, first as I changed the test names so only the arguments and not the expected results appeared in them, then as tests have moved to auto-libm-test-* so that automatically generated hex float constants get used instead of M_* in test inputs. This patch removes the beautification for all M_* constants. Tested x86_64 and x86 and ulps updated accordingly. Even the one case where this affected the name in the ulps files will disappear once complex function tests are moved to auto-libm-test-*. * math/gen-libm-test.pl (%beautify): Remove M_* constants. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Start generating libm tests automatically with MPFR.Joseph Myers2013-11-291-4/+181
|
* Test signs of NaNs in libm-test.inc where appropriate.Joseph Myers2013-11-161-1/+1
|
* Add libm-test support for ignored return value, add more lrint / llrint / ↵Joseph Myers2013-11-161-6/+35
| | | | lround / llround tests.
* Replace libm-test.inc TEST_INLINE conditionals with NO_TEST_INLINE flag.Joseph Myers2013-11-161-1/+1
|
* Remove libm-test START_DATA and END_DATA.Joseph Myers2013-05-241-8/+0
|
* Make libm-test START and END into ordinary macros.Joseph Myers2013-05-241-28/+0
|
* Don't include function names in test data in generated libm-test.c.Joseph Myers2013-05-221-15/+12
|
* Don't include expected results in libm-test test names.Joseph Myers2013-05-221-4/+1
|
* Handle sincos with generic libm-test logic.Joseph Myers2013-05-191-34/+2
|
* Simplify gen-libm-test.pl handling of tests with extra outputs.Joseph Myers2013-05-191-65/+17
|
* Make libm-test look up ulps by name at runtime.Joseph Myers2013-05-181-90/+71
|
* Simplify libm-test extra-output initialization.Joseph Myers2013-05-171-4/+4
|
* Remove libm-test support for TEST_* inside functions.Joseph Myers2013-05-161-72/+19
|
* Convert TEST_c_c tests from code to data.Joseph Myers2013-05-121-2/+2
|
* Start converting libm tests from code to data.Joseph Myers2013-05-101-23/+78
|
* Move some libm-test logic for running tests from gen-libm-test.pl to ↵Joseph Myers2013-05-081-75/+80
| | | | libm-test.inc.
* Initialize x in frexp, modf, remqou tests.Joseph Myers2013-05-061-0/+3
|
* Remove unused libm-test expected-failure mechanism.Joseph Myers2013-05-041-61/+5
|
* Integrate errno testing better in libm-test.inc.Joseph Myers2013-04-291-1/+1
|
* New <math.h> macro named issignaling to check for a signaling NaN (sNaN).Thomas Schwinge2013-04-021-1/+1
| | | | It is based on draft TS 18661 and currently enabled as a GNU extension.
* libm-test: Properly wrap blocks consisting of several statements.Thomas Schwinge2013-03-211-8/+14
|
* Better distinguish between NaN/qNaN/sNaN.Thomas Schwinge2013-03-151-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Make libm-test.inc test comparison macros.Joseph Myers2012-10-091-1/+3
|
* Improve libm test coverage of classification macros / functions.Joseph Myers2012-10-081-1/+1
|
* Don't include exceptions in libm-test-ulps test names.Joseph Myers2012-05-241-23/+0
|
* Test underflow exceptions in libm-test.inc.Joseph Myers2012-05-241-0/+6
|
* Test for overflow exceptions in libm-test.inc.Joseph Myers2012-03-201-1/+3
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* [BZ #2832, BZ #2987]Ulrich Drepper2006-08-131-3/+5
| | | | | | | | | | | | | | | 2006-06-08 Joseph Myers <jsm28@gcc.gnu.org> [BZ #2832] * math/gen-libm-test.pl (clean_up_number): Do not remove trailing 0s from integers. 2006-08-13 Ulrich Drepper <drepper@redhat.com> [BZ #2987] * sysdeps/unix/sysv/linux/clock_settime.c: Add code to use syscall for CPU clocks. * sysdeps/unix/clock_settime.c: Add support for platform-specific setting of CPU clocks.
* [BZ #2466]Roland McGrath2006-03-161-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * math/gen-libm-test.pl (parse_args): Take function name for pretty output as an argument. (generate_testfile): Pass it the name given in the START macro. [BZ #2466] * math/libm-test.inc (llrint_test, llround_test): Fix last change to protect large-precision cases with [LDBL_MANT_DIG > 100]. (llrint_test_tonearest, llrint_test_towardzero): Likewise. (llrint_test_downward, llrint_test_upward): Likewise. 2006-03-15 Steven Munroe <sjmunroe@us.ibm.com> Alan Modra <amodra@bigpond.net.au> [BZ #2466] * math/libm-test.inc (llrint_test, llround_test) [TEST_LDOUBLE]: Add new test values. (llrint_test_tonearest, llrint_test_towardzero, llrint_test_downward, llrint_test_upward): New functions. (main): Call them. * sysdeps/ieee754/ldbl-128ibm/s_llrintl.c (__llrintl): Handle rounding that spans doubles in IBM long double format. * sysdeps/ieee754/ldbl-128ibm/s_llroundl.c (__llroundl): Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llrintl.S: Removed. * sysdeps/powerpc/powerpc64/fpu/s_llroundl.S: Removed. * sysdeps/powerpc/powerpc64/fpu/s_lrintl.S: Removed. * sysdeps/powerpc/powerpc64/fpu/s_lroundl.S: Removed. 2006-03-16 Roland McGrath <roland@redhat.com>
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-11/+8
|
* 2.5-18.1Jakub Jelinek2007-07-121-8/+11
|
* Update to LGPL v2.1.Andreas Jaeger2001-07-061-9/+8
| | | | | | | | | | | | | | 2001-07-06 Paul Eggert <eggert@twinsun.com> * manual/argp.texi: Remove ignored LGPL copyright notice; it's not appropriate for documentation anyway. * manual/libc-texinfo.sh: "Library General Public License" -> "Lesser General Public License". 2001-07-06 Andreas Jaeger <aj@suse.de> * All files under GPL/LGPL version 2: Place under LGPL version 2.1.
* (parse_ulps): Remove extra \.Andreas Jaeger2000-08-301-1/+1
|
* Update.Ulrich Drepper1999-10-251-6/+14
| | | | | | | | | | | | | | | | | | | | | | 1999-10-25 Thorsten Kukuk <kukuk@suse.de> * md5-crypt/md5.h: Remove prototypes for public interface. md5 is used only internal. * md5-crypt/md5-crypt.c: Use internal names for md5 functions, remove weak alias for public names. * md5-crypt/md5.c: Remove weak aliase. 1999-10-25 Andreas Jaeger <aj@suse.de> * math/README.libm-test: New file, documents libm-test.inc. 1999-10-25 Andreas Jaeger <aj@suse.de> * math/gen-libm-test.pl: Only generate a new ulps file when -n is given. (print_ulps_file): Fix loops to not read @tests and @functions since those are not initialized with -n now. (parse_ulps): Set $results{..}{"kind"}.
* Update.Ulrich Drepper1999-10-251-18/+17
| | | | | | | | | 1999-10-25 Andreas Jaeger <aj@suse.de> * math/gen-libm-test.pl (parse_ulps): Ignore 0 has ulp. * math/libm-test.inc (check_float_internal): Don't print ulps for wrong sign of zero.
* Update.Ulrich Drepper1999-10-201-60/+184
| | | | | | | | 1999-10-20 Andreas Jaeger <aj@suse.de> * math/libm-test.inc: Rewrite to allow different deltas for real and imaginary part of complex functions. * math/gen-libm-test.pl: Likewise.
* Update.Ulrich Drepper1999-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | 1999-10-19 Ulrich Drepper <drepper@cygnus.com> * sysdeps/i386/fpu/s_nextafterl.c: Add __nextafterl and nextafterl aliases. * sysdeps/ieee754/flt-32/e_lgammaf_r.c: Don't handle -Inf special. * sysdeps/ieee754/flt-32/e_gammaf_r.c (__ieee754_gammaf_r): Check for -Inf and return NaN. * math/gen-libm-test.pl: Fix program name in help message. * math/libm-test.inc (check_complex): It's Imaginary, not Complex. * math/libm-test.inc (gamma_test): Result of gamma(-inf) is +inf. * sysdeps/i386/Implies: Correct order of libm directories.
* Update.Ulrich Drepper1999-10-191-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1999-10-19 Andreas Jaeger <aj@suse.de> * include/bits/ipc.h: Remove K&R compatibility. * include/libintl.h: Likewise. * include/math.h: Likewise. * include/mntent.h: Likewise * include/netdb.h: Likewise. * include/pwd.h: Likewise. * include/sched.h: Likewise. * include/shadow.h: Likewise * include/stdlib.h: Likewise. * include/sys/file.h: Likewise. * include/sys/gmon.h: Likewise. * include/sys/ioctl.h: Likewise. * include/sys/mman.h: Likewise. * include/sys/resource.h: Likewise. * include/sys/socket.h: Likewise. * include/sys/stat.h: Likewise. * include/sys/sysinfo.h: Likewise. * include/sys/time.h: Likewise. * include/sys/times.h: Likewise. * include/sys/uio.h: Likewise. * include/sys/wait.h: Likewise. * include/termios.h: Likewise. * include/time.h: Likewise. * include/ulimit.h: Likewise. * include/utmp.h: Likewise. * include/wchar.h: Likewise. * include/wctype.h: Likewise. 1999-10-19 Andreas Jaeger <aj@suse.de> * math/libm-test.inc: Remove one K&R compatibility. (main): Enable nexttoward_test. * math/gen-libm-test.pl (output_ulps): Output name of Ulps file to libm-test-ulps.h; pretty print output a bit. 1999-10-19 Andreas Jaeger <aj@suse.de> * iconv/iconv_prog.c (main): Set exit value in case that reading from stdin failed [PR libc/1404].
* Update.Ulrich Drepper1999-10-191-0/+606
1999-10-18 Andreas Jaeger <aj@suse.de> Added improved math testsuite: * math/libm-test.inc: New file, contains all tests from libm-test.c but in a different form. * math/libm-test.c: Removed. * sysdeps/generic/libm-test-ulps: New file: Fallback ulps file. * math/gen-libm-test.pl: New file: Preprocessor. * math/test-double.c: Adopted to new testsuite. * math/test-idouble.c: Likewise. * math/test-float.c: Likewise. * math/test-ifloat.c: Likewise. * math/test-ldouble.c: Likewise. * math/test-ildoubl.c: Likewise. * math/Makefile: Added rules to generate new suite.