benchtests: Add strtok benchmark
Add _DEFAULT_SOURCE feature test macro.

This patch adds a feature test macro _DEFAULT_SOURCE to enable the
default set of header declarations.

The intention is: if _DEFAULT_SOURCE is not used there is no change to
the set of __USE_* macros glibc defines; if it's used on its own, and
without compiler options such as -std=c99 that define __STRICT_ANSI__,
again, there is no change; if it's used together with the macros it
approximately (i.e., apart from __USE_POSIX_IMPLICITLY) implies
(-D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809L), again, there
is no change.  Otherwise, it causes the relevant features to be
enabled, even if __STRICT_ANSI__, or another feature test macro, would
cause them to be disabled.

This macro deliberately bundles the POSIX.1-2008 (non-X/Open)
functionality with the BSD/SVID/"misc" functionality, rather than
defining a macro that gives just the latter, as many of the header
cleanups resulting from removing _BSD_SOURCE and _SVID_SOURCE support
are only possible when BSD/SVID/"misc" is always bundled with
POSIX.1-2008.

Tested x86_64.

	* include/features.h: Update comment documenting feature test
	macros.  Mention _DEFAULT_SOURCE in comment.
	[_GNU_SOURCE] (_DEFAULT_SOURCE): Undefine and redefine.
	[_DEFAULT_SOURCE]: Undefine and redefine _DEFAULT_SOURCE,
	_BSD_SOURCE and _SVID_SOURCE.
	[!__STRICT_ANSI__ && !_ISOC99_SOURCE && !_POSIX_SOURCE &&
	!_POSIX_C_SOURCE && !_XOPEN_SOURCE && !_BSD_SOURCE &&
	!_SVID_SOURCE]: Likewise.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(__USE_POSIX_IMPLICITLY): Define.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(_POSIX_SOURCE): Undefine and redefine.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(_POSIX_C_SOURCE): Likewise.
	* manual/creature.texi (_DEFAULT_SOURCE): Document.
	(Feature Test Macros): Update documentation of default features.
Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293).

Bug 16293 is inaccuracy of x86/x86_64 versions of expm1, near 0 in
directed rounding modes, that arises from frndint rounding the
exponent to 1 or -1 instead of 0, resulting in large cancellation
error.  This inaccuracy in turn affects other functions such as sinh
that use expm1.  This patch fixes the problem by setting
round-to-nearest mode temporarily around the affected calls to
frndint.  I don't think this is needed for other uses of frndint, such
as in exp itself, as only for expm1 is the cancellation error
significant.

Tested x86_64 and x86 and ulps updated accordingly.

	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Set
	round-to-nearest mode when using frndint.
	* sysdeps/i386/fpu/s_expm1.S (__expm1): Likewise.
	* sysdeps/i386/fpu/s_expm1f.S (__expm1f): Likewise.
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]:
	Likewise.
	* math/auto-libm-test-in: Add more tests of expm1.  Do not expect
	sinh test to fail.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (TEST_COND_x86_64): Remove macro.
	(TEST_COND_x86): Likewise.
	(expm1_tonearest_test_data): New array.
	(expm1_test_tonearest): New function.
	(expm1_towardzero_test_data): New array.
	(expm1_test_towardzero): New function.
	(expm1_downward_test_data): New array.
	(expm1_test_downward): New function.
	(expm1_upward_test_data): New array.
	(expm1_test_upward): New function.
	(main): Run the new test functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Disable libm-test test name beautification for M_* constants.

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.
Fix uses of CALL_MCOUNT in ppc64 assembler sources
Move tests of sincos from libm-test.inc to auto-libm-test-in.

This patch moves tests of sincos to auto-libm-test-in, adding the
required support to gen-auto-libm-tests.

Tested x86_64 and x86 and ulps updated accordingly.

(auto-libm-test-out diffs omitted below.)

	* math/auto-libm-test-in: Add tests of sincos.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (sincos_test_data): Use AUTO_TESTS_fFF_11.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpfr_f_11.
	(func_calc_desc): Add mpfr_f_11 union field.
	(test_functions): Add sincos.
	(calc_generic_results): Handle mpfr_f_11.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Update texinfo.tex, config.guess, config.sub from upstream.

This patch updates various miscellaneous files we take from upstream
GNU sources (texinfo.texi, config.guess, config.sub - various others
haven't changed upstream since we last updated them) to their current
upstream versions.

Tested x86_64.

	* manual/texinfo.tex: Update to version 2013-11-26.10 with
	trailing whitespace removed.
	* scripts/config.guess: Update to version 2013-11-29.
	* scripts/config.sub: Update to version 2013-10-01.
Cleanup compile warnings.

2013-12-19  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* elf/dl-misc.c (ptr_to_signal_safe_allocator_header): New function.
	(__signal_safe_memalign, __signal_safe_free): Use it.
	(__signal_safe_realloc): Likewise.
Fix incorrect power of 2 check in last commit.
Fix white space as well.
Update powerpc-fpu ULPs.
Don't make soft-fp symbols compat symbols for powerpc-nofpu.

sysdeps/powerpc/powerpc32/libgcc-compat.S makes certain symbols that
glibc once accidentally reexported from libgcc into compat symbols.

Where the exports were purely accidental, this is the right thing to
do.  However, for powerpc-nofpu the soft-fp symbols are deliberately
exported from libc, given public versions in
sysdeps/powerpc/nofpu/Versions and used by libm in preference to the
libgcc versions that do not support the software exceptions and
rounding modes.  The libc versions should also be usable by user
programs, though normally libgcc gets linked in first (meaning,
effectively, that the <fenv.h> functions are broken as regards their
expected effects on user arithmetic).

A longstanding todo item is to remove the functions in question from
libgcc (when built with recent enough glibc) - that is, remove them
from static libgcc and make them compat symbols in shared libgcc - so
that this works properly (this is one of the items mentioned at
<http://gcc.gnu.org/wiki/Software_floating_point> - parts of that page
are obviously out of date, but this item still applies).  Doing this
requires first that the functions are actually available from libc for
new links, not just as compat symbols.

This patch stops the symbols in question being compat symbols for
powerpc-nofpu.  The nofpu Versions entries for them are removed (the
symbols never were exported at GLIBC_2.3.2, only GLIBC_2.0, because
the compat symbols took precedence).

Tested powerpc-nofpu.  The symbols are no longer compat symbols and
libm.so now properly gets undefined references to them (resolved to
libc.so) instead of the libgcc copies getting linked into libm as
before.

	* sysdeps/powerpc/powerpc32/libgcc-compat.S
	[_SOFT_FLOAT || __NO_FPRS__] (__fixdfdi_v_glibc20): Do not define
	as a macro and a compat symbol.
	[_SOFT_FLOAT || __NO_FPRS__] (__fixsfdi_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__fixunsdfdi_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__fixunssfdi_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__floatdidf_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__floaddisf_v_glibc20): Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixdfdi): Do
	not use .hidden.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixsfdi):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixunsdfdi):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixunssfdi):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__floaddidf):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__floaddisf):
	Likewise.
	* sysdeps/powerpc/nofpu/Versions (libc): Remove __fixdfdi,
	__fixsfdi, __fixunsdfdi, __fixunssfdi, __floatdidf and __floatdisf
	from GLIBC_2.3.2.
Move tests of cabs and carg from libm-test.inc to auto-libm-test-in.

This patch moves tests of cabs and carg to auto-libm-test-in, adding
the required support to gen-auto-libm-tests.

Tested x86_64 and x86; no ulps updates needed.

	* math/auto-libm-test-in: Add tests of cabs and carg.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (cabs_test_data): Use AUTO_TESTS_c_f.
	(carg_test_data): Likewise.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpc_c_f.
	(func_calc_desc): Add mpc_c_f union field.
	(test_functions): Add cabs and carg.
	(calc_generic_results): Handle mpc_c_f.
Remove some redundant computations in s_sin.c

There are multiple points in the code where the absolute value of a
number is computed multiple times or is computed even though the value
can only be positive.  This change removes those redundant
computations.  Tested on x86_64 to verify that there were no
regressions in the testsuite.
Remove redundant arguments in reduce_and_compute

The A and DA arguments in reduce_and_compute are useless and hence
have been removed.
Remove more redundant computations in s_sin.c

Removed more redundant computations in the slow paths of the sin and
cos functions.  The notable change is the passing of the most
significant bits of X to the slow functions to check if X is positive
so that just the absolute value of x can be passed and the repeated
ABS() operation is avoided.
Consolidate code to compute sin and cos from lookup tables

This patch consolidates the multiple copies of code that looks up sin
and cos of a number from the lookup table and computes the final
value, into static functions.  This does not have a noticeable
performance impact since the functions are inlined by gcc.

There is further scope for consolidation in the functions but they
cause a more noticable impact on performance (>5%) due to which I have
held back on them.
Move various TEST_c_c tests from libm-test.inc to auto-libm-test-inc.

This patch moves tests of ccos, ccosh, cexp, clog, csqrt, ctan and
ctanh to auto-libm-test-in, adding the required support to
gen-auto-libm-tests.  Other TEST_c_c functions aren't moved for now
(although the relevant table entries are put in gen-auto-libm-tests
for it to know how to handle them): clog10 because of a known MPC bug
causing it to hang for at least some pure imaginary inputs (fixed in
SVN, but I'd rather not rely on unreleased versions of MPFR or MPC
even if relying on very recent releases); the inverse trig and
hyperbolic functions because of known slowness in special cases; and
csin / csinh because of observed slowness that I need to investigate
and report to the MPC maintainers.  Slowness can be bypassed by moving
to incremental generation (only for new / changed tests) rather than
regenerating the whole of auto-libm-test-out every time, but that
needs implementing.  (This patch takes the time for running
gen-auto-libm-tests from about one second to seven, on my system,
which I think is reasonable.  The slow functions would make it take
several minutes at least, which seems unreasonable.)

Tested x86_64 and x86 and ulps updated accordingly.

	* math/auto-libm-test-in: Add tests of ccos, ccosh, cexp, clog,
	csqrt, ctan and ctanh.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (TEST_COND_x86_64): New macro.
	(TEST_COND_x86): Likewise.
	(ccos_test_data): Use AUTO_TESTS_c_c.
	(ccosh_test_data): Likewise.
	(cexp_test_data): Likewise.
	(clog_test_data): Likewise.
	(csqrt_test_data): Likewise.
	(ctan_test_data): Likewise.
	(ctan_tonearest_test_data): Likewise.
	(ctan_towardzero_test_data): Likewise.
	(ctan_downward_test_data): Likewise.
	(ctan_upward_test_data): Likewise.
	(ctanh_test_data): Likewise.
	(ctanh_tonearest_test_data): Likewise.
	(ctanh_towardzero_test_data): Likewise.
	(ctanh_downward_test_data): Likewise.
	(ctanh_upward_test_data): Likewise.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpc_c_c.
	(func_calc_desc): Add mpc_c_c union field.
	(FUNC_mpc_c_c): New macro.
	(test_functions): Add cacos, cacosh, casin, casinh, catan, catanh,
	ccos, ccosh, cexp, clog, clog10, csin, csinh, csqrt, ctan and
	ctanh.
	(special_fill_min_subnorm_p120): New function.
	(special_real_inputs): Add min_subnorm_p120.
	(calc_generic_results): Handle mpc_c_c.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Move tests of cpow from libm-test.inc to auto-libm-test-in.

This patch moves tests of cpow to auto-libm-test-in, adding the
required support to gen-auto-libm-tests.

Tested x86_64 and x86 and ulps updated accordingly.

	* math/auto-libm-test-in: Add tests of cpow.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (cpow_test_data): Use AUTO_TESTS_cc_c.
	* * math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpc_cc_c.
	(func_calc_desc): Add mpc_cc_c union field.
	(test_functions): Add cpow.
	(special_fill_2pi): New function.
	(special_real_inputs): Add 2pi.
	(calc_generic_results): Handle mpc_cc_c.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Update timezone code from tzcode 2013i.

Now we have Paul's support for version-3 tz files checked in, this
patch updates all the code we take (unmodified) from tzcode to version
2013i (which includes the support for generating version-3 tz files
where necessary).

Tested x86_64.

	* timezone/checktab.awk: Update from tzcode 2013i.
	* timezone/private.h: Likewise.
	* timezone/scheck.c: Likewise.
	* timezone/tzfile.h: Likewise.
	* timezone/tzselect.ksh: Likewise.
	* timezone/zdump.c: Likewise.
	* timezone/zic.c: Likewise.