Don't include individual test ulps in libm-test-ulps.

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.
Automatically check sanity of ulps from libm tests.

This patch makes libm-test.inc apply sanity checks to ulps values
resulting from tests, or found in libm-test-ulps files, to avoid the
need for manual checking/editing of new ulps for cases that are
excessively large or involve functions that should not have any ulps.
For IBM long double, errors must be at most 14ulp (the largest
currently checked-in value), or at most 3ulp (the documented error
bound for division) in the case of exactly-determined functions; for
other formats, the limits are 9ulp (also the largest currently
checked-in value) and 0ulp.  Limits from ulps files are saturated to
those bounds, and regen-ulps will ignore any errors outside those
bounds.  (Thus if, say, you have an architecture-specific problem with
fma, the tests can still be XFAILed in auto-libm-test-in, but errors
outside the permitted range can no longer be listed in
libm-test-ulps.)

Tested x86_64.

	* math/libm-test.inc (max_valid_error): New variable.
	(init_max_error): Take new argument specifying whether function
	results are exactly determined.  Set max_valid_error and bound
	other variables for errors based on this argument.
	(set_max_error): Do not record results above max_valid_error.
	(check_float_internal): Only accept errors of up to 0.5ulps if
	also at most max_valid_error.
	(START): Take new argument EXACT and pass it to init_max_error.
	(acos_test): Update call to START.
	(acos_test_tonearest): Likewise.
	(acos_test_towardzero): Likewise.
	(acos_test_downward): Likewise.
	(acos_test_upward): Likewise.
	(acosh_test): Likewise.
	(asin_test): Likewise.
	(asin_test_tonearest): Likewise.
	(asin_test_towardzero): Likewise.
	(asin_test_downward): Likewise.
	(asin_test_upward): Likewise.
	(asinh_test): Likewise.
	(atan_test): Likewise.
	(atanh_test): Likewise.
	(atan2_test): Likewise.
	(cabs_test): Likewise.
	(cacos_test): Likewise.
	(cacosh_test): Likewise.
	(carg_test): Likewise.
	(casin_test): Likewise.
	(casinh_test): Likewise.
	(catan_test): Likewise.
	(catanh_test): Likewise.
	(cbrt_test): Likewise.
	(ccos_test): Likewise.
	(ccosh_test): Likewise.
	(ceil_test): Likewise.
	(cexp_test): Likewise.
	(cimag_test): Likewise.
	(clog_test): Likewise.
	(clog10_test): Likewise.
	(conj_test): Likewise.
	(copysign_test): Likewise.
	(cos_test): Likewise.
	(cos_test_tonearest): Likewise.
	(cos_test_towardzero): Likewise.
	(cos_test_downward): Likewise.
	(cos_test_upward): Likewise.
	(cosh_test): Likewise.
	(cosh_test_tonearest): Likewise.
	(cosh_test_towardzero): Likewise.
	(cosh_test_downward): Likewise.
	(cosh_test_upward): Likewise.
	(cpow_test): Likewise.
	(cproj_test): Likewise.
	(creal_test): Likewise.
	(csin_test): Likewise.
	(csinh_test): Likewise.
	(csqrt_test): Likewise.
	(ctan_test): Likewise.
	(ctan_test_tonearest): Likewise.
	(ctan_test_towardzero): Likewise.
	(ctan_test_downward): Likewise.
	(ctan_test_upward): Likewise.
	(ctanh_test): Likewise.
	(ctanh_test_tonearest): Likewise.
	(ctanh_test_towardzero): Likewise.
	(ctanh_test_downward): Likewise.
	(ctanh_test_upward): Likewise.
	(erf_test): Likewise.
	(erfc_test): Likewise.
	(exp_test): Likewise.
	(exp_test_tonearest): Likewise.
	(exp_test_towardzero): Likewise.
	(exp_test_downward): Likewise.
	(exp_test_upward): Likewise.
	(exp10_test): Likewise.
	(exp10_test_tonearest): Likewise.
	(exp10_test_towardzero): Likewise.
	(exp10_test_downward): Likewise.
	(exp10_test_upward): Likewise.
	(pow10_test): Likewise.
	(exp2_test): Likewise.
	(expm1_test): Likewise.
	(expm1_test_tonearest): Likewise.
	(expm1_test_towardzero): Likewise.
	(expm1_test_downward): Likewise.
	(expm1_test_upward): Likewise.
	(fabs_test): Likewise.
	(fdim_test): Likewise.
	(floor_test): Likewise.
	(fma_test): Likewise.
	(fma_test_towardzero): Likewise.
	(fma_test_downward): Likewise.
	(fma_test_upward): Likewise.
	(fmax_test): Likewise.
	(fmin_test): Likewise.
	(fmod_test): Likewise.
	(fpclassify_test): Likewise.
	(frexp_test): Likewise.
	(hypot_test): Likewise.
	(ilogb_test): Likewise.
	(isfinite_test): Likewise.
	(finite_test): Likewise.
	(isgreater_test): Likewise.
	(isgreaterequal_test): Likewise.
	(isinf_test): Likewise.
	(isless_test): Likewise.
	(islessequal_test): Likewise.
	(islessgreater_test): Likewise.
	(isnan_test): Likewise.
	(isnormal_test): Likewise.
	(issignaling_test): Likewise.
	(isunordered_test): Likewise.
	(j0_test): Likewise.
	(j1_test): Likewise.
	(jn_test): Likewise.
	(ldexp_test): Likewise.
	(lgamma_test): Likewise.
	(gamma_test): Likewise.
	(lrint_test): Likewise.
	(lrint_test_tonearest): Likewise.
	(lrint_test_towardzero): Likewise.
	(lrint_test_downward): Likewise.
	(lrint_test_upward): Likewise.
	(llrint_test): Likewise.
	(llrint_test_tonearest): Likewise.
	(llrint_test_towardzero): Likewise.
	(llrint_test_downward): Likewise.
	(llrint_test_upward): Likewise.
	(log_test): Likewise.
	(log10_test): Likewise.
	(log1p_test): Likewise.
	(log2_test): Likewise.
	(logb_test): Likewise.
	(logb_test_downward): Likewise.
	(lround_test): Likewise.
	(llround_test): Likewise.
	(modf_test): Likewise.
	(nearbyint_test): Likewise.
	(nextafter_test): Likewise.
	(nexttoward_test): Likewise.
	(pow_test): Likewise.
	(pow_test_tonearest): Likewise.
	(pow_test_towardzero): Likewise.
	(pow_test_downward): Likewise.
	(pow_test_upward): Likewise.
	(remainder_test): Likewise.
	(drem_test): Likewise.
	(remainder_test_tonearest): Likewise.
	(drem_test_tonearest): Likewise.
	(remainder_test_towardzero): Likewise.
	(drem_test_towardzero): Likewise.
	(remainder_test_downward): Likewise.
	(drem_test_downward): Likewise.
	(remainder_test_upward): Likewise.
	(drem_test_upward): Likewise.
	(remquo_test): Likewise.
	(rint_test): Likewise.
	(rint_test_tonearest): Likewise.
	(rint_test_towardzero): Likewise.
	(rint_test_downward): Likewise.
	(rint_test_upward): Likewise.
	(round_test): Likewise.
	(scalb_test): Likewise.
	(scalbn_test): Likewise.
	(scalbln_test): Likewise.
	(signbit_test): Likewise.
	(sin_test): Likewise.
	(sin_test_tonearest): Likewise.
	(sin_test_towardzero): Likewise.
	(sin_test_downward): Likewise.
	(sin_test_upward): Likewise.
	(sincos_test): Likewise.
	(sinh_test): Likewise.
	(sinh_test_tonearest): Likewise.
	(sinh_test_towardzero): Likewise.
	(sinh_test_downward): Likewise.
	(sinh_test_upward): Likewise.
	(sqrt_test): Likewise.
	(sqrt_test_tonearest): Likewise.
	(sqrt_test_towardzero): Likewise.
	(sqrt_test_downward): Likewise.
	(sqrt_test_upward): Likewise.
	(tan_test): Likewise.
	(tan_test_tonearest): Likewise.
	(tan_test_towardzero): Likewise.
	(tan_test_downward): Likewise.
	(tan_test_upward): Likewise.
	(tanh_test): Likewise.
	(tgamma_test): Likewise.
	(trunc_test): Likewise.
	(y0_test): Likewise.
	(y1_test): Likewise.
	(yn_test): Likewise.
	(significand_test): Likewise.
Adjust how gen-auto-libm-tests handles before-rounding/after-rounding cases.

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 define __ASSUME_UTIMES for linux-generic architectures.

The __ASSUME_UTIMES macro describes whether the utimes syscall is
present.  For linux-generic architectures, it isn't (utimensat is
instead), so the macro should not be defined for them; this patch
removes the spurious definitions for such architectures.  (Those
definitions don't actually cause any user-visible bug, because
futimes.c doesn't use __ASSUME_UTIMES if __ASSUME_UTIMENSAT is
defined, and futimesat.c and utimes.c are overridden for
linux-generic, but the definitions are still logically incorrect.)

	* sysdeps/unix/sysv/linux/aarch64/kernel-features.h
	(__ASSUME_UTIMES): Remove.
	* sysdeps/unix/sysv/linux/tile/kernel-features.h
	(__ASSUME_UTIMES): Likewise.
Prepare libm-test.inc structures for multi-rounding-mode testing.

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.
Remove INSTALL_INFO setting in manual/Makefile.

	* manual/Makefile (INSTALL_INFO): Remove variable setting.
conformtest: correct set of standards for which some headers are tested.

Reviewing the sets of headers for which conformtest has expectations
for various standards showed up cases where headers had expectations
for standards not including those headers, or were missing
expectations for a standard that did include the header.  This patch
fixes easy cases of this (largely disabling tests for standards for
which they are inapplicable).  Tested x86_64.

	* conform/data/aio.h-data [XPG3 || XPG4]: Disable whole file.
	* conform/data/arpa/inet.h-data [XPG3]: Likewise.
	* conform/data/dlfcn.h-data [XPG3 || XPG4]: Likewise.
	* conform/data/fmtmsg.h-data [XPG3]: Likewise.
	* conform/data/libgen.h-data [XPG3]: Likewise.
	* conform/data/mqueue.h-data [XPG3 || XPG4]: Likewise.
	* conform/data/ndbm.h-data [XPG3]: Likewise.
	* conform/data/net/if.h-data [XPG3 || XPG4 || UNIX98]: Likewise.
	* conform/data/netdb.h-data [XPG3]: Likewise.
	* conform/data/netinet/in.h-data [XPG3]: Likewise.
	* conform/data/poll.h-data [XPG3]: Likewise.
	* conform/data/spawn.h-data [XPG3 || XPG4 || UNIX98]: Likewise.
	* conform/data/strings.h-data [XPG3]: Likewise.
	* conform/data/stropts.h-data [XPG3]: Likewise.
	* conform/data/sys/mman.h-data [XPG3]: Likewise.
	* conform/data/sys/resource.h-data [XPG3]: Likewise.
	* conform/data/sys/select.h-data [XPG3 || XPG4 || UNIX98]:
	Likewise.
	* conform/data/sys/statvfs.h-data [XPG3]: Likewise.
	* conform/data/sys/time.h-data [XPG3]: Likewise.
	* conform/data/sys/timeb.h-data [XPG3]: Likewise.
	* conform/data/sys/uio.h-data [XPG3]: Likewise.
	* conform/data/sys/un.h-data [XPG3]: Likewise.
	* conform/data/syslog.h-data [XPG3]: Likewise.
	* conform/data/ucontext.h-data [XPG3]: Likewise.
	* conform/data/utmpx.h-data [XPG3]: Likewise.
	* conform/data/varargs.h-data [UNIX98]: Enable file.
conformtest: correct set of standards for which more headers are tested.

Continuing the corrections to which headers conformtest tests for
which standards, this patch corrects conformtest mistakes regarding
which headers to test for the remaining standards (XOPEN2K POSIX2008
XOPEN2K8).  Tested x86_64.

2014-03-05  Joseph Myers  <joseph@codesourcery.com>

	* conform/data/netinet/tcp.h-data [POSIX2008 || XOPEN2K8]: Enable
	whole file.
	* conform/data/sys/timeb.h-data [POSIX2008 || XOPEN2K8]: Disable
	whole file.
	* conform/data/sys/uio.h-data [POSIX2008]: Likewise.
	* conform/data/ucontext.h-data [POSIX2008 || XOPEN2K8]: Likewise.