Commit Graph

28071 Commits

Author SHA1 Message Date
Andreas Schwab 3574f2fdf3 Fix misdetected Slow_SSE4_2 cpu feature bit (bug 17501) 2014-10-27 10:44:28 +01:00
Roland McGrath 461a7b1e45 Rework compiler version check in configure. 2014-10-24 14:45:47 -07:00
Roland McGrath 70996a373d Prototypify htonl and htons definitions. 2014-10-24 12:37:36 -07:00
Wilco Dijkstra e80514b5a8 This patch improves strncat performance by using strlen. Strlen has a fast C implementation, so
this
will improve performance even on targets which don't have an optimized strlen. It is about twice
as
fast as the original strncat in bench-strncat.
2014-10-24 16:12:12 +00:00
Wilco Dijkstra 6e46de42fe This patch improves strcat performance by using strlen and strcpy. Strlen has a fast C
implementation, so this improves performance even on targets which don't have an optimized
strlen and strcpy - it is 25% faster in bench-strcat. On targets which don't provide an
optimized strcat but which do have an optimized strlen and strcpy, performance gain is > 2x.
2014-10-24 16:08:42 +00:00
Wilco Dijkstra 6a9ad2faee Call libc_fetestexcept_aarch64 from math_private.h rather than duplicating functionality. 2014-10-24 13:23:12 +00:00
Wilco Dijkstra 1c8810ed95 Call libc_feholdexcept_aarch64 from math_private.h rather than duplicating functionality. 2014-10-24 13:21:27 +00:00
Wilco Dijkstra 8b1af712d1 Call get_rounding_mode rather than duplicating functionality. 2014-10-24 13:19:24 +00:00
Wilco Dijkstra a7b00c1101 Cleanup feenableexcept to use the same logic as the ARM version. No functional changes. 2014-10-24 13:07:17 +00:00
Wilco Dijkstra 3a84f1a651 Cleanup fedisableexcept to use the same logic as the ARM version. No functional changes. 2014-10-24 13:06:04 +00:00
Wilco Dijkstra ea9a7c8b06 Cleanup feclearexcept to use the same logic as the ARM version. No functional changes. 2014-10-24 13:03:11 +00:00
Wilco Dijkstra e226de3372 Cleanup fesetexceptflag to use the same logic as the ARM version. No functional changes. 2014-10-24 13:03:09 +00:00
Wilco Dijkstra 6e3d8ed360 Remove an unused include. 2014-10-24 13:03:08 +00:00
Joseph Myers c8bc40386a Move get*id and getgroups definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves various definitions of get*id functions and
getgroups.  The previous C definitions were because of the transition
to 32-bit uids and gids.

Tested for x86.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/arm/getegid.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/syscalls.list (getegid): Add
	syscall.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (getegid): Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list (getegid): Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (getegid):
	Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (getegid): Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (getegid):
	Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getgroups): Likewise.
2014-10-24 13:01:17 +00:00
Joseph Myers 48eb7a94e2 Move some chown / lchown / fchown definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves various definitions of chown, lchown and fchown.

In most cases the need for special syscalls.list entries (rather than
existing generic ones) is because these architectures use chown32,
lchown32 and fchown32 as syscall names.  Some architectures also have
symbol versioning compatibility for older versions of chown having
been equivalent to lchown.

The aliases specified for s390-32 had the effect of exporting
__chown@@GLIBC_2.1 (but not __chown@GLIBC_2.0) despite it not being
listed in Versions files.  (I'm not sure why versioned_symbol but not
compat_symbol were effective like that to create such __chown exports
in the absence of Versions entries.)  The natural way to preserve that
versioned export of __chown seems to be to add it in a Versions file,
so I did so.  (Maybe actually it should be a compat symbol,
__chown@GLIBC_2.1, unless there's a good reason for that export, but
this patch doesn't change anything there.)

Tested for x86.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/i386/chown.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/fchown.c: Remove file.
	* sysdeps/unix/sysv/linux/s390/s390-32/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/Versions (GLIBC_2.1): Add
	__chown.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (chown): Add syscall.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (chown):
	Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (chown): Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (chown):
	Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
2014-10-24 12:59:23 +00:00
Wilco Dijkstra eb04247d5d Remove spaces. 2014-10-24 12:53:19 +00:00
Carlos O'Donell 13d845549e hppa: Make __SIGRTMIN 32 (ABI break).
In the Linux kernel version 3.17 the signal numbers were rearranged in
order to make hppa like every other arch. Previously we started
__SIGRTMIN at 37, and that meant several pieces of important software,
including systemd, would fail to build. To support systemd we removed
SIGEMT and SIGLOST, and rearranged the others according to expected
values. This is technically an ABI incompatible change, but because
zero applications use SIGSTKFLT, SIGXCPU, SIGXFSZ and SIGSYS nothing
broke.  Nothing uses SIGEMT and SIGLOST, and they were present for
HPUX compatibility which is no longer supported. Thus because nothing
breaks we don't do any compatibility work here.

Upstream kernel commit is 1f25df2eff5b25f52c139d3ff31bc883eee9a0ab.

Signed-off-by: Carlos O'Donell <carlos@systemhalted.org>
Signed-off-by: Helge Deller <deller@gmx.de>

2014-10-23  Carlos O'Donell  <carlos@systemhalted.org>
	    Helge Deller <deller@gmx.de>

	[BZ #17508]
	* sysdeps/unix/sysv/linux/hppa/bits/signum.h: Remove SIGEMT.
	Define SIGSTKFLT as 7. Define SIGSYS as 31. Define SIGXCPU as 12.
	Remove SIGLOST. Define SIGXFSZ as 30. Define __SIGRTMIN as 32.
2014-10-23 23:18:19 -04:00
Joseph Myers 15f9c5dfaf Don't use INTDEF for powerpc32 compat symbols (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch removes the use of INTUSE to rename symbols in
sysdeps/powerpc/powerpc32/libgcc-compat.S.  As the names in question
are purely internal to this particular object and not used anywhere
else, it doesn't matter at all whether __*_v_glibc20 or __*_internal
is used, so this patch just removes the macros in question.

Tested for powerpc32 that stripped installed shared libraries are
unchanged by this patch.

	[BZ #14132]
	* sysdeps/powerpc/powerpc32/libgcc-compat.S (__ashldi3_v_glibc20):
	Remove macro definition.
	(__ashrdi3_v_glibc20): Likewise.
	(__lshrdi3_v_glibc20): Likewise.
	(__cmpdi2_v_glibc20): Likewise.
	(__ucmpdi2_v_glibc20): Likewise.
	[!_SOFT_FLOAT && !__NO_FPRS__] (__fixdfdi_v_glibc20): Likewise.
	[!_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__] (__floatdisf_v_glibc20): Likewise.
2014-10-23 21:43:41 +00:00
Roland McGrath c6dfed243e Rework some nscd code not to use variable-length struct types. 2014-10-22 14:28:51 -07:00
Roland McGrath 8c2b1ed8bb ARM: Use movw/movt more when available 2014-10-22 14:20:35 -07:00
Maciej W. Rozycki b5af9297d5 MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference
This satisfies a symbol reference created with:

	.symver	__libc_vfork, vfork@GLIBC_2.0

where `__libc_vfork' has not been defined or referenced.  In this case
the `vfork@GLIBC_2.0' reference is supposed to be discarded, however a
bug present in GAS since forever causes an undefined symbol table entry
to be created.  This in turn triggers a problem in the linker that can
manifest itself by link errors such as:

ld: libpthread.so: invalid string offset 2765592330 >= 5154 for section `.dynstr'

The GAS and linker bugs need to be resolved, but we can avoid them too
by providing a `__libc_vfork' definition just like our other platforms.

	[BZ #17485]
	* sysdeps/unix/sysv/linux/mips/vfork.S (__libc_vfork): Define.
2014-10-22 15:20:37 +01:00
Joseph Myers a13d0d745c Don't use INTDEF with __ldexpf (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch removes the use of INTDEF for __ldexpf.  As far as I can tell,
the resulting alias is completely unused.

Tested for x86_64 that stripped installed shared libraries are
unchanged by this patch.

	[BZ #14132]
	* math/s_ldexpf.c (__ldexpf): Do not use INTDEF.
2014-10-21 23:11:49 +00:00
Roland McGrath f05e73f660 Avoid local PLT reference in __nptl_main. 2014-10-21 10:18:17 -07:00
Roland McGrath 6ab1d1ea96 Tiny refactoring in fts to eliminate a warning. 2014-10-20 15:32:45 -07:00
Roland McGrath e436eb790f NPTL: Clean up gratuitous Linuxism in libpthread.so entry point. 2014-10-20 14:54:12 -07:00
Roland McGrath 6af246cf8b NPTL: Add some missing #include's 2014-10-20 14:46:00 -07:00
Roland McGrath ab49e7630f Make internal lock-init macros return void. 2014-10-20 14:13:14 -07:00
Torvald Riegel f50277c19d pthread_once: Add fast path and remove x86 variants. 2014-10-20 20:28:08 +02:00
Torvald Riegel 63668b7084 pthread_once: Clean up constants.
[BZ #15215] This just gives a name to the integer constants being used.
2014-10-20 18:22:30 +02:00
Joseph Myers 42b7f5d485 Move readv and writev definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves definitions of readv and writev.

The relevant syscalls.list entries were already in
sysdeps/unix/syscalls.list, but to match the C files they needed to
have the names __libc_readv and __libc_writev added.  In fact, I don't
see anything making use of those names - as far as I can tell, these
functions could just be defined as __readv and __writev with aliases
readv and writev.  But cleaning up unnecessary aliases for functions
should be a separate matter from cleaning up unnecessary C syscall
wrappers.

Tested for x86_64.

	[BZ #14138]
	* sysdeps/unix/syscalls.list (readv): Use __libc_readv as strong
	name.
	(writev): Use __libc_writev as strong name.
	* sysdeps/unix/sysv/linux/readv.c: Remove file.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.
2014-10-20 15:49:08 +00:00
Roland McGrath 114c4e0954 Remove obsolete TLS_DEFINE_INIT_TP fallback. 2014-10-17 15:40:36 -07:00
Roland McGrath 674b89786e NPTL: Clean up THREAD_SYSINFO macros. 2014-10-17 15:03:00 -07:00
Roland McGrath 184ee94010 NPTL: Conditionalize direct futex syscall uses. 2014-10-17 14:30:16 -07:00
Roland McGrath 327ae25707 NPTL: Conditionalize more uses of SIGCANCEL and SIGSETXID. 2014-10-17 13:40:46 -07:00
Roland McGrath b0643088bc Fix NPTL build error when missing __NR_set_robust_list. 2014-10-17 11:30:15 -07:00
Siddhesh Poyarekar 33cc770b98 Fix up incorrect formatting in last commit 2014-10-17 15:52:46 +05:30
Leonhard Holz 0742aef6e5 strcoll: improve performance by removing the cache (#15884)
this is a path that should solve bug 15884. It complains about the performance
of strcoll(). It was found out that the runtime of strcoll() is actually bound
to strlen which is needed for calculating the size of a cache that was
installed to improve the comparison performance.

The idea for this patch was that the cache is only useful in rare cases
(strings of same length and same first-level-chars) and that it would be
better to avoid memory allocation at all. To prove this I wrote a performance
test bench-strcoll.c with test data in benchtests-strcoll.tar.gz. Also
modifications in benchtests/Makefile and localedata/Makefile are necessary to
make it work.

After removing the cache the strcoll method showed the predicted behavior
(getting slightly faster) in all but the test case for hindi word sorting.
This was due the hindi text having much more equal words than the other ones.
For equal strings the performance was worse since all comparison levels were
run through and from the second level on the cache improved the comparison
performance of the original version.

Therefore I added a bytewise test via strcmp iff the first level comparison
found that both strings did match because in this case it is very likely that
equal strings are compared. This solved the problem with the hindi test case
and improved the performance of the others.

Performance comparison:

glibc files     -33.77%
vi_VN.UTF-8     -34.12%
en_US.UTF-8     -42.42%
ar_SA.UTF-8     -27.49%
zh_CN.UTF-8     +07.90%
cs_CZ.UTF-8     -29.67%
en_GB.UTF-8     -28.50%
da_DK.UTF-8     -36.57%
pl_PL.UTF-8     -39.31%
fr_FR.UTF-8     -28.57%
pt_PT.UTF-8     -22.82%
el_GR.UTF-8     -26.77%
ru_RU.UTF-8     -35.81%
iw_IL.UTF-8     -35.34%
es_ES.UTF-8     -34.46%
hi_IN.UTF-8     -00.38%
sv_SE.UTF-8     -36.99%
hu_HU.UTF-8     -16.35%
tr_TR.UTF-8     -27.80%
is_IS.UTF-8     -33.24%
it_IT.UTF-8     -24.39%
sr_RS.UTF-8     -37.55%
ja_JP.UTF-8     +02.84%
2014-10-17 15:47:23 +05:30
Roland McGrath ee54ce44cb Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
Joseph Myers a75d3b0288 conformtest: clean up POSIX expections for sys/utsname.h, sys/wait.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/utsname.h and
sys/wait.h.  Tested x86_64; a new XFAIL for sys/wait.h is added.

	* conform/data/sys/utsname.h-data (*_t): Allow.
	* conform/data/sys/wait.h-data [POSIX] (uid_t): Do not define.
	[POSIX] (WEXITED): Do not expect constant.
	[POSIX] (WSTOPPED): Likewise.
	[POSIX] (WNOHANG): Likewise.
	[POSIX] (WNOWAIT): Likewise.
	[POSIX] (siginfo_t): Do not expect type or elements.
	[POSIX] (pid_t): Do not expect type.
	[POSIX] (signal.h): Do not allow header.
	[POSIX] (sys/resource.h): Likewise.
	[POSIX] (si_*): Do not allow pattern.
	[POSIX] (W*): Likewise.
	[POSIX] (P_*): Likewise.
	[POSIX] (BUS_*): Likewise.
	[POSIX] (CLD_*): Likewise.
	[POSIX] (FPE_*): Likewise.
	[POSIX] (ILL_*): Likewise.
	[POSIX] (POLL_*): Likewise.
	[POSIX] (SEGV_*): Likewise.
	[POSIX] (SI_*): Likewise.
	[POSIX] (TRAP_*): Likewise.
	* conform/Makefile (test-xfail-POSIX/sys/wait.h/conform): New
	variable.
2014-10-14 17:00:11 +00:00
Siddhesh Poyarekar fda389c8f0 Fix infinite loop in check_pf (BZ #12926)
The recvmsg could return 0 under some conditions and cause the
make_request function to be stuck in an infinite loop.

Thank you Jim King <jim.king@simplivity.com> for posting Paul's patch
on the list.
2014-10-14 21:05:33 +05:30
Joseph Myers fcb32af153 Remove CANCEL-FCT-WAIVE and CANCEL-FILE-WAIVE.
As far as I can tell, CANCEL-FCT-WAIVE and CANCEL-FILE-WAIVE are old
notes from the addition of cancellation support to glibc and are not
currently used by any glibc testcases or otherwise in the build
process, and it does not seem useful to me to keep them around.  This
patch removes them.

Tested for x86_64.

	* CANCEL-FCT-WAIVE: Remove file.
	* CANCEL-FILE-WAIVE: Likewise.
2014-10-10 17:05:58 +00:00
Joseph Myers 6bc6bd3b10 Don't use INTVARDEF/INTUSE with __libc_enable_secure (bug 14132).
Continuing the removal of the obsolete INTDEF / INTVARDEF / INTUSE
mechanism, this patch replaces its use for __libc_enable_secure with
the use of rtld_hidden_data_def and rtld_hidden_proto.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

	[BZ #14132]
	* elf/dl-sysdep.c (__libc_enable_secure): Use rtld_hidden_data_def
	instead of INTVARDEF.
	(_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure.
	* sysdeps/mach/hurd/dl-sysdep.c (__libc_enable_secure): Use
	rtld_hidden_data_def instead of INTVARDEF.
	(_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure.
	* elf/dl-deps.c (expand_dst): Likewise.
	* elf/dl-load.c (_dl_dst_count): Likewise.
	(_dl_dst_substitute): Likewise.
	(decompose_rpath): Likewise.
	(_dl_init_paths): Likewise.
	(open_path): Likewise.
	(_dl_map_object): Likewise.
	* elf/rtld.c (dl_main): Likewise.
	(process_dl_audit): Likewise.
	(process_envvars): Likewise.
	* include/unistd.h [IS_IN_rtld] (__libc_enable_secure_internal):
	Remove declaration.
	(__libc_enable_secure): Use rtld_hidden_proto.
2014-10-10 11:13:11 +00:00
Kostya Serebryany b8c80a7e0d remove nested functions from elf/dl-load.c 2014-10-09 11:15:24 -07:00
Joseph Myers 5c0508a318 soft-fp: Use parentheses around macro arguments.
This patch cleans up the soft-fp code to use parentheses around macro
arguments (where possible; many macro arguments are identifiers used
with ## rather than arbitrary expressions, so cannot be put in
parentheses).  (I'm not aware of any bugs caused by the lack of
parentheses, but this is generally good practice.  The patch is not
exhaustive regarding internal macros where the arguments always come
directly from the mantissa of a floating-point number, although
probably those should be cleaned up in this regard as well.)

Tested for powerpc-nofpu that the installed shared libraries are
unchanged by this patch.

	* soft-fp/double.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_D): Use
	parentheses around macro arguments.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_DP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_DP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_DP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_DP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_DP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_DP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (_FP_SQRT_MEAT_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_EQ_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_UNORD_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_TO_INT_D): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_FROM_INT_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_DP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_DP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_DP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_DP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_DP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_DP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (_FP_SQRT_MEAT_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_EQ_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_UNORD_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_D): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_FROM_INT_D): Likewise.
	* soft-fp/extended.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_E):
	Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_EP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_EP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_EP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_EP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (_FP_SQRT_MEAT_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_EQ_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_UNORD_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_TO_INT_E): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_FROM_INT_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_EP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_EP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_EP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_EP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (_FP_SQRT_MEAT_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_EQ_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_UNORD_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_E): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_FROM_INT_E): Likewise.
	* soft-fp/op-1.h (_FP_FRAC_SRST_1): Likewise.
	(_FP_FRAC_SRS_1): Likewise.
	(_FP_FRAC_CLZ_1): Likewise.
	(_FP_MUL_MEAT_1_imm): Likewise.
	(_FP_MUL_MEAT_1_wide): Likewise.
	(_FP_MUL_MEAT_1_hard): Likewise.
	(_FP_SQRT_MEAT_1): Likewise.
	(_FP_FRAC_ASSEMBLE_1): Likewise.
	(_FP_FRAC_DISASSEMBLE_1): Likewise.
	* soft-fp/op-2.h (_FP_FRAC_CLZ_2): Likewise.
	(__FP_CLZ_2): Likewise.
	(_FP_MUL_MEAT_2_wide): Likewise.
	(_FP_MUL_MEAT_2_wide_3mul): Likewise.
	(_FP_MUL_MEAT_2_gmp): Likewise.
	(_FP_MUL_MEAT_2_120_240_double): Likewise.
	(_FP_SQRT_MEAT_2): Likewise.
	(_FP_FRAC_ASSEMBLE_2): Likewise.
	(_FP_FRAC_DISASSEMBLE_2): Likewise.
	* soft-fp/op-4.h (_FP_FRAC_SRS_4): Likewise.
	(_FP_FRAC_CLZ_4): Likewise.
	(_FP_MUL_MEAT_4_wide): Likewise.
	(_FP_MUL_MEAT_4_gmp): Likewise.
	(_FP_SQRT_MEAT_4): Likewise.
	(_FP_FRAC_ASSEMBLE_4): Likewise.
	(_FP_FRAC_DISASSEMBLE_4): Likewise.
	* soft-fp/op-common.h (_FP_CMP): Likewise.
	(_FP_CMP_EQ): Likewise.
	(_FP_CMP_UNORD): Likewise.
	(_FP_TO_INT): Likewise.
	(_FP_FROM_INT): Likewise.
	[!__FP_CLZ] (__FP_CLZ): Likewise.
	(_FP_DIV_HELP_imm): Likewise.
	* soft-fp/quad.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_Q):
	Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_QP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_QP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_QP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_QP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_QP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_QP): Likewise.
	[_FP_W_TYPE_SIZE < 64] (_FP_SQRT_MEAT_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_EQ_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_CMP_UNORD_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_TO_INT_Q): Likewise.
	[_FP_W_TYPE_SIZE < 64] (FP_FROM_INT_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_QP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_QP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_QP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_QP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_QP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_QP): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (_FP_SQRT_MEAT_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_EQ_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_CMP_UNORD_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_Q): Likewise.
	[_FP_W_TYPE_SIZE >= 64] (FP_FROM_INT_Q): Likewise.
	* soft-fp/single.h (FP_UNPACK_RAW_S): Likewise.
	(FP_UNPACK_RAW_SP): Likewise.
	(FP_PACK_RAW_S): Likewise.
	(FP_PACK_RAW_SP): Likewise.
	(FP_UNPACK_S): Likewise.
	(FP_UNPACK_SP): Likewise.
	(FP_UNPACK_SEMIRAW_S): Likewise.
	(FP_UNPACK_SEMIRAW_SP): Likewise.
	(FP_PACK_S): Likewise.
	(FP_PACK_SP): Likewise.
	(FP_PACK_SEMIRAW_S): Likewise.
	(FP_PACK_SEMIRAW_SP): Likewise.
	(_FP_SQRT_MEAT_S): Likewise.
	(FP_CMP_S): Likewise.
	(FP_CMP_EQ_S): Likewise.
	(FP_CMP_UNORD_S): Likewise.
	(FP_TO_INT_S): Likewise.
	(FP_FROM_INT_S): Likewise.
2014-10-09 17:05:26 +00:00
Joseph Myers a736ec370a soft-fp: Support rsigned == 2 in _FP_TO_INT.
Continuing the addition of soft-fp features in the Linux kernel
version, this patch adds _FP_TO_INT support for rsigned == 2 (reduce
overflowing results modulo 2^rsize to fit in the destination, used for
alpha emulation).

The kernel version is buggy; it can left shift by a negative amount
when right shifting is required in an overflow case (the kernel
version also has other bugs fixed long ago in glibc; at least,
spurious exceptions converting to the most negative integer).  This
version avoids that by handling overflow (other than to 0) for rsigned
== 2 along with the normal non-overflow case, which already properly
determines the direction in which to shift.

Tested for powerpc-nofpu.  Some functions get slightly bigger and some
get slightly smaller, no doubt as a result of the change to where in
the macro "inexact" is raised, but I don't think those changes are
significant.  Also tested for powerpc-nofpu with the relevant __fix*
functions changed to use rsigned == 2 (which is after all just as
valid as rsigned == 1 in IEEE terms), including verifying the results
and exceptions for various cases of conversions.

With these seven patches, the one remaining feature to add for the
soft-fp code to have all the features of the kernel version is
_FP_TO_INT_ROUND.

	* soft-fp/op-common.h (_FP_TO_INT): Handle rsigned == 2.
2014-10-09 15:00:37 +00:00
Joseph Myers ff12c11f45 soft-fp: Support more precise "invalid" exceptions.
As previously discussed
<https://sourceware.org/ml/libc-alpha/2013-10/msg00345.html>, it would
be desirable to be able to use the same version of the soft-fp code in
the Linux kernel as well as in glibc and libgcc (instead of an old
version in the kernel that's missing ten years of bug fixes,
performance improvements and new features), and to that end it is
useful to add to glibc's copy features in the kernel's copy, even when
they are not directly useful in glibc.

To that end, this patch adds one of those features: support for more
precise "invalid" exceptions describing the particular kind of invalid
operation.  These are relevant for powerpc emulation, and are also as
described in IEEE 754-2008 as sub-exceptions.

The set of sub-exceptions here is the union of those supported on
powerpc and those from IEEE 754-2008 (the former adds a distinction
between 0/0 and Inf/Inf; the latter adds a distinction between Inf*0
from multiplication and the same from fma).  This includes
sub-exceptions for sqrt, conversions to integer and comparisons that
are not supported in the kernel; I see no obvious reason for these
being missing from the kernel support, given that they are supported
on powerpc so accurate powerpc emulation should generate them.

Tested for powerpc-nofpu that the disassembly of installed shared
libraries is unchanged by this patch.

	* soft-fp/soft-fp.h (FP_EX_INVALID_SNAN): New macro.
	(FP_EX_INVALID_IMZ): Likewise.
	(FP_EX_INVALID_IMZ_FMA): Likewise.
	(FP_EX_INVALID_ISI): Likewise.
	(FP_EX_INVALID_ZDZ): Likewise.
	(FP_EX_INVALID_IDI): Likewise.
	(FP_EX_INVALID_SQRT): Likewise.
	(FP_EX_INVALID_CVI): Likewise.
	(FP_EX_INVALID_VC): Likewise.
	* soft-fp/op-common.h (_FP_UNPACK_CANONICAL): Specify more precise
	"invalid" exceptions.
	(_FP_CHECK_SIGNAN_SEMIRAW): Likewise.
	(_FP_ADD_INTERNAL): Likewise.
	(_FP_MUL): Likewise.
	(_FP_FMA): Likewise.
	(_FP_DIV): Likewise.
	(_FP_CMP_CHECK_NAN): Likewise.
	(_FP_SQRT): Likewise.
	(_FP_TO_INT): Likewise.
	(FP_EXTEND): Likewise.
2014-10-09 14:59:23 +00:00
Allan McRae b6dcfe8c24 Update French translation 2014-10-09 22:11:30 +10:00
Joseph Myers cb8312455b Don't use INTDEF/INTUSE with __cxa_atexit (bug 14132).
This patch removes use of the obsolete INTDEF/INTUSE mechanism for
__cxa_atexit, replacing it with libc_hidden_def/libc_hidden_proto.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

	[BZ #14132]
	* stdlib/cxa_atexit.c (__cxa_atexit): Use libc_hidden_def instead
	of INTDEF.
	* include/stdlib.h (__cxa_atexit_internal): Remove declaration.
	(__cxa_atexit): Use libc_hidden_proto.
	[!NOT_IN_libc] (__cxa_atexit): Remove macro definition.
2014-10-09 11:22:33 +00:00
Joseph Myers 5deeb19014 Remove stray *_internal aliases (bug 14132).
This patch removes some stray (unused) *_internal aliases, and
function prototypes with no corresponding definitions at all, at least
some of which were missed in previous INTDEF / INTUSE removal.

Not removed in this patch: __canonicalize_directory_name_internal,
noticed in the course of preparing this patch, isn't an alias, but an
actual function in sysdeps/mach/hurd/getcwd.c - apparently unused,
however.

Tested for x86_64 that installed stripped shared libraries are
unchanged by this patch.

	[BZ #14132]
	* include/wctype.h [!_ISOMAC] (__iswalpha_l_internal): Remove
	declaration.
	[!_ISOMAC] (__iswdigit_l_internal): Likewise.
	[!_ISOMAC] (__iswspace_l_internal): Likewise.
	[!_ISOMAC] (__iswxdigit_l_internal): Likewise.
	[!_ISOMAC] (__iswctype_internal): Likewise.
	* stdio-common/siglist.c (_sys_siglist_internal): Remove alias.
	* sysdeps/unix/syscalls.list (chown): Remove __chown_internal
	alias.
	(fcntl): Remove __fcntl_internal alias.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (connect): Remove
	__connect_internal alias.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (connect):
	Likewise.
2014-10-09 01:11:14 +00:00
Joseph Myers 454ac701e3 soft-fp: Add FP_DENORM_ZERO.
Continuing the addition of soft-fp features used in the Linux kernel,
this patch adds soft-fp support for FP_DENORM_ZERO (flushing input
subnormal operands to zero of the same sign).

There are some differences from the kernel version.  In the kernel,
the "inexact" exception is set when flushing to zero.  This does not
appear to match the documented semantics for either of the
architectures (alpha and sh) for which the kernel uses FP_DENORM_ZERO,
so this patch does not set "inexact" in this case.  More operations
now use raw or semi-raw unpacking for optimization than did in the
ten-year-old soft-fp version in the kernel, so checks of
FP_DENORM_ZERO are inserted in those operations.  They are also
inserted for comparisons (which already used raw unpacking in the old
version) as I believe that's the correct thing to do when input
subnormals are flushed to zero.  They are *not* inserted for _FP_NEG.
(If any processors do flush input subnormals to zero for negation, or
otherwise vary from the rules implemented when FP_DENORM_ZERO is set,
further macros for sfp-machine.h to control this may need to be
added.)

Although the addition for comparisons will cause FP_EX_DENORM to be
set in this case, it still won't be set for comparisons involving
subnormals when not flushed to zero.  It's quite possible that
accurate emulation of processors that have such an exception for
subnormal operands will require further changes relating to when
FP_EX_DENORM is set (in general, the support for things defined by
IEEE should be considered more reliable and mature than the support
for things outside the scope of IEEE floating point).

Although some processors also have a mode for abrupt underflow -
producing zeroes instead of output subnormals - there is no such mode
in the kernel's soft-fp, so no such mode is added to glibc's soft-fp
(although it could be if someone wanted to emulate such processor
support).

Tested for powerpc-nofpu that the disassembly of installed shared
libraries is unchanged by this patch.

	* soft-fp/soft-fp.h (FP_DENORM_ZERO): New macro.
	* soft-fp/op-common.h (_FP_UNPACK_CANONICAL): Check
	FP_DENORM_ZERO.
	(_FP_CHECK_FLUSH_ZERO): New macro.
	(_FP_ADD_INTERNAL): Call _FP_CHECK_FLUSH_ZERO.
	(_FP_CMP): Likewise.
	(_FP_CMP_EQ): Likewise.
	(_FP_TO_INT): Do not set inexact for subnormal arguments if
	FP_DENORM_ZERO.
	(FP_EXTEND): Call _FP_CHECK_FLUSH_ZERO.
	(FP_TRUNC): Likewise.
2014-10-09 01:09:22 +00:00