Commit Graph

12 Commits

Author SHA1 Message Date
Joseph Myers 688903eb3e Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2018-01-01 00:32:25 +00:00
Joseph Myers bc4e8f9b49 Use libm_alias_double for i386.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes i386 libm function implementations use
libm_alias_double to define function aliases.

Tested with build-many-glibcs.py for all its i386 configurations that
installed stripped shared libraries are unchanged by the patch, as
well as running the full glibc testsuite for i686.

	* sysdeps/i386/fpu/s_asinh.S: Include <libm-alias-double.h>.
	(asinh): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_atan.S: Include <libm-alias-double.h>.
	(atan): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_cbrt.S: Include <libm-alias-double.h>.
	(cbrt): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_ceil.S: Include <libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_copysign.S: Include <libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_expm1.S: Include <libm-alias-double.h>.
	(expm1): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fabs.S: Include <libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fdim.c: Include <libm-alias-double.h>.
	(fdim): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_floor.S: Include <libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fmax.S: Include <libm-alias-double.h>.
	(fmax): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fmin.S: Include <libm-alias-double.h>.
	(fmin): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_frexp.S: Include <libm-alias-double.h>.
	(frexp): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_llrint.S: Include <libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_logb.S: Include <libm-alias-double.h>.
	(logb): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_lrint.S: Include <libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_nearbyint.S: Include <libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_remquo.S: Include <libm-alias-double.h>.
	(remquo): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_rint.S: Include <libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_trunc.S: Include <libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/i386/i686/fpu/s_fmax.S: Include <libm-alias-double.h>.
	(fmax): Define using libm_alias_double.
	* sysdeps/i386/i686/fpu/s_fmin.S: Include <libm-alias-double.h>.
	(fmin): Define using libm_alias_double.
	* sysdeps/i386/i686/multiarch/s_fma.c: Include <libm-alias-double.h>.
	(fma): Define using libm_alias_double.
2017-11-28 18:15:44 +00:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers 30dcf959d2 Avoid "inexact" exceptions in i386/x86_64 trunc functions (bug 15479).
As discussed in
<https://sourceware.org/ml/libc-alpha/2016-05/msg00577.html>, TS
18661-1 disallows ceil, floor, round and trunc functions from raising
the "inexact" exception, in accordance with general IEEE 754 semantics
for when that exception is raised.  Fixing this for x87 floating point
is more complicated than for the other versions of these functions,
because they use the frndint instruction that raises "inexact" and
this can only be avoided by saving and restoring the whole
floating-point environment.

As I noted in
<https://sourceware.org/ml/libc-alpha/2016-06/msg00128.html>, I have
now implemented a GCC option -fno-fp-int-builtin-inexact for GCC 7,
such that GCC will inline these functions on x86, without caring about
"inexact", when the default -ffp-int-builtin-inexact is in effect.
This allows users to get optimized code depending on the options they
pass to the compiler, while making the out-of-line functions follow TS
18661-1 semantics and avoid "inexact".

This patch duly fixes the out-of-line trunc function implementations
to avoid "inexact", in the same way as the nearbyint implementations.

I do not know how the performance of implementations such as these
based on saving the environment and changing the rounding mode
temporarily compares to that of the C versions or SSE 4.1 versions (of
course, for 32-bit x86 SSE implementations still need to get the
return value in an x87 register); it's entirely possible other
implementations could be faster in some cases.

Tested for x86_64 and x86.

	[BZ #15479]
	* sysdeps/i386/fpu/s_trunc.S (__trunc): Save and restore
	floating-point environment rather than just control word.
	* sysdeps/i386/fpu/s_truncf.S (__truncf): Likewise.
	* sysdeps/i386/fpu/s_truncl.S (__truncl): Save and restore
	floating-point environment, with "invalid" exceptions merged in,
	rather than just control word.
	* sysdeps/x86_64/fpu/s_truncl.S (__truncl): Likewise.
	* math/libm-test.inc (trunc_test_data): Do not allow spurious
	"inexact" exceptions.
2016-06-27 17:26:52 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Joseph Myers 91c03c5389 Add CFI to x86 ceil / floor / trunc (bug 16681).
This patch adds CFI to the sysdeps/i386/fpu/ implementations of ceil,
floor and trunc functions, for consistency with other x86 .S files in
glibc which have CFI for stack adjustments.

Tested x86.

	[BZ #16681]
	* sysdeps/i386/fpu/s_ceil.S (__ceil): Add CFI.
	* sysdeps/i386/fpu/s_ceilf.S (__ceilf): Likewise.
	* sysdeps/i386/fpu/s_ceill.S (__ceill): Likewise.
	* sysdeps/i386/fpu/s_floor.S (__floor): Likewise.
	* sysdeps/i386/fpu/s_floorf.S (__floorf): Likewise.
	* sysdeps/i386/fpu/s_floorl.S (__floorl): Likewise.
	* sysdeps/i386/fpu/s_trunc.S (__trunc): Likewise.
	* sysdeps/i386/fpu/s_truncf.S (__truncf): Likewise.
	* sysdeps/i386/fpu/s_truncl.S (__truncl): Likewise.
2014-06-16 22:54:46 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Andreas Jaeger 41bdb6e20c Update to LGPL v2.1.
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.
2001-07-06 04:58:11 +00:00
Ulrich Drepper abfbdde177 Update. 1999-07-14 00:54:57 +00:00