glibc/sysdeps
Joseph Myers 9755bc4686 Use round functions not __round functions in glibc libm.
Continuing the move to use, within libm, public names for libm
functions that can be inlined as built-in functions on many
architectures, this patch moves calls to __round functions to call the
corresponding round names instead, with asm redirection to __round
when the calls are not inlined.

An additional complication arises in
sysdeps/ieee754/ldbl-128ibm/e_expl.c, where a call to roundl, with the
result converted to int, gets converted by the compiler to call
lroundl in the case of 32-bit long, so resulting in localplt test
failures.  It's logically correct to let the compiler make such an
optimization; an appropriate asm redirection of lroundl to __lroundl
is thus added to that file (it's not needed anywhere else).

Tested for x86_64, and with build-many-glibcs.py.

	* include/math.h [!_ISOMAC && !(__FINITE_MATH_ONLY__ &&
	__FINITE_MATH_ONLY__ > 0) && !NO_MATH_REDIRECT] (round): Redirect
	using MATH_REDIRECT.
	* sysdeps/aarch64/fpu/s_round.c: Define NO_MATH_REDIRECT before
	header inclusion.
	* sysdeps/aarch64/fpu/s_roundf.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_round.c: Likewise.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_round.c: Likewise.
	* sysdeps/ieee754/float128/s_roundf128.c: Likewise.
	* sysdeps/ieee754/flt-32/s_roundf.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_roundl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_roundl.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c: Likewise.
	* sysdeps/riscv/rv64/rvd/s_round.c: Likewise.
	* sysdeps/riscv/rvf/s_roundf.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise.
	(round): Redirect to __round.
	(__roundl): Call round instead of __round.
	* sysdeps/powerpc/fpu/math_private.h [_ARCH_PWR5X] (__round):
	Remove macro.
	[_ARCH_PWR5X] (__roundf): Likewise.
	* sysdeps/ieee754/dbl-64/e_gamma_r.c (gamma_positive): Use round
	functions instead of __round variants.
	* sysdeps/ieee754/flt-32/e_gammaf_r.c (gammaf_positive): Likewise.
	* sysdeps/ieee754/ldbl-128/e_gammal_r.c (gammal_positive):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c (gammal_positive):
	Likewise.
	* sysdeps/ieee754/ldbl-96/e_gammal_r.c (gammal_positive):
	Likewise.
	* sysdeps/x86/fpu/powl_helper.c (__powl_helper): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_expl.c (lroundl): Redirect to
	__lroundl.
	(__ieee754_expl): Call roundl instead of __roundl.
2018-09-27 12:35:23 +00:00
..
aarch64 Use round functions not __round functions in glibc libm. 2018-09-27 12:35:23 +00:00
alpha Use rint functions not __rint functions in glibc libm. 2018-09-14 13:10:39 +00:00
arm Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
generic Add new pow implementation 2018-09-19 10:04:51 +01:00
gnu Update netinet/udp.h from Linux 4.18. 2018-08-27 13:43:05 +00:00
hppa Move SNAN_TESTS_PRESERVE_PAYLOAD out of math-tests.h. 2018-08-01 11:21:16 +00:00
htl hurd: Avoid PLTs for __pthread_get/setspecific 2018-08-09 01:28:55 +02:00
hurd Fix ISO C threads installed header and HURD assumption 2018-07-25 17:27:45 -03:00
i386 Add new pow implementation 2018-09-19 10:04:51 +01:00
ia64 Add new pow implementation 2018-09-19 10:04:51 +01:00
ieee754 Use round functions not __round functions in glibc libm. 2018-09-27 12:35:23 +00:00
init_array sysdeps/init_array: Add PREINIT_FUNCTION to crti.S 2018-01-29 10:22:26 -08:00
m68k Use trunc functions not __trunc functions in glibc libm. 2018-09-20 21:11:10 +00:00
mach hurd: Fix exec usage of mach_setup_thread 2018-08-01 00:10:03 +02:00
microblaze Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
mips Split fenv_private.h out of math_private.h more consistently. 2018-08-28 20:48:49 +00:00
nios2 Move EXCEPTION_TESTS_* out of math-tests.h 2018-08-23 23:41:13 +00:00
nptl [BZ #20271] Add newlines in __libc_fatal calls. 2018-08-31 18:04:32 -07:00
posix Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251) 2018-06-26 13:22:53 -03:00
powerpc Use round functions not __round functions in glibc libm. 2018-09-27 12:35:23 +00:00
pthread hurd: fix sigevent's sigev_notify_attributes field type 2018-04-19 21:43:44 +02:00
riscv Use round functions not __round functions in glibc libm. 2018-09-27 12:35:23 +00:00
s390 S390: Regenerate ULPs. 2018-09-06 14:29:01 +02:00
sh Update SH libm-tests-ulps 2018-07-31 10:33:53 -03:00
sparc Use trunc functions not __trunc functions in glibc libm. 2018-09-20 21:11:10 +00:00
unix Share MAP_* flags between more architectures. 2018-09-26 12:33:14 +00:00
wordsize-32 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
wordsize-64 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
x86 Use round functions not __round functions in glibc libm. 2018-09-27 12:35:23 +00:00
x86_64 Use trunc functions not __trunc functions in glibc libm. 2018-09-20 21:11:10 +00:00