Commit Graph

8239 Commits

Author SHA1 Message Date
Liubov Dmitrieva d086fc7ba0 Set fast unaligned load flag for new Intel microarchitecture
I have small patch for new Intel Silvermont machines.

http://newsroom.intel.com/community/intel_newsroom/blog/2013/05/06/intel-launches-low-power-high-performance-silvermont-microarchitecture

I checked this on my machine and see that strcpy, ... unaligned
versions are faster than ssse3 versions.
2013-06-14 20:46:15 +02:00
Siddhesh Poyarekar 747ef469ff Add rtld-memset.S for x86_64
Resolves: BZ #15627

Add an assembler version of rtld-memset to avoid using SSE registers.
2013-06-15 00:09:26 +05:30
Siddhesh Poyarekar 58206c6863 Improve precision of clock() function on Linux
Resolves #12515.

Use CLOCK_PROCESS_CPUTIME_ID instead of times to get better precision
in the value returned by clock.
2013-06-13 09:54:35 +05:30
Adhemerval Zanella 6a97b62a5b Fix unsafe compiler optimization
GCC 4.8 enables -ftree-loop-distribute-patterns at -O3 by default and
this optimization may transform loops into memset/memmove calls. Without
proper handling this may generate unexpected PLT calls on GLIBC.
This patch fixes by create memset/memmove alias to internal GLIBC
__GI_memset/__GI_memmove symbols.
2013-06-12 10:21:22 -05:00
Siddhesh Poyarekar 2506109403 Set/restore rounding mode only when needed
The most common use case of math functions is with default rounding
mode, i.e. rounding to nearest.  Setting and restoring rounding mode
is an unnecessary overhead for this, so I've added support for a
context, which does the set/restore only if the FP status needs a
change.  The code is written such that only x86 uses these.  Other
architectures should be unaffected by it, but would definitely benefit
if the set/restore has as much overhead relative to the rest of the
code, as the x86 bits do.

Here's a summary of the performance improvement due to these
improvements; I've only mentioned functions that use the set/restore
and have benchmark inputs for x86_64:

Before:

cos(): ITERS:4.69335e+08: TOTAL:28884.6Mcy, MAX:4080.28cy, MIN:57.562cy, 16248.6 calls/Mcy
exp(): ITERS:4.47604e+08: TOTAL:28796.2Mcy, MAX:207.721cy, MIN:62.385cy, 15543.9 calls/Mcy
pow(): ITERS:1.63485e+08: TOTAL:28879.9Mcy, MAX:362.255cy, MIN:172.469cy, 5660.86 calls/Mcy
sin(): ITERS:3.89578e+08: TOTAL:28900Mcy, MAX:704.859cy, MIN:47.583cy, 13480.2 calls/Mcy
tan(): ITERS:7.0971e+07: TOTAL:28902.2Mcy, MAX:1357.79cy, MIN:388.58cy, 2455.55 calls/Mcy

After:

cos(): ITERS:6.0014e+08: TOTAL:28875.9Mcy, MAX:364.283cy, MIN:45.716cy, 20783.4 calls/Mcy
exp(): ITERS:5.48578e+08: TOTAL:28764.9Mcy, MAX:191.617cy, MIN:51.011cy, 19071.1 calls/Mcy
pow(): ITERS:1.70013e+08: TOTAL:28873.6Mcy, MAX:689.522cy, MIN:163.989cy, 5888.18 calls/Mcy
sin(): ITERS:4.64079e+08: TOTAL:28891.5Mcy, MAX:6959.3cy, MIN:36.189cy, 16062.8 calls/Mcy
tan(): ITERS:7.2354e+07: TOTAL:28898.9Mcy, MAX:1295.57cy, MIN:380.698cy, 2503.7 calls/Mcy

So the improvements are:

cos: 27.9089%
exp: 22.6919%
pow: 4.01564%
sin: 19.1585%
tan: 1.96086%

The downside of the change is that it will have an adverse performance
impact on non-default rounding modes, but I think the tradeoff is
justified.
2013-06-12 10:36:48 +05:30
Joseph Myers f1d73d30df Add exception information to math-tests.h and use it in libm-test.inc. 2013-06-11 15:44:31 +00:00
Ryan S. Arnold fac0c5f2b1 PowerPC: Merge ports/ dl-procinfo.[ch] with base. 2013-06-11 10:13:39 -05:00
Siddhesh Poyarekar 89fb683558 Fix symbol definitions for __clock_* functions
__clock_gettime and other __clock_* functions could result in an extra
PLT reference within libc.so if it actually gets used.  None of the
code currently uses them, which is why this probably went unnoticed.
2013-06-11 11:11:11 +05:30
Joseph Myers 0efa6f8b99 Add rounding mode information to math-tests.h and use it in libm-test.inc. 2013-06-10 12:34:49 +00:00
Joseph Myers 4902d2c3f7 Avoid trailing whitespace in sysdeps/gnu/errlist.c. 2013-06-08 14:55:32 +00:00
Joseph Myers 60d2f8f3c7 Use (void) in no-arguments function definitions. 2013-06-08 00:22:23 +00:00
Joseph Myers 2e09a79ada Avoid use of "register" as optimization hint. 2013-06-07 22:24:35 +00:00
Ondrej Bilka 350635a59a Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
Joseph Myers 9c84384cc1 Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
Siddhesh Poyarekar 4c60cb0c83 Skip modifying exception mask and flags in SET_RESTORE_ROUND_53BIT
We only need to set/restore rounding mode to ensure correct
computation for non-default rounding modes.
2013-06-05 13:56:19 +05:30
Joseph Myers fab7ce3f5b Link extra-libs consistently with libc and ld.so. 2013-05-31 16:16:33 +00:00
Jeff Law 96945714ec [BZ #14256]
* manual/errno.texi (ESTALE): Update to account for more than
        just NFS file systems.
        * sysdeps/gnu/errlist.c: Regenerated.
2013-05-30 05:51:22 -06:00
Siddhesh Poyarekar b937534868 Avoid crashing in LD_DEBUG when program name is unavailable
Resolves: #15465

The program name may be unavailable if the user application tampers
with argc and argv[].  Some parts of the dynamic linker caters for
this while others don't, so this patch consolidates the check and
fallback into a single macro and updates all users.
2013-05-29 21:34:12 +05:30
Adhemerval Zanella 5e056687df Update powerpc libm-test ULPs. 2013-05-28 08:39:00 -05:00
Thomas Schwinge 07b4c13d0b _dl_skip_args declaration cleanup.
* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start:go): Don't
	declare _dl_skip_args.

Continuation of commit 8347c74cc5.
2013-05-26 19:48:25 +02:00
Thomas Schwinge ec9dd97cec _dl_non_dynamic_init declaration cleanup.
* sysdeps/mach/hurd/i386/init-first.c (_dl_non_dynamic_init):
	Don't declare.

Continuation of commit bc16e260d0.
2013-05-26 18:53:19 +02:00
Joseph Myers 0323d08657 Fix ldbl-96 hypotl of subnormals (bug 15529). 2013-05-24 20:52:55 +00:00
Joseph Myers dd4259b9f7 Test drem and pow10 in libm-test.inc. 2013-05-24 20:33:14 +00:00
Joseph Myers 4f8dfe270b Use same tests for isfinite/finite, lgamma/gamma. 2013-05-24 19:21:22 +00:00
Adhemerval Zanella d116b7c414 PowerPC: Program Priority Register support
This patch add inline functions to change the Program Priority Register
from ISA 2.05.
2013-05-24 13:29:30 -05:00
Edjunior Machado 9323d39bae PowerPC: Add functions for shared resources hints. 2013-05-23 10:32:47 -05:00
Edjunior Barbosa Machado 85118d4de3 Update bits/siginfo.h with Linux hwpoison SIGBUS changes
Adds new SIGBUS error codes for hardware poison signals, syncing with
the current kernel headers (v3.9). It also adds si_trapno field for
alpha.
2013-05-22 14:19:49 -05:00
Joseph Myers b50a71810b Don't include expected results in libm-test test names. 2013-05-22 11:49:36 +00:00
Siddhesh Poyarekar 3d04f5db20 Set EAI_SYSTEM only when h_errno is NETDB_INTERNAL
Fixes BZ #15339.

NSS_STATUS_UNAVAIL may mean that a necessary input resource is not
available.  This could occur in a number of cases including when the
network is down, system runs out of file descriptors, etc.  The
correct differentiator in such a case is the h_errno, which gives the
nature of failure.  In case of failures other than a simple 'not
found', we set h_errno as NETDB_INTERNAL and let errno be the
identifier for the exact error.
2013-05-21 21:54:41 +05:30
Ondrej Bilka b2b671b677 Faster memset on x64
This implementation speed up memset in several ways. First is avoiding
expensive computed jump. Second is using fact that arguments of memset
are most of time aligned to 8 bytes.

Benchmark results on:
kam.mff.cuni.cz/~ondra/benchmark_string/memset_profile_result27_04_13.tar.bz2
2013-05-20 08:32:45 +02:00
Ondrej Bilka 2d48b41c8f Faster memcpy on x64.
We add new memcpy version that uses unaligned loads which are fast
on modern processors. This allows second improvement which is avoiding
computed jump which is relatively expensive operation.

Tests available here:
http://kam.mff.cuni.cz/~ondra/memcpy_profile_result27_04_13.tar.bz2
2013-05-20 08:24:41 +02:00
Joseph Myers 3e69426875 Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490). 2013-05-19 18:40:25 +00:00
Joseph Myers db62a90753 Handle sincos with generic libm-test logic. 2013-05-19 14:45:41 +00:00
Joseph Myers bb38759d6d Fix remainder exceptions and directed-rounding results (bugs 15480, 15485). 2013-05-17 19:04:08 +00:00
Adhemerval Zanella 13d3b41a36 PowerPC: fix hypot/hypotf check for -INF 2013-05-17 08:15:59 -05:00
Maciej W. Rozycki 2848b10585 MIPS: soft-fp NaN representation corrections
[BZ #15442] This adds support for the inverse interpretation of the
quiet bit of IEEE 754 floating-point NaN data that some processors
use.  This includes in particular MIPS architecture processors; the
payload used for the canonical qNaN encoding is updated accordingly
so as not to interfere with the quiet bit.
2013-05-16 23:33:55 +01:00
Ryan S. Arnold e054f49430 Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
Peter Collingbourne 1deff3dca1 Use movq for 64-bit operations
The EXTRACT_WORDS64 and INSERT_WORDS64 macros use movd for a 64-bit
operation.  Somehow gcc manages to turn this into movq, but LLVM won't.

2013-05-15  Peter Collingbourne  <pcc@google.com>

	* sysdeps/x86_64/fpu/math_private.h (MOVQ): New macro.
	(EXTRACT_WORDS64) Use where appropriate.
	(INSERT_WORDS64) Likewise.
2013-05-15 20:33:45 +02:00
Peter Collingbourne 791f3ba0db Use x constraints for operands to vfmaddss and vfmaddsd
While these instructions accept memory operands, only one operand
may be a memory operand.  Giving two operands xm constraints gives
the compiler the option of using memory for both operands, which
would result in invalid assembly code.  Using x for all operands is
more appropriate, as most x86_64 calling conventions will pass the
arguments in registers anyway.

2013-05-15  Peter Collingbourne  <pcc@google.com>

	* sysdeps/x86_64/fpu/multiarch/s_fma.c (__fma_fma4): Replace xm
	constraints with x constraints.
	* sysdeps/x86_64/fpu/multiarch/s_fmaf.c (__fmaf_fma4): Likewise.
2013-05-15 20:31:53 +02:00
Edjunior Machado 12fba011bd Update s390/bits/siginfo.h
2013-05-15  Edjunior Machado  <emachado@linux.vnet.ibm.com>

	* sysdeps/unix/sysv/linux/s390/bits/siginfo.h (siginfo_t):
	Remove si_trapno and add si_addr_lsb to _sifields.sigfault.
	(si_trapno): Remove macro.
	(si_addr_lsb): Define new macro.
	(BUS_MCEERR_AR, BUS_MCEERR_AO): Define new values.
2013-05-15 20:15:19 +02:00
David S. Miller 781fd74820 Update Sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2013-05-14 15:44:29 -07:00
Siddhesh Poyarekar 0f7d347bd0 Make _LIB_VERSION a weak symbol
That way it can live alongside _LIB_VERSION in libieee.a for
statically compiled programs.

Resolves #14582.
2013-05-13 11:46:36 +05:30
Joseph Myers 601a3a5fd5 Convert TEST_ff_f tests from code to data. 2013-05-12 13:17:09 +00:00
Christian Grönke 7187d844a1 Add getgid.c for SH
[BZ #12387]
	* sysdeps/unix/sysv/linux/sh/getgid.c: New file.
2013-05-10 20:42:24 +02:00
Pino Toscano f63fae7378 Hurd: add ST_NOATIME 2013-05-10 20:39:32 +02:00
Andreas Jaeger 8a67a4b343 Fix integer overflow in sysdeps/unix/sysv/linux/bits/sched.h
[BZ #15448]
	* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_SET_S)
	(__CPU_CLR_S, __CPU_ISSET_S): Avoid integer overflow.
2013-05-10 20:28:40 +02:00
Joseph Myers ed41ffefc3 Fix ldbl-128ibm cos range reduction near pi/2 (bug 15359). 2013-05-09 21:30:08 +00:00
Joseph Myers d0213cd0b6 Fix ldbl-128 cos range reduction near pi/2 (bug 15429). 2013-05-09 21:28:54 +00:00
Adhemerval Zanella e9a5e0fd54 Update powerpc libm-test ULPs 2013-05-08 15:06:56 -05:00
Joseph Myers d8cd06db62 Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426). 2013-05-08 11:58:18 +00:00
Roland McGrath 8347c74cc5 Declare _dl_skip_args in ldsodefs.h header. 2013-05-07 14:49:26 -07:00
Roland McGrath a917305749 Fix glob64 broken by cleanup. 2013-05-06 17:11:12 -07:00
Roland McGrath 9723ffc524 Move dummy glob64.c alongside glob.c that defines glob64. 2013-05-06 16:11:11 -07:00
Roland McGrath 962e6658a3 Flesh out stub not-cancel.h file. 2013-05-06 16:03:35 -07:00
Roland McGrath c74058300c Clean up POSIX.1 implementation of truncate. 2013-05-06 14:56:13 -07:00
Adhemerval Zanella 16e616a72f PowerPC: fix hypot/hypof FP exceptions
This patch fixes hypot/hypotf spurious floating-point exceptions
generate by internal operations.
2013-05-06 14:40:17 -05:00
Roland McGrath d5e8275481 Split _dl_writev out from _dl_debug_vdprintf. 2013-05-06 11:30:41 -07:00
Roland McGrath cc0e6ed81f Consolidate definitions of _FORTIFY_SOURCE wrappers for open{,64}{,at}. 2013-05-03 16:33:26 -07:00
Adhemerval Zanella 83e7640f6b PowerPC: Add time vDSO support
PowerPC kernel now provides a vDSO implementation for time syscall
(commit fcb41a2030abe0eb716ef0798035ef9562097f42). This patch changes
time syscall wrapper to use the vDSO when available. It also changes
the default non vDSO time on PowerPC to use sysdeps/posix/time.c
(since gettimeofday is a vDSO call).
2013-05-03 15:04:54 -05:00
Andreas Jaeger 164fd39d05 Sync with Linux 3.9
* sysdeps/gnu/netinet/tcp.h (TCP_TIMESTAMP): New value, from
	Linux 3.9.
	* sysdeps/unix/sysv/linux/bits/socket.h (PF_VSOCK, AF_VSOCK):
	Add.
	(PF_MAX): Adjust for VSOCK change.
2013-05-03 20:52:00 +02:00
Adhemerval Zanella 8237f48c90 Update powerpc libm-test ULPs 2013-05-03 07:33:49 -05:00
David S. Miller d422395e31 Update Sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2013-05-02 12:25:28 -07:00
Roland McGrath 1324e37f2e Add missing #include in sysdeps/posix/opendir.c. 2013-05-01 09:27:09 -07:00
Joseph Myers 10de07f5fd Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
Adhemerval Zanella cb4d54147e Update powerpc libm-test ULPs 2013-04-30 08:51:02 -05:00
Joseph Myers caf84319c1 Fix catan, catanh inaccuracy from atan2 denominators near 0 (bug 15416). 2013-04-30 11:27:35 +00:00
Siddhesh Poyarekar 6dbe713d85 Format s_sin.c 2013-04-30 14:18:57 +05:30
Adhemerval Zanella 7e7b6f36a9 Update powerpc libm-test ULPs 2013-04-29 12:10:03 -05:00
Joseph Myers 5b4217d71f Fix catan, catanh spurious overflows (bug 15409). 2013-04-27 14:57:41 +00:00
Allan McRae 4721b2d1ca Update i386 libm-test ULPs 2013-04-27 15:13:12 +10:00
Adhemerval Zanella aa630f590c PowerPC: modf optimization fix
This patch fix the 3c0265394d commits
by correctly setting minimum architecture for modf PPC optimization
to power5+ instead of power5 (since only on power5+ round/ceil will
be inline to inline assembly).
2013-04-26 13:00:56 -05:00
Markus Trippelsdorf 1b8359836d Update x86_64 ULPs
2013-04-26  Markus Trippelsdorf  <markus@trippelsdorf.de>

	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
2013-04-26 09:30:46 +02:00
Joseph Myers 73709b2611 Move x86_64-specific audit tests to sysdeps/x86_64/. 2013-04-25 19:23:11 +00:00
Paul Pluzhnikov 1ef74943ce Get rid of __STDC_FORMAT_MACROS, __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS 2013-04-25 11:08:31 -07:00
Joseph Myers 2f38fbfe09 Fix catan, catanh inaccuracy through use of log (bug 15394). 2013-04-24 18:49:13 +00:00
Roland McGrath d6f9bc519d Fix name space use in last commit. 2013-04-23 15:57:25 -07:00
Roland McGrath 87f51853ce Add generic POSIX implementation of C11 timespec_get. 2013-04-23 15:28:59 -07:00
Adhemerval Zanella 3c0265394d PowerPC: modf optimization
This patch implements modf/modff optimization for POWER by focus
on FP operations instead of relying in integer ones.
2013-04-23 13:38:52 -05:00
Heiko Carstens 5c95f7b66b S/390: Change struct statfs[64] member types to unsigned values
Kay Sievers reported that coreutils' stat tool has a problem with
s390's statfs[64] definition:

> The definition of struct statfs::f_type needs a fix. s390 is the only
> architecture in the kernel that uses an int and expects magic
> constants lager than INT_MAX to fit into.
>
> A fix is needed to make Fedora boot on s390, it currently fails to do
> so. Userspace does not want to add code to paper-over this issue.

[...]

> Even coreutils cannot handle it:
>   #define RAMFS_MAGIC  0x858458f6
>   # stat -f -c%t /
>   ffffffff858458f6
>
>   #define BTRFS_SUPER_MAGIC 0x9123683E
>   # stat -f -c%t /mnt
>   ffffffff9123683e

The bug is caused by an implicit sign extension within the stat tool:

out_uint_x (pformat, prefix_len, statfsbuf->f_type);

where the format finally will be "%lx".
A similar problem can be found in the 'tail' tool.
s390 is the only architecture which has an int type f_type member in
struct statfs[64]. Other architectures have either unsigned ints or
long values, so that the problem doesn't occur there.

Therefore change the type of the f_type member to unsigned int, so
that we get zero extension instead sign extension when assignment to
a long value happens.

Reported-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2013-04-23 08:59:35 +02:00
Siddhesh Poyarekar 2169712d9c Minor cleanup in getaddrinfo
Replace repeated computations of alloca size with a local variable
that stores the computed value.
2013-04-22 10:24:00 +05:30
Adam Conrad ccdad15df5 Remove __wur from setfsuid and setfsgid. 2013-04-18 23:58:16 -06:00
Carlos O'Donell 0f122b8d12 Configuring for i386 is no longer supported.
We no longer support configuring for i386, nor do we
elide such a configuration to i686. Configuring with
i386-* is a failure, and we provide an example of
how to fix that.

---

2013-04-17  Carlos O'Donell  <carlos@redhat.com>

	* configure.in: Remove i386 configure warning. Remove i386 case.
	* configure: Regenerate.
	* sysdeps/i386/configure.in: Raise error if config_machine is i386.
	Add example to error message.
	* sysdeps/i386/configure: Regenerate.
2013-04-17 17:13:20 -07:00
Roland McGrath 477925062f BZ#15361: Make aio_fsync not check open modes. 2013-04-12 13:11:20 -07:00
Carlos O'Donell aba5e333d4 libm-test.inc: Fix tests where cos(PI/2) != 0.
The value of PI is never exactly PI in any floating point representation,
and the value of PI/2 is never PI/2. It is wrong to expect cos(M_PI_2l)
to return 0, instead it will return an answer that is  non-zero because
M_PI_2l doesn't round to exactly PI/2 in the type used.

That is to say that the correct answer is to do the following:
* Take PI or PI/2.
* Round to the floating point representation.
* Take the rounded value and compute an infinite precision cos or sin.
* Use the rounded result of the infinite precision cos or sin as the
  answer to the test.

I used printf to do the type rounding, and Wolfram's Alpha to do the
infinite precision cos calculations.

The following changes bring x86-64 and x86 to 1/2 ulp for two tests.
It shows that the x86 cos implementation is quite good, and that
our test are flawed.

Unfortunately given that the rounding errors are type dependent we
need to fix this for each type. No regressions on x86-64 or x86.

---

2013-04-11  Carlos O'Donell  <carlos@redhat.com>

	* math/libm-test.inc (cos_test): Fix PI/2 test.
	(sincos_test): Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps: Regenerate.
	* sysdeps/i386/fpu/libm-test-ulps: Regenerate.
2013-04-11 08:52:18 -04:00
Roland McGrath 61c23e6234 BZ#14280: Fix Hurd ioctl macro to avoid warning. 2013-04-08 14:31:38 -07:00
Carlos O'Donell a01f19c8fb i386: Fail at configure time for i386 builds.
This change does two things:

* Treats a target i386-* as if it were i686.
* Fails configure if the user is generating code
  for i386.

We no longer support i386 code-generation because the i386
lacks the atomic operations we need in glibc.

You can still configure for i386-*, but you get i686 code.

You can't build with --march=i386, --mtune=i386 or a compiler
that defaults to i386 code-generation.

I've added two i386 entries in the master todo list to discuss
merging and renaming:
http://sourceware.org/glibc/wiki/Development_Todo/Master#i386

The failure modes are fail-safe here. You compile for i386,
get i686, and try to run on i386 and it fails. The configure
log has a warning saying we elided to i686. There is no situation
that I can see where we run into any serious problems.

The patch makes the current state better in that we get less
confused users and we build successfully in more default
configurations.

The next enhancement would be to add --march=i?86
as suggested in #c20 of BZ#10062 for any i?86-* builds, which
would solve the problem of a 32-bit compiler that defaults to
i386 code-gen and glibc configured for i686-* target. Which
previously failed at build time, and now will fail at configure
time (requires adding --march=i686).

Updated NEWS with BZ #10060 and #10062.

No regressions.

---

2013-04-06  Carlos O'Donell  <carlos@redhat.com>

	[BZ #10060, #10062]
	* aclocal.m4 (LIBC_COMPILER_BUILTIN_INLINED): New macro.
	* sysdeps/i386/configure.in: Use LIBC_COMPILER_BUILTIN_INLINED and
	fail configure if __sync_val_compare_and_swap is not inlined.
	* sysdeps/i386/configure: Regenerate.
	* configure.in: Build for i686 when configured for i386.
	* configure: Regenerate.
	* README: Remove i386 reference.
2013-04-06 12:00:35 -04:00
Carlos O'Donell 24116fcdbe s390/s390x: Undef PSEUDO before redef.
The s390 and s390x sysdep.h files include the more generic sysdep.h.
The more generic sysdep.h defines PSEUDO. This causes an annoying
CPP warning saying the PSEUDO was redefined. This patch removes the
warning by undefining PSEUDO before the redefinition. This is in line
with what all the other machines do.

---

2013-04-06  Carlos O'Donell  <carlos@redhat.com>

	* sysdeps/s390/s390-32/sysdep.h: Undefine PSEUDO before redefinition.
	* sysdeps/s390/s390-64/sysdep.h: Likewise.
2013-04-06 10:53:54 -04:00
Thomas Schwinge a1cbf437a5 [BZ #14686, #15336] Fix standard compliance. Don't use hard-coded qNaN values. 2013-04-05 22:34:52 +02:00
Thomas Schwinge 8b43a0c9f2 [BZ #15335, #15342] Fix standard compliance. Don't use hard-coded qNaN values. 2013-04-05 22:27:29 +02:00
Thomas Schwinge d91da4ce87 Remove unreachable code.
The case of y == 0 is handled at the beginning of the function.
2013-04-05 21:30:28 +02:00
Thomas Schwinge bf0f50dfc6 Remove unused hard-coded qNaN definition. 2013-04-05 21:28:03 +02:00
Andreas Schwab 1cef1b1908 Fix stack overflow in getaddrinfo with many results 2013-04-03 17:39:15 +02:00
Thomas Schwinge 74d87055bf Refer to two GCC PRs. 2013-04-03 14:13:44 +02:00
Siddhesh Poyarekar c871eccd1e Remove TWO
Minor cleanup to remove the macro TWO and use the value directly
instead.
2013-04-03 15:47:01 +05:30
Siddhesh Poyarekar d755bba40f Preserve errno across _PC_CHOWN_RESTRICTED call on XFS
Fix BZ #15305.

On kernel versions earlier than 2.6.29, the Linux kernel exported a
sysctl called restrict_chown for xfs, which could be used to allow
chown to users other than the owner.  2.6.29 removed this support,
causing the open_not_cancel_2 to fail and thus modify errno.  The fix
is to save and restore errno so that the caller sees it as unmodified.

Additionally, since the code to check the sysctl is not useful on
newer kernels, we add an ifdef so that in future the code block gets
rmeoved completely.
2013-04-03 10:56:45 +05:30
Joseph Myers 52ce486045 Fix cacosh inaccuracy and spurious exceptions (bug 15327). 2013-04-02 22:54:00 +00:00
Siddhesh Poyarekar e7906a4789 Use mantissa_t in mpexp 2013-04-02 17:53:09 +05:30
Thomas Schwinge 572676160d New <math.h> macro named issignaling to check for a signaling NaN (sNaN).
It is based on draft TS 18661 and currently enabled as a GNU extension.
2013-04-02 13:51:02 +02:00
Adhemerval Zanella 60c414c346 PowerPC: remove branch prediction from rint implementation
The branch prediction hints is actually hurts performance in this case.
The assembly implementation make two assumptions: 1. 'fabs (x) < 2^52'
is unlikely and 2. 'x > 0.0' is unlike (if 1. is true). Since it a
general floating point function, expected input is not bounded and then
it is better to let the hardware handle the branches.
2013-04-01 06:36:51 -05:00
Joseph Myers ccc8cadf75 Fix casinh inaccuracy for imaginary part < 1.0, real part small (bug 10357). 2013-03-30 13:31:53 +00:00
Siddhesh Poyarekar 0d1029de12 Remove usage of ONE macro
I missed this instance, which caused a build failure in powerpc.
2013-03-29 16:53:05 +05:30
Siddhesh Poyarekar c2d94018c6 Remove ONE and MONE 2013-03-29 16:40:36 +05:30
Siddhesh Poyarekar 27ec37f185 Format s_tan.c 2013-03-29 16:38:27 +05:30
Siddhesh Poyarekar a64d7e0efb Remove ZERO and MZERO macros 2013-03-29 16:37:26 +05:30
Siddhesh Poyarekar d26dd3eb00 Format s_atan.c 2013-03-29 16:34:28 +05:30
Siddhesh Poyarekar 0f6a8d4b0b Format e_log.c 2013-03-29 16:34:00 +05:30
Roland McGrath 288f7d79fe Use __ehdr_start, if available, as fallback for AT_PHDR. 2013-03-28 16:15:48 -07:00
Roland McGrath dc0a026385 Make _dl_phdr pointer to const. 2013-03-28 15:39:32 -07:00
Roland McGrath 3d3436ae68 Consolidate declarations of _dl_phdr, _dl_phnum. 2013-03-28 15:33:57 -07:00
Roland McGrath 356b348023 Never call syslog in __libc_message. 2013-03-28 10:38:37 -07:00
Alan Modra b0f1246ab4 PowerPC: .eh_frame info in crt1.o isn't useful and triggers gold bug 14675.
The .eh_frame info in crt1.o isn't useful and this patch prevents it from
being generated on PowerPC.  It triggers the following gold bug:

http://sourceware.org/bugzilla/show_bug.cgi?id=14675
2013-03-28 12:16:28 -05:00
Adhemerval Zanella fbbe2b9a1f Fix e_logl (128ibm) spurious underflow 2013-03-28 09:52:48 -03:00
Siddhesh Poyarekar 1728ab378e Format and clean up s_atan2.c 2013-03-28 10:56:06 +05:30
Joseph Myers 3a7182a14b Fix casinh inaccuracy near i, imaginary part > 1 (bug 15307). 2013-03-27 14:38:44 +00:00
Siddhesh Poyarekar 5739f705ee Use integral constants
The compiler is smart enough to convert those into double for powerpc,
but if we put them as doubles, it adds overhead by performing those
operations in floating point mode.
2013-03-26 20:24:04 +05:30
Siddhesh Poyarekar e375e83d17 Removed commented code 2013-03-26 20:14:18 +05:30
Siddhesh Poyarekar 6f2e90e78f Make mantissa type of mp_no configurable
The mantissa of mp_no is intended to take only integral values.  This
is a relatively good choice for powerpc due to its 4 fpus, but not for
other architectures, which suffer due to this choice.  This change
makes the default mantissa a long integer and allows powerpc to
override it.  Additionally, some operations have been optimized for
integer manipulation, resulting in a significant improvement in
performance.
2013-03-26 19:28:50 +05:30
Adhemerval Zanella fce14d4e9c PowerPC: fix libm ABI issue for llroundl 2013-03-26 10:01:57 -03:00
David S. Miller eb66fd21bf Update sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2013-03-22 13:29:31 -07:00
Adhemerval Zanella e42a38dd9d BZ#13889: expl (709.75) wrongly overflows for ldbl-128ibm
The patch increase the high value to check if expl overflows. Current
high mark value is not really correct, the algorithm accepts high values.
It also adds a correct wrapper function to check for overflow and underflow.
2013-03-22 12:39:10 -03:00
Dmitry V. Levin 2e0fb52187 BZ#11120: fix x86_64/strcmp.S NOT_IN_libc safeguards
Due to a typo repeated several times, this bug hasn't been fixed yet,
despite being marked as resolved in glibc 2.12.

* sysdeps/x86_64/strcmp.S: Replace all occurrences of NOT_IN_lib
with NOT_IN_libc.
2013-03-22 03:16:00 +00:00
Adhemerval Zanella b5784d95bb PowerPC: fix sqrtl ABI issue
This patch fixes a sqrtl ABI issue when building for powerpc64.
2013-03-21 14:15:45 -03:00
Thomas Schwinge 5aa4a1a1fd On 32-bit x86, disable certain tests involving sNaN values.
Follow-up to commit 495ded2c8c.
2013-03-21 16:05:29 +01:00
Joseph Myers 98c48fe5cc Fix Bessel function spurious overflows for ldbl-128 / ldbl-128ibm (bug 15285). 2013-03-21 13:57:21 +00:00
Joseph Myers 0a1b2ae6f6 Fix casinh inaccuracy for argument with imaginary part 1 (bug 15287). 2013-03-21 10:27:10 +00:00
Siddhesh Poyarekar b33d4ce4a2 Replace 8388608.0 with HALFRAD in mp code
Minor cleanup
2013-03-21 13:07:44 +05:30
Joseph Myers bef0b50749 Move system-specific settings out of toplevel configure.in and config.make.in. 2013-03-20 22:37:06 +00:00
Roland McGrath a600e5cef5 Consolidate Linux and POSIX libc_fatal code. 2013-03-19 17:07:15 -07:00
Andreas Schwab 446737706c s390x: Move rtld link to /lib 2013-03-19 12:08:35 +01:00
Ondrej Bilka 37bb363f03 Faster strlen on x64. 2013-03-18 07:39:12 +01:00
David S. Miller cd18e90aa6 Update Sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2013-03-17 08:38:10 -07:00
Joseph Myers d2f9799e7c Fix y1l spurious overflows for ldbl-96 (bug 15283). 2013-03-16 17:51:48 +00:00
Joseph Myers 2a185d32e8 Fix spurious underflow exceptions for Bessel functions for ldbl-128 / ldbl-128ibm (bug 14155). 2013-03-16 17:50:28 +00:00
Roland McGrath bc16e260d0 Move _dl_non_dynamic_init, _dl_aux_init declarations. 2013-03-15 14:32:04 -07:00
Thomas Schwinge 495ded2c8c Promote a math test for sNaN handling to the top-level. 2013-03-15 19:12:10 +01:00
Thomas Schwinge 777b0332c0 Use GCC's builtins for generating NaNs. 2013-03-15 19:10:20 +01:00
Thomas Schwinge 67e971f18f Better distinguish between NaN/qNaN/sNaN. 2013-03-15 19:06:02 +01:00
Siddhesh Poyarekar 1e3803454e Revert configurable mantissa patch
Reverts d22ca8cdfb

since it is severely broken on 32-bit.
2013-03-15 23:18:51 +05:30
Adhemerval Zanella 83a6b66ae9 Reverting wrong commit.
Restore sysdeps/gnu/configure wrongly modified on
ef26eece63.
2013-03-15 14:40:37 -03:00
Adhemerval Zanella ef26eece63 PowerPC: gettimeofday optimization by using IFUNC 2013-03-15 10:58:56 -03:00
Siddhesh Poyarekar d22ca8cdfb Make mantissa type configurable
This allows the default mantissa to be integral, with powerpc
overriding it to take advantage of its FPUs.
2013-03-15 10:44:03 +05:30
Joseph Myers 06d5adfbda Regenerate sysdeps/x86_64/preconfigure. 2013-03-15 01:18:32 +00:00
Joseph Myers 41c7328e85 Fix spurious underflow exceptions for Bessel functions for double (bug 14155). 2013-03-14 17:47:30 +00:00
Siddhesh Poyarekar e25cfa6005 Fix formatting in last change 2013-03-14 08:18:48 +05:30
Petr Baudis 58a1335e76 Fix __times() handling of EFAULT when buf is NULL 2013-03-14 01:16:53 +01:00
Roland McGrath 9967e003b3 Add sysdeps/init_array to produce empty crt[in].o and use .preinit_array for gcrt1.o 2013-03-12 12:50:13 -07:00
Ondrej Bilka 80f844c9d8 Remove Prefer_SSE_for_memop on x64 2013-03-11 15:39:08 +01:00
Andreas Schwab fb6b0fcbf1 Remove extra pthread_atfork compat symbols 2013-03-11 09:47:01 +01:00
Adhemerval Zanella edf66e57fc PowerPC: unify math_ldbl.h implementations
This patch removes redudant definition from PowerPC specific
math_ldbl, using the definitions from ieee754 math_ldbl.h.
2013-03-08 11:07:15 -03:00
Siddhesh Poyarekar 6d9145d817 Consolidate copies of mp code in powerpc
Retain a single copy of the mp code in power4 instead of the two
identical copies in powerpc32 and powerpc64.
2013-03-08 11:38:41 +05:30
Andreas Jaeger 4dd4e15794 Install <bits/mman-linux.h>
* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
	bits/mman-linux.h.
2013-03-07 13:06:20 +01:00
Siddhesh Poyarekar ce544b5bda Merge powerpc slowexp.c into generic code 2013-03-07 13:25:02 +05:30
Siddhesh Poyarekar 4cc149fd8e Merge powerpc slowpow.c into generic code 2013-03-07 13:23:07 +05:30
Siddhesh Poyarekar e6ebd4a7d5 Use an intermediate variable to sum exponents in powerpc __mul and __sqr 2013-03-07 13:18:56 +05:30
Siddhesh Poyarekar 82a9811d29 Use generic mpa.c code for everything except __mul and __sqr 2013-03-07 12:23:29 +05:30
Siddhesh Poyarekar adbb8027be Remove PIPE_BUF Linux-specific code
Fixes BZ #12723

The variable pipe buffer size does nothing to the value of PIPE_BUF,
since the number of bytes that are atomically written is still
PIPE_BUF on Linux.
2013-03-07 12:15:08 +05:30
Ondrej Bilka 87bd9bc4bd Revert " * sysdeps/x86_64/strlen.S: Replace with new SSE2 based implementation"
This reverts commit b79188d717.
2013-03-06 22:27:18 +01:00
Ondrej Bilka b79188d717 * sysdeps/x86_64/strlen.S: Replace with new SSE2 based implementation
which is faster on all x86_64 architectures.
	Tested on AMD, Intel Nehalem, SNB, IVB.
2013-03-06 21:54:01 +01:00
Andreas Jaeger 664a9ce4ca Use <bits/mman-linux.h> for MIPS
* sysdeps/unix/sysv/linux/bits/mman-linux.h (MAP_ANONYMOUS):
	Allow definition via __MAP_ANONYMOUS.

	* sysdeps/unix/sysv/linux/mips/bits/mman.h: Remove all defines
	provided by bits/mman-linux.h and include <bits/mman-linux.h>.
	(__MAP_ANONYMOUS): Define.
2013-03-06 17:36:37 +01:00
Andreas Jaeger 8e39047d31 Remove MAP_GROWSUP on s390
* sysdeps/unix/sysv/linux/s390/bits/mman.h (MAP_GROWSUP):
	Remove, it's not part of Linux headers.
2013-03-06 16:39:56 +01:00
Andreas Jaeger 67525cb832 Sync with Linux 3.8 2013-03-06 16:35:19 +01:00
Joseph Myers 2d67d91ac0 Remove powerpc64 bounded-pointers code. 2013-03-06 00:10:21 +00:00
Andreas Jaeger 890b58d3bd Define MCL_CURRENT, MCL_FUTURE in bits/mman-linux.h
* sysdeps/unix/sysv/linux/s390/bits/mman.h: Include
	<bits/mman-linux.h>.
	(MCL_CURRENT, MCL_FUTURE): Do not define here, the generic value
	is fine.
	* sysdeps/unix/sysv/linux/sh/bits/mman.h: Move include of
	<bits/mman-linux.h> to end of file.
	(MCL_CURRENT, MCL_FUTURE): Do not define here, the generic value
	is fine.
	* sysdeps/unix/sysv/linux/x86/bits/mman.h: Move include of
	<bits/mman-linux.h> to end of file.
	(MCL_CURRENT, MCL_FUTURE): Do not define here, the generic value
	is fine.
	* sysdeps/unix/sysv/linux/sparc/bits/mman.h: Move include of
	<bits/mman-linux.h> to end of file.

	* sysdeps/unix/sysv/linux/bits/mman-linux.h [!MCL_CURRENT]
	(MCL_CURRENT, MCL_FUTURE): Define here.
2013-03-05 19:40:13 +01:00
Andreas Krebbel 5f67c04f5e S/390: Use attribute_hidden in ifunc-resolve.c 2013-03-05 13:19:03 +01:00
Andreas Krebbel c3e94a9533 S/390: Fix rt_sigprocmask syscall invocation in get/set/swapcontext. 2013-03-05 08:15:33 +01:00
Joseph Myers cfb6382a4f Remove powerpc32 strncmp comments about bounded pointers. 2013-03-04 23:53:05 +00:00
Andreas Jaeger 539d8e0188 Create <bits/mman-linux.h>
* sysdeps/unix/sysv/linux/bits/mman-linux.h: New file, with
	Linux common definitions.

	* sysdeps/unix/sysv/linux/sh/bits/mman.h: Remove all defines
	provided by bits/mman-linux.h and include <bits/mman-linux.h>.
	* sysdeps/unix/sysv/linux/x86/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
2013-03-04 20:26:59 +01:00
Adhemerval Zanella e0b780ad5b BZ #15055: Use __ieee754_sqrl in acoshl for lbdl-128ibm 2013-03-04 11:37:51 -03:00
Joseph Myers 6850863319 Use same installed powerpc headers for hard and soft float. 2013-03-01 22:53:27 +00:00
Roland McGrath 7775448e57 Fix NEED_DL_SYSINFO_DSO conditionals. 2013-03-01 14:44:44 -08:00
Joseph Myers b551088322 Remove powerpc32 bounded-pointers code. 2013-02-28 21:23:47 +00:00
Siddhesh Poyarekar 8d19fe64ee Sync up ppc add_magnitudes and sub_magnitudes with default code 2013-02-28 11:13:05 +05:30
Siddhesh Poyarekar 09c14ed23e Format mpsqrt.c 2013-02-27 11:28:20 +05:30
Siddhesh Poyarekar a688864eed Format mpatan2.c 2013-02-27 11:27:41 +05:30
Siddhesh Poyarekar 6295157a77 Format mpatan.c 2013-02-27 11:26:22 +05:30
Siddhesh Poyarekar b8de22026d Format mptan.c 2013-02-27 11:25:39 +05:30
Siddhesh Poyarekar 11d6e2f237 Format mplog.c 2013-02-27 11:24:45 +05:30
Siddhesh Poyarekar 45f058844c Another tweak to the multiplication algorithm
Reduce the formula to calculate mantissa so that we reduce the net
number of multiplications performed.
2013-02-26 21:28:16 +05:30
Siddhesh Poyarekar 2236d3595a Don't duplicate mpone and mptwo 2013-02-26 15:15:27 +05:30
Siddhesh Poyarekar 2a983a2e0a Remove commented declarations 2013-02-25 18:11:14 +05:30
Siddhesh Poyarekar e69804d14e Use long wherever possible in mpa.c
Using long throughout like powerpc does is beneficial since it reduces
the need to switch to 32-bit instructions.  It gives a very minor
performance improvement.
2013-02-25 16:43:03 +05:30
Siddhesh Poyarekar 2f22a1e8dd Format slowexp.c 2013-02-25 16:13:35 +05:30
Siddhesh Poyarekar 8930ddc705 Reformat slowpow.c 2013-02-25 16:08:38 +05:30
Siddhesh Poyarekar dc60cb110b Remove commented code 2013-02-25 14:51:57 +05:30
Siddhesh Poyarekar 60f5a8b534 Sync up powerpc __mp_dbl with default code 2013-02-25 12:01:45 +05:30
Joseph Myers 2366713d87 Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
Siddhesh Poyarekar 8094523147 Mark __inv as static in powerpc 2013-02-21 15:05:28 +05:30
Siddhesh Poyarekar bab8a695ee Fix whitespace differences between generic and powerpc mpa.c 2013-02-21 14:31:42 +05:30
Andreas Krebbel e21d7aa71c S/390: Fix _dl_runtime_profile for 32 bit. 2013-02-21 09:47:55 +01:00
Siddhesh Poyarekar 4c7a4263af Mark ZERO inputs to __mul as unlikely on powerpc
Syncs up with generic code.
2013-02-21 12:17:29 +05:30
Thomas Schwinge 50022a93fc Respect the user's namespace in installed header files.
Fixup for commit c7b275d6b3.
2013-02-20 18:51:56 +01:00
Thomas Schwinge c7b275d6b3 bits/nan.h: Change __attribute_used__ to __attribute__ ((unused)). 2013-02-20 16:49:58 +01:00
Siddhesh Poyarekar 20cd7fb3ae Copy comment about inner loop from powerpc mpa.c to the default one 2013-02-20 18:56:20 +05:30
Joseph Myers 92945b5261 Remove some bounded-pointers support from i386 .S files. 2013-02-19 21:58:08 +00:00
Mike Frysinger 6ff444c418 unify xmalloc prototypes & friends
These prototypes are duplicated in many places.  Add a dedicated
header for holding prototypes for program-specific functions to
avoid that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-02-18 17:16:05 -05:00
Siddhesh Poyarekar ba384f6ed9 C++11 thread_local destructors support
This feature is specifically for the C++ compiler to offload calling
thread_local object destructors on thread program exit, to glibc.
This is to overcome the possible complication of destructors of
thread_local objects getting called after the DSO in which they're
defined is unloaded by the dynamic linker.  The DSO is marked as
'unloadable' if it has a constructed thread_local object and marked as
'unloadable' again when all the constructed thread_local objects
defined in it are destroyed.
2013-02-18 19:08:21 +05:30
Siddhesh Poyarekar be179c8a36 New function _dl_find_dso_for_object
Consolidate code to search for an address within a DSO.
2013-02-18 18:00:17 +05:30
Siddhesh Poyarekar 8313cb997d FUTEX_*_REQUEUE_PI support for non-x86 code
Add FUTEX_*_REQUEUE_PI support for the default C code and also add
implementations for s-390 and ppc.
2013-02-18 16:07:10 +05:30
Andreas Krebbel f78b5caa6e S/390: Fix _dl_runtime_profile 2013-02-18 10:29:40 +01:00
Joseph Myers 2969121014 Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00