Commit Graph

27532 Commits

Author SHA1 Message Date
Rajalakshmi Srinivasaraghavan 754c5a08aa PowerPC: Fix nearbyintl failure for few inputs
This patch fixes few failures in nearbyintl() where the fraction part is
close to 0.5.i  The new tests added report few extra failures in
nearbyint_downward and nearbyint_towardzero which is a known issue.

Fixes #17031.
2014-06-17 08:46:25 -05:00
Adhemerval Zanella 556f529dab PowerPC: Move powerpc code out of nptl/ subdirectory 2014-06-17 07:54:22 -05:00
Adhemerval Zanella 4b26620076 Fix ChangeLog indentation. 2014-06-17 07:50:37 -05: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
Andreas Schwab a76e63c586 m68k: update libm test ULPs 2014-06-17 00:29:23 +02:00
Andreas Schwab ea8a15f628 Fix typo in preprocessor conditional 2014-06-16 23:44:34 +02:00
Andreas Schwab f2f6d82fe1 Pass $TIMEOUTFACTOR to tests also in cross testing 2014-06-16 21:47:25 +02:00
Florian Weimer a729111732 Fix tautological comparison in non-executed part of tst-setuid2 (BZ #17058)
This part never runs with the current implementation
because the setresuid call currently aborts (as intended).
2014-06-16 18:00:09 +02:00
Andreas Schwab 3d7c00e3a9 Update feature guard for strdup/strndup in <bits/string2.h> 2014-06-16 10:21:31 +02:00
David S. Miller 6957fb3150 Update Sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-06-14 13:14:54 -07:00
Andreas Schwab 1d2a049204 m68k: Consolidate NPTL/non versions of clone 2014-06-14 21:37:49 +02:00
Andreas Schwab 11b9e55b67 m68k: Consolidate NPTL/non versions of vfork 2014-06-14 21:37:34 +02:00
Andi Kleen 0f6901d0a1 Add fallback file for elide.h
Add the missing fallback file for elide.h to fix non x86 builds.
Sorry about that. This is just a noop macro file that makes
all elision code to be optimized out.
2014-06-14 09:27:09 -07:00
Stefan Liebler 38bbbb9f32 Fix pthread.h in installed-headers list. 2014-06-13 16:39:23 -07:00
Roland McGrath 9a25fd1ed3 S390: Move NPTL public headers to sysdeps/s390/nptl/. 2014-06-13 16:27:11 -07:00
Roland McGrath 4004f7e4bf Move S390 code out of nptl/sysdeps/s390/. 2014-06-13 16:26:56 -07:00
Roland McGrath 45193bb814 S390: Convert fork.c to arch-fork.h 2014-06-13 16:26:38 -07:00
David S. Miller f6fdf53382 Consolidate sparc clone, fork, and vfork implementations.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Moved ...
	* sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: ... here.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Moved ...
	* sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: ... here.
	* sysdeps/unix/sysv/linux/sparc/fork.S: Delete.
	* sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__thread_start):
	Remove RESET_PID cpp guards.
	* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__thread_start):
	Remove RESET_PID cpp guards.
	* sysdeps/unix/sysv/linux/sparc/vfork.S: Delete.
2014-06-13 14:47:53 -07:00
Andreas Schwab f5d71e140d m68k: avoid pointer to integer conversion warning 2014-06-13 23:32:13 +02:00
Andreas Schwab 03ed7738e7 ChangeLog fix 2014-06-13 23:32:13 +02:00
Andi Kleen b7aa8caace Remove x86 assembler rwlock code
With the recent tuning the C version of rwlocks is basically the same
performance as the x86 assembler version for uncontended locks (with a
a few cycles near the run-to-run variability). For others it should not
matter anyways.

So remove the assembler code and use the C version like other
architectures.
2014-06-13 13:16:06 -07:00
Andi Kleen 8491ed6d70 Add adaptive elision to rwlocks
This patch relies on the C version of the rwlocks posted earlier.
With C rwlocks it is very straight forward to do adaptive elision
using TSX. It is based on the infrastructure added earlier
for mutexes, but uses its own elision macros. The macros
are fairly general purpose and could be used for other
elision purposes too.

This version is much cleaner than the earlier assembler based
version, and in particular implements adaptation which makes
it safer.

I changed the behavior slightly to not require any changes
in the test suite and fully conform to all expected
behaviors (generally at the cost of not eliding in
various situations). In particular this means the timedlock
variants are not elided.  Nested trylock aborts.
2014-06-13 13:15:28 -07:00
Andi Kleen a832bdd362 Add a fast path for C rd/wrlock v2
One difference of the C versions to the assembler wr/rdlock
is that the C compiler saves some registers which are unnecessary
for the fast path in the prologue of the functions. Split the
uncontended fast path out into a separate function. Only when contention is
detected is the full featured function called. This makes
the fast path code (nearly) identical to the assembler version,
and gives uncontended performance within a few cycles.

v2: Rename some functions and add space.
2014-06-13 12:49:03 -07:00
Meador Inge 995a46bbfb get_nprocs: Only return explictly set cache values (BZ #16996)
The implementation of __get_nprocs uses a stactic variable to cache
the value of the current number of processors.  The caching breaks when
'time (NULL) == 0':

  $ cat nproc.c
  #include <stdio.h>
  #include <time.h>
  #include <sys/time.h>

  int main(int argc, char *argv[])
  {
    time_t t;
    struct timeval tv = {0, 0};
    printf("settimeofday({0, 0}, NULL) = %d\n", settimeofday(&tv, NULL));
    t = time(NULL);
    printf("Time: %d, CPUs: %d\n", (unsigned int)t, get_nprocs());
    return 0;
  }
  $ gcc -O3 nproc.c
  $ ./a.out
  settimeofday({0, 0}, NULL) = -1
  Time: 1401311578, CPUs: 4
  $ sudo ./a.out
  settimeofday({0, 0}, NULL) = 0
  Time: 0, CPUs: 0

The problem is with the condition used to check whether a cached
value should be returned or not:

  static int cached_result;
  static time_t timestamp;

  time_t now = time (NULL);
  time_t prev = timestamp;
  atomic_read_barrier ();
  if (now == prev)
    return cached_result;

This patch fixes the problem by ensuring that 'cached_result' has
been set at least once before returning it.
2014-06-13 14:02:04 +05:30
Roland McGrath febf6cc58c Move SPARC public headers out of nptl/ 2014-06-12 15:04:34 -07:00
Roland McGrath e26822463f Move SPARC code out of nptl/sysdeps/sparc/. 2014-06-12 14:33:59 -07:00
Roland McGrath b0725f4324 SPARC: Define TLS_DEFINE_INIT_TP 2014-06-12 14:33:43 -07:00
Roland McGrath b14368b895 SPARC: Convert fork.c to arch-fork.h 2014-06-12 14:19:50 -07:00
Roland McGrath c5620eb3a3 Use list.h in posix-timer code. 2014-06-12 14:17:14 -07:00
Roland McGrath 463dc947b4 Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
Roland McGrath e876b09076 Consolidate NPTL sigprocmask. 2014-06-12 10:32:18 -07:00
Roland McGrath f6b07b3d48 Move i386 code out of nptl/ subdirectory. 2014-06-12 10:08:24 -07:00
Roland McGrath 45262aeedf Move SH code out of nptl/ subdirectory. 2014-06-12 09:05:54 -07:00
Stefan Liebler 35a5e3e338 posix_spawn_faction_addopen: Add missing string.h include directive
This is needed to avoid a PLT call on s390.
2014-06-12 14:20:07 +02:00
Roland McGrath 14642b8511 Move x86_64 code out of nptl/ subdirectory. 2014-06-11 21:33:32 -07:00
Adhemerval Zanella 31c44fea31 Update powerpc-fpu ULPs. 2014-06-11 21:22:49 -05:00
Joseph Myers e81a4f9a54 conformtest: clean up POSIX expectations for sys/mman.h, sys/stat.h, sys/types.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/mman.h, sys/stat.h
and sys/types.h.  Tested x86_64; no new XFAILs needed.

	* conform/data/sys/mman.h-data [POSIX] (size_t): Do not require
	type.
	[POSIX] (off_t): Likewise.
	* conform/data/sys/stat.h-data (S_IRGRP): Require constant.
	[POSIX] (S_ISBLK): Require macro.
	[POSIX] (S_ISCHR): Likewise.
	[POSIX] (S_ISDIR): Likewise.
	[POSIX] (S_ISFIFO): Likewise.
	[POSIX] (S_ISREG): Likewise.
	[POSIX || XPG3 || XPG4 || UNIX98] (S_TYPEISTMO): Do not list
	optional-macro.
	* conform/data/sys/types.h-data [POSIX] (blkcnt_t): Do not require
	type.
	[POSIX] (time_t): Likewise.
	[POSIX] (timer_t): Likewise.
2014-06-11 23:16:23 +00:00
Florian Weimer 89e435f355 posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.
2014-06-11 23:13:42 +02:00
Chris Metcalf c3a2ebe1f7 tile: Consolidate NPTL/non versions of vfork 2014-06-11 15:52:53 -04:00
Roland McGrath c9cab3d2f9 Tile: Define TLS_DEFINE_INIT_TP 2014-06-11 12:25:27 -07:00
Roland McGrath d3996c7905 S390: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:56 -07:00
Roland McGrath ba5ec6116c Alpha: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:35 -07:00
Roland McGrath f12b481486 PowerPC: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:17 -07:00
Roland McGrath 9503784a07 AArch64: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:01 -07:00
Vidya Ranganathan e23d3d2690 PowerPC: Optimized strcmp for PPC64/POWER7
Optimization is achieved on 8 byte aligned strings with double word
comparison using cmpb instruction. On unaligned strings loop unrolling
is applied for Power7 gain.
2014-06-11 08:39:31 -05:00
Siddhesh Poyarekar 42b1161e8c Validate bench.out against a JSON schema
This patch adds a JSON schema for the benchmark output file and also
adds a script that validates the generated output against the schema.
2014-06-11 14:16:29 +05:30
Adhemerval Zanella 4a594c3435 Fix ChangeLog indentation. 2014-06-10 14:13:12 -05:00
Chris Metcalf 2d0fc4dcfc tile: move sysdeps/unix/sysv/linux/tile nptl files. 2014-06-10 14:10:17 -04:00
Wilco 0570cfed7f Add FE_NOMASK_ENV return value test. 2014-06-10 15:50:25 +01:00
Joseph Myers f8ba1b5654 Fix log2 (1) in round-downward mode (bug 17042).
As with other issues of this kind, bug 17042 is log2 (1) wrongly
returning -0 instead of +0 in round-downward mode because of
implementations effectively in terms of log1p (x - 1).  This patch
fixes the issue in the same way used for log and log10.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 to confirm a fix was needed for ldbl-128 and to validate that
fix (also applied to ldbl-128ibm since that version of log2l is
essentially the same as the ldbl-128 one).

	[BZ #17042]
	* sysdeps/i386/fpu/e_log2.S (__ieee754_log2): Take absolete value
	when x - 1 is zero.
	* sysdeps/i386/fpu/e_log2f.S (__ieee754_log2f): Likewise.
	* sysdeps/i386/fpu/e_log2l.S (__ieee754_log2l): Likewise.
	* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Return
	0.0L for an argument of 1.0L.
	* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l):
	Likewise.
	* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Take absolute
	value when x - 1 is zero.
	* math/libm-test.inc (log2_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-06-10 12:07:15 +00:00