Commit Graph

8434 Commits

Author SHA1 Message Date
Adhemerval Zanella 372dc060e0 PowerPC: multiarch strchr for PowerPC64 2013-12-13 14:49:54 -05:00
Adhemerval Zanella 24c2c3b996 PowerPC: multiarch strncmp for PowerPC64 2013-12-13 14:48:48 -05:00
Adhemerval Zanella 1c92d9a0e0 PowerPC: multiarch strncasecmp for PowerPC64 2013-12-13 14:40:28 -05:00
Adhemerval Zanella 17de3ee3c1 PowerPC: multiarch strcasecmp for PowerPC64 2013-12-13 14:39:51 -05:00
Adhemerval Zanella 62982bf978 PowerPC: multiarch strnlen for PowerPC64 2013-12-13 14:38:50 -05:00
Adhemerval Zanella a65f4904ab PowerPC: multiarch strlen for PowerPC64 2013-12-13 14:38:17 -05:00
Adhemerval Zanella 1fd005ad2f PowerPC: multiarch rawmemchr for PowerPC64 2013-12-13 14:37:26 -05:00
Adhemerval Zanella cd05ba9135 PowerPC: multiarch memrchr for PowerPC64 2013-12-13 14:36:50 -05:00
Adhemerval Zanella 870f867648 PowerPC: multiarch memchr for PowerPC64 2013-12-13 14:35:28 -05:00
Adhemerval Zanella f00be62b08 PowerPC: multiarch mempcpy for PowerPC64 2013-12-13 14:34:06 -05:00
Adhemerval Zanella 8a29a3d00b PowerPC: multiarch memset/bzero for PowerPC64 2013-12-13 14:33:16 -05:00
Adhemerval Zanella 07253fcf7b PowerPC: multirach memcmp for PowerPC64 2013-12-13 14:32:31 -05:00
Adhemerval Zanella b5beafbcee PowerPC: multiarch memcpy for PowerPC64 2013-12-13 14:31:41 -05:00
Adhemerval Zanella 5e6a4d4b9e PowerPC: Adjust multiarch Implies for PowerPC64
This patch adds Implies files on multiarch folder for POWER chips so
multirach is enabled when building with --with-cpu and powerN
option.
2013-12-13 14:29:27 -05:00
Kaz Kojima ddfab6dc65 Use $$ver instead of $ver. 2013-12-13 08:45:01 +09:00
Siddhesh Poyarekar 7a74607ff6 Consolidate definition of constant t22 2013-12-11 12:08:19 +05:30
Siddhesh Poyarekar 196f7f5dbf Use double constants instead of the struct number 2013-12-11 11:24:25 +05:30
Adhemerval Zanella be2f900916 Update powerpc-fpu ULPs. 2013-12-09 06:52:04 -06:00
Markus Trippelsdorf e7b914bd0e Update x86_64 ULps for AMD K10 2013-12-09 11:06:11 +05:30
Joseph Myers 9f0be4f8b5 Move tests of lgamma from libm-test.inc to auto-libm-test-in. 2013-12-08 23:56:28 +00:00
Adhemerval Zanella 24eeafdb44 PowerPC: Optimized mpn functions for PowerPC64/POWER7
This patch add optimized __mpn_add_n/__mpn_sub_n for PowerPC64/POWER7.
They are originally from GMP with adjustments for GLIBC.
2013-12-06 11:52:31 -06:00
Adhemerval Zanella 4a2c0fd44d PowerPC: Optimized mpn functions for PowerPC64
This patch add optimized __mpn_addmul, __mpn_addsub, __mpn_lshift, and
__mpn_mul_1 implementations for PowerPC64. They are originally from GMP
with adjustments for GLIBC.
2013-12-06 11:52:22 -06:00
Adhemerval Zanella ccdc8438dc PowerPC: Adjust multiarch Implies for PowerPC32
This patch adds Implies files on multiarch folder for POWER chips so
multirach is enabled when building with --with-cpu and powerN option.
2013-12-06 05:47:05 -06:00
Adhemerval Zanella 2e973d9919 PowerPC: multiarch __ieee754_hypot[f] for PowerPC32 2013-12-06 05:47:05 -06:00
Adhemerval Zanella 2d9470b2ae PowerPC: multiarch logb/logbf/logbl for PowerPC32 2013-12-06 05:47:05 -06:00
Adhemerval Zanella 5212ffce0e PowerPC: multiarch modf/modff for PowerPC32 2013-12-06 05:47:05 -06:00
Adhemerval Zanella 79dccf31bf PowerPC: multiarch lrint/lrintf for PowerPC32 2013-12-06 05:47:04 -06:00
Adhemerval Zanella deb6648026 PowerPC: multiarch lround/lrounf for PowerPC32 2013-12-06 05:47:04 -06:00
Adhemerval Zanella 264b036bea PowerPC: multiarch copysign/copysignf for PowerPC32 2013-12-06 05:47:04 -06:00
Adhemerval Zanella d47db6c906 PowerPC: multiarch trunc/truncf for PowerPC32 2013-12-06 05:47:04 -06:00
Adhemerval Zanella ddb60b5aa9 PowerPC: multiarch round/roundf for PowerPC32 2013-12-06 05:47:04 -06:00
Adhemerval Zanella bedcf49b45 PowerPC: multiarch floor/floorf for PowerPC32 2013-12-06 05:47:04 -06:00
Adhemerval Zanella 35ae5b40a4 PowerPC: multiarch ceil/ceilf for PowerPC32 2013-12-06 05:47:03 -06:00
Adhemerval Zanella ae1a4cd9ff PowerPC: multiarch finite/finitef for PowerPC32 2013-12-06 05:47:03 -06:00
Adhemerval Zanella 64fffd65d7 PowerPC: multiarch isinf/isinff for PowerPC32 2013-12-06 05:47:03 -06:00
Adhemerval Zanella 8e4e7ba2d7 PowerPC: multiarch isnan/isnanf for PowerPC32 2013-12-06 05:47:03 -06:00
Adhemerval Zanella ddba588e2d PowerPC: multiarch sqrt/sqrtf for PowerPC32 2013-12-06 05:47:03 -06:00
Adhemerval Zanella 0f96a2f0b5 PowerPC: multiarch llround/llroundf for PowerPC32 2013-12-06 05:47:03 -06:00
Adhemerval Zanella c9b5d79e0c PowerPC: multiarch llrint/llrintf for PowerPC32 2013-12-06 05:47:02 -06:00
Adhemerval Zanella 9cbb3aabb5 PowerPC: change sysdeps fpu folder
This patch makes the fpu/multiarch folder appears in front of the
powerpc/fpu folder.
2013-12-06 05:47:02 -06:00
Adhemerval Zanella ea5a72f882 PowerPC: multiarch wordcopy routines for PowerPC32 2013-12-06 05:47:02 -06:00
Adhemerval Zanella 93be09e725 PowerPC: multiarch wcscpy for PowerPC32 2013-12-06 05:47:02 -06:00
Adhemerval Zanella bb04e529f6 PowerPC: multiarch wcsrchr for PowerPC32 2013-12-06 05:47:02 -06:00
Adhemerval Zanella 05b5cd1ce5 PowerPC: multiarch wcschr for PowerPC32 2013-12-06 05:47:02 -06:00
Adhemerval Zanella ba9641477e PowerPC: multiarch strchr for PowerPC32 2013-12-06 05:47:01 -06:00
Adhemerval Zanella 31c81aaa01 PowerPC: multiarch strchrnul for PowerPC32 2013-12-06 05:47:01 -06:00
Adhemerval Zanella 0d0607d9ab PowerPC: multiarch strncasecmp for PowerPC32 2013-12-06 05:47:01 -06:00
Adhemerval Zanella 4dfd5c8647 PowerPC: multiarch strcasecmp for PowerPC32 2013-12-06 05:47:01 -06:00
Adhemerval Zanella a19e01a355 PowerPC: multiarch strncmp for PowerPC32 2013-12-06 05:47:01 -06:00
Adhemerval Zanella ae9cf7a2e8 PowerPC: multiarch strnlen for PowerPC32 2013-12-06 05:47:00 -06:00
Adhemerval Zanella 3148bb7d2c PowerPC: multiarch strlen for PowerPC32 2013-12-06 05:47:00 -06:00
Adhemerval Zanella 7af8b94625 PowerPC: multiarch rawmemchr for PowerPC32 2013-12-06 05:47:00 -06:00
Adhemerval Zanella 03a6aa6a63 PowerPC: multiarch memrchr for PowerPC32 2013-12-06 05:47:00 -06:00
Adhemerval Zanella 1c62e6d960 PowerPC: multiarch memchr for PowerPC32 2013-12-06 05:47:00 -06:00
Adhemerval Zanella 87da8bdbe1 PowerPC: multiarch mempcpy for PowerPC32 2013-12-06 05:46:59 -06:00
Adhemerval Zanella 20ed471427 PowerPC: multiarch memset/bzero for PowerPC32 2013-12-06 05:46:59 -06:00
Adhemerval Zanella ab3e3a46d5 PowerPC: multiarch memcmp for PowerPC32 2013-12-06 05:46:59 -06:00
Adhemerval Zanella 930de6f09e PowerPC: multiarch memcpy for PowerPC32 2013-12-06 05:46:59 -06:00
Adhemerval Zanella 4c628e0026 PowerPC: initial support for multilib for PowerPC32
This patch add a empty Makefile, the C IFUNC helper macros, and a empty
available IFUNC implementation enumeration.
2013-12-06 05:46:59 -06:00
Kaz Kojima 8517800fab Add SH implementation of sotruss-lib.c and c++-types.data. 2013-12-06 08:22:22 +09:00
Adhemerval Zanella 180138f156 Update powerpc-fpu ULPs. 2013-12-05 11:20:06 -06:00
Joseph Myers e47cc4e0ed Fix tgamma errno setting on underflow (bug 6810). 2013-12-05 14:01:41 +00:00
Joseph Myers bbf37bdc12 Move TEST_f_f tests for [l-y]* functions from libm-test.inc to auto-libm-test-in. 2013-12-05 13:54:50 +00:00
Adhemerval Zanella eb5ad6b9bc PowerPC: Add systemtap static probe points in setjmp/longjmp
This patch add static probes for setjmp/longjmp in the way gdb expects,fixing
the gdb.base/longjmp.exp gdb testcases.

It changes the symbol_name and use macros to to avoid change the probe names
and ending up adding more logic on GDB (since with the expected name
GDB work seamlessly).
2013-12-05 07:44:07 -06:00
Joseph Myers 699ff83712 Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
Ulrich Weigand 5b118558f9 PowerPC64 ELFv2 ABI 6/6: Bump ld.so soname version number
To avoid having a ELFv2 binary accidentally picking up an old ABI ld.so,
this patch bumps the soname to ld64.so.2.

In theory (or for testing purposes) this will also allow co-installing
ld.so versions for both ABIs on the same system.  Note that the kernel
will already be able to load executables of both ABIs.  However, there
is currently no plan to use that theoretical possibility in a any
supported distribution environment ...

Note that in order to check which ABI to use, we need to invoke the
compiler to check the _CALL_ELF macro; this is done in a new configure
check in sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac,
replacing the hard-coded value of default-abi in the Makefile.
2013-12-04 07:44:39 -06:00
Ulrich Weigand 61cd8fe401 PowerPC64 ELFv2 ABI 5/6: LD_AUDIT interface changes
The ELFv2 ABI changes the calling convention by passing and returning
structures in registers in more cases than the old ABI:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01145.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01147.html

For the most part, this does not affect glibc, since glibc assembler
files do not use structure parameters / return values.  However, one
place is affected: the LD_AUDIT interface provides a structure to
the audit routine that contains all registers holding function
argument and return values for the intercepted PLT call.

Since the new ABI now sometimes uses registers to return values
that were never used for this purpose in the old ABI, this structure
has to be extended.  To force audit routines to be modified for the
new ABI if necessary, the patch defines v2 variants of the la_ppc64
types and routines.

In addition, the patch contains two unrelated changes to the
PLT trampoline routines: it fixes a bug where FPR return values
were stored in the wrong place, and it removes the unnecessary
save/restore of CR.
2013-12-04 07:41:39 -06:00
Ulrich Weigand 8b8a692cfd PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout.  These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html

Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.

In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.

To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets.  Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.

The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.

The second change only affected a few assembler files that used
the save area to temporarily store some registers.  In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer.  Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 07:41:39 -06:00
Ulrich Weigand 122b66defd PowerPC64 ELFv2 ABI 3/6: PLT local entry point optimization
This is a follow-on to the previous patch to support the ELFv2 ABI in the
dynamic loader, split off into its own patch since it is just an optional
optimization.

In the ELFv2 ABI, most functions define both a global and a local entry
point; the local entry requires r2 to be already set up by the caller
to point to the callee's TOC; while the global entry does not require
the caller to know about the callee's TOC, but it needs to set up r12
to the callee's entry point address.

Now, when setting up a PLT slot, the dynamic linker will usually need
to enter the target function's global entry point.  However, if the
linker can prove that the target function is in the same DSO as the
PLT slot itself, and the whole DSO only uses a single TOC (which the
linker will let ld.so know via a DT_PPC64_OPT entry), then it is
possible to actually enter the local entry point address into the
PLT slot, for a slight improvement in performance.

Note that this uncovered a problem on the first call via _dl_runtime_resolve,
because that routine neglected to restore the caller's TOC before calling
the target function for the first time, since it assumed that function
would always reload its own TOC anyway ...
2013-12-04 07:41:38 -06:00
Ulrich Weigand 696caf1d00 PowerPC64 ELFv2 ABI 2/6: Remove function descriptors
This patch adds support for the ELFv2 ABI feature to remove function
descriptors.  See this GCC patch for in-depth discussion:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01141.html

This mostly involves two types of changes: updating assembler source
files to the new logic, and updating the dynamic loader.

After the refactoring in the previous patch, most of the assembler source
changes can be handled simply by providing ELFv2 versions of the
macros in sysdep.h.   One somewhat non-obvious change is in __GI__setjmp:
this used to "fall through" to the immediately following __setjmp ENTRY
point.  This is no longer safe in the ELFv2 since ENTRY defines both
a global and a local entry point, and you cannot simply fall through
to a global entry point as it requires r12 to be set up.

Also, makecontext needs to be updated to set up registers according to
the new ABI for calling into the context's start routine.

The dynamic linker changes mostly consist of removing special code
to handle function descriptors.  We also need to support the new PLT
and glink format used by the the ELFv2 linker, see:
https://sourceware.org/ml/binutils/2013-10/msg00376.html

In addition, the dynamic linker now verifies that the dynamic libraries
it loads match its own ABI.

The hack in VDSO_IFUNC_RET to "synthesize" a function descriptor
for vDSO routines is also no longer necessary for ELFv2.
2013-12-04 07:41:38 -06:00
Ulrich Weigand d31beafa8e PowerPC64 ELFv2 ABI 1/6: Code refactoring
This is the first patch to support the new ELFv2 ABI in glibc.

As preparation, this patch simply refactors some of the powerpc64 assembler
code to move all code related to creating function descriptors (.opd section)
or using function descriptors (function pointer call) into a central place
in sysdep.h.

Note that most locations creating .opd entries were already using macros
in sysdep.h, this patch simply extends this to the remaining places.

No relevant change in generated code expected.
2013-12-04 07:41:38 -06:00
Alan Modra 7ec07d9a7b PowerPC64: Report overflow on @h and @ha relocations
This patch updates glibc in accordance with the binutils patch checked in here:
https://sourceware.org/ml/binutils/2013-10/msg00372.html

This changes the various R_PPC64_..._HI and _HA relocations to report
32-bit overflows.  The motivation is that existing uses of @h / @ha
are to build up 32-bit offsets (for the "medium model" TOC access
that GCC now defaults to), and we'd really like to see failures at
link / load time rather than silent truncations.

For those rare cases where a modifier is needed to build up a 64-bit
constant, new relocations _HIGH / _HIGHA are supported.

The patch also fixes a bug in overflow checking for the R_PPC64_ADDR30
and R_PPC64_ADDR32 relocations.
2013-12-04 07:41:37 -06:00
Ulrich Weigand 5162e7dd96 PowerPC64: Fix incorrect CFI in *context routines
The context established by "makecontext" has a link register pointing
back to an error path within the makecontext routine.  This is currently
covered by the CFI FDE for makecontext itself, which is simply wrong
for the stack frame *inside* the context.  When trying to unwind (e.g.
doing a backtrace) in a routine inside a context created by makecontext,
this can lead to uninitialized stack slots being accessed, causing the
unwinder to crash in the worst case.

Similarly, during parts of the "setcontext" routine, when the stack
pointer has already been switched to point to the new context, the
address range is still covered by the CFI FDE for setcontext.  When
trying to unwind in that situation (e.g. backtrace from an async
signal handler for profiling), it is again possible that the unwinder
crashes.

Theses are all problems in existing code, but the changes in stack
frame layout appear to make the "worst case" much more likely in
the ELFv2 ABI context.  This causes regressions e.g. in the libgo
testsuite on ELFv2.

This patch fixes this by ending the makecontext/setcontext FDEs
before those problematic parts of the assembler, similar to what
is already done on other platforms.   This fixes the libgo
regression on ELFv2.
2013-12-04 07:41:37 -06:00
Adhemerval Zanella fa60a67488 Update powerpc-fpu ULPs. 2013-12-04 06:04:48 -06:00
Joseph Myers 749008ff03 Fix exp missing underflows (bug 15268, bug 15425). 2013-12-03 21:49:56 +00:00
Ondřej Bílka b20de2c3d9 Properly handle shm_open validation. Fixes bug 16274. 2013-12-03 20:16:33 +01:00
Joseph Myers 34e16df5a1 Fix erfc errno setting on underflow (bug 6786). 2013-12-03 16:25:18 +00:00
Joseph Myers d8e2dbe3e3 Move TEST_f_f tests for [e-j]* functions from libm-test.inc to auto-libm-test-in. 2013-12-03 16:22:49 +00:00
Pavel Simerda 639a0ef8ab Remove redundant GAIH_OKIFUNSPEC and GAIH_EAI.
Only gaih_inet() and gaih_inet_serv() use a special bit flag denoted
by the GAIH_OKIFUNSPEC macro. Only the return value of
gaih_inet_serv() is actively checked for the bit flag which is
redundant because it just copies the nonzero property of the value
otherwise returned. The return value of gaih_inet() is only checked
for being zero and then the bit flag is filtered out. As the bit flag
is set only for otherwise nonzero return values, it doesn't affect the
zero comparison. GAIH_EAI just an alias to ~GAIH_OKIFUNSPEC.
2013-12-02 20:23:13 +05:30
Pavel Simerda f524d6a8e4 getaddrinfo: remove dead code 2013-12-02 20:17:17 +05:30
Adhemerval Zanella 1ab19dec57 Update powerpc-fpu ULPs. 2013-12-02 05:16:42 -06:00
Joseph Myers 176b0c7913 Move TEST_f_f tests for [a-c]* functions from libm-test.inc to auto-libm-test-in. 2013-11-30 22:04:13 +00:00
Joseph Myers ea3bc4e821 Fix x86 sqrt rounding (bug 14032). 2013-11-29 16:31:16 +00:00
Andreas Krebbel acd98a8ed1 [BZ #16214] S/390: Fix TLS GOT pointer setup. 2013-11-29 09:57:04 +01:00
Joseph Myers 8bca7cd830 Remove unused ldbl-96 functions (bug 15004). 2013-11-28 20:50:03 +00:00
Joseph Myers 91a1f3fea0 Add powerpc-nofpu/e500 support functions for atomic compound assignment and FLT_ROUNDS. 2013-11-28 18:01:41 +00:00
Joseph Myers 3c1c46a64a Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
Adhemerval Zanella bd12ab55c0 PowerPC: Fix __fe_nomask_env missing symbol
This patch fix the missing symbol __fe_nomask_env from commit
41e8926aa4 for GLIBC_2.1.
2013-11-26 07:25:08 -06:00
Ondřej Bílka ab260039a8 Fix typo in _dl_tlsdesc_resolve_hold. 2013-11-26 12:42:45 +01:00
Ondřej Bílka d1d9eaf478 Use __glibc_reserved instead __unused. 2013-11-26 12:32:28 +01:00
Carlos O'Donell a7624ed987 Fix typo in sys/ptrace.h.
The event code is PTRACE_EVENT_SECCOMP, not PTRAVE_EVENT_SECCOMP.
This patch fixes the V->C typo. There are no ABI issues since the
number remains the same for the code. Code using the old wrong
name will need to be updated.
2013-11-25 14:57:42 -05:00
Joseph Myers 63cfe52b6d Fix powerpc-nofpu build. 2013-11-25 19:07:55 +00:00
Adhemerval Zanella 41e8926aa4 PowerPC: Set/restore rounding mode only when needed
This patch helps some math functions performance by adding the libc_fexxx
variant of inline functions to handle both FPU round and exception set/restore
and by using them on the libc_fexxx_ctx functions. It is based on already coded
fexxx family functions for PPC with fpu.

Here is the summary of performance improvements due this patch (measured on a
POWER7 machine):

Before:

cos(): ITERS:9.5895e+07: TOTAL:5116.03Mcy, MAX:77.6cy, MIN:49.792cy, 18744 calls/Mcy
exp(): ITERS:2.827e+07: TOTAL:5187.15Mcy, MAX:494.018cy, MIN:38.422cy, 5450.01 calls/Mcy
pow(): ITERS:6.1705e+07: TOTAL:5144.26Mcy, MAX:171.95cy, MIN:29.935cy, 11994.9 calls/Mcy
sin(): ITERS:8.6898e+07: TOTAL:5117.06Mcy, MAX:83.841cy, MIN:46.582cy, 16982 calls/Mcy
tan(): ITERS:2.9473e+07: TOTAL:5115.39Mcy, MAX:191.017cy, MIN:172.352cy, 5761.63 calls/Mcy

After:

cos(): ITERS:2.05265e+08: TOTAL:5111.37Mcy, MAX:78.754cy, MIN:24.196cy, 40158.5 calls/Mcy
exp(): ITERS:3.341e+07: TOTAL:5170.84Mcy, MAX:476.317cy, MIN:15.574cy, 6461.23 calls/Mcy
pow(): ITERS:7.6153e+07: TOTAL:5129.1Mcy, MAX:147.5cy, MIN:30.916cy, 14847.2 calls/Mcy
sin(): ITERS:1.58816e+08: TOTAL:5115.11Mcy, MAX:1490.39cy, MIN:22.341cy, 31048.4 calls/Mcy
tan(): ITERS:3.4964e+07: TOTAL:5114.18Mcy, MAX:177.422cy, MIN:146.115cy, 6836.68 calls/Mcy
2013-11-25 06:34:41 -06:00
Roland McGrath 6851bd4d97 Adjust generic swapon prototype to match Linux version. 2013-11-21 15:44:26 -08:00
Guy Martin daf75146de Don't use broken DL_AUTO_FUNCTION_ADDRESS()
On hppa and ia64, the macro DL_AUTO_FUNCTION_ADDRESS() uses the
variable fptr[2] in it's own scope.

The content of fptr[] is thus undefined right after the macro exits.
Newer gcc's (>= 4.7) reuse the stack space of this variable triggering
a segmentation fault in dl-init.c:69.

To fix this we rewrite the macros to make the call directly to init
and fini without needing to pass back a constructed function pointer.
2013-11-21 15:52:31 -05:00
Siddhesh Poyarekar f3fd2628d8 Add systemtap probe markers for sin, cos, asin and acos 2013-11-20 07:46:48 +05:30
Joseph Myers 73c1ce4fdb Make powerpc-nofpu floating-point state thread-local (bug 15483). 2013-11-19 13:39:56 +00:00
Joseph Myers 6629449166 Fix spurious "inexact" exceptions from x86 pow with NaN argument (bug 16167). 2013-11-16 12:45:11 +00:00
Adhemerval Zanella 7ab44563a9 PowerPC: Fix __fe_mask_env export
Change SHLIB_COMPAT calls to GLIBC_2_19 for __fe_nomask_env symbol.
2013-11-13 12:58:56 -06:00
H.J. Lu 17c1d9f03e Set arch_minimum_kernel to 3.4.0 for x32
x32 ABI support was added in Linux kernel 3.4.0.
2013-11-13 05:43:58 -08:00
Adhemerval Zanella 7a2ad8cf39 PowerPC: Fix __fe_mask_env export
This patch does not export __fe_mask_env anymore, only providing a
compatibility symbol. It fixes BZ#14143.
2013-11-13 06:45:19 -06:00
David S. Miller 7ddace62b0 Fix sparc 64-bit GMP ifunc resolution in static builds.
[BZ #16150]
	* sysdeps/sparc/sparc64/multiarch/add_n.S: Resolve to the correct generic
	symbol in the non-vis3 case in static builds.
	* sysdeps/sparc/sparc64/multiarch/addmul_1.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/mul_1.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/sub_n.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/submul_1.S: Likewise.
2013-11-12 12:48:01 -08:00
Adhemerval Zanella 76a9b99861 PowerPC: Fix vDSO missing ODP entries
This patch fixes the vDSO symbol used directed in IFUNC resolver where
they do not have an associated ODP entry leading to undefined behavior
in some cases. It adds an artificial OPD static entry to such cases
and set its TOC to non 0 to avoid triggering lazy resolutions.
2013-11-08 05:04:25 -06:00
David S. Miller 8d6bb57c44 Fix build on pre-v9 32-bit Sparc.
We cannot use fnegd in this code, as fnegd was added in v9.
Only fnegs exists in v8 and earlier.

	[BZ #15985]
	* sysdeps/sparc/sparc32/fpu/s_fdim.S (__fdim): Do not use fnegd
	on pre-v9 cpus, use a fnegs+fmovs sequence instead.
2013-11-06 13:23:36 -08:00
Ondřej Bílka 5d30d85329 Restrict shm_open and shm_unlink to SHMDIR. Fixes bugs 14752 and 15763. 2013-10-31 13:59:01 +01:00
Mike Frysinger cb8a6dbd17 rename configure.in to configure.ac
Autoconf has been deprecating configure.in for quite a long time.
Rename all our configure.in and preconfigure.in files to .ac.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-10-30 17:32:08 +10:00
Siddhesh Poyarekar c79a12040c Consolidate conditionals in mp sin/cos functions
Consolidate conditionals in multiple precision sin and cos functions
to prepare the code for addition of probe points.
2013-10-28 16:21:54 +05:30
Adhemerval Zanella 69f13dbf06 PowerPC: strcpy/stpcpy optimization for PPC64/POWER7
This patch intends to unify both strcpy and stpcpy implementationsi
for PPC64 and PPC64/POWER7. The idead default powerpc64 implementation
is to provide both doubleword and word aligned memory access.

For PPC64/POWER7 is also provide doubleword and word memory access,
remove the branch hints, use the cmpb instruction for compare
doubleword/words, and add an optimization for inputs of same alignment.
2013-10-25 13:28:24 -05:00
Siddhesh Poyarekar 7cbcdb3699 Fix stack overflow due to large AF_INET6 requests
Resolves #16072 (CVE-2013-4458).

This patch fixes another stack overflow in getaddrinfo when it is
called with AF_INET6.  The AF_UNSPEC case was fixed as CVE-2013-1914,
but the AF_INET6 case went undetected back then.
2013-10-25 10:22:12 +05:30
Allan McRae 894f3f1049 Fix incorrect getaddrinfo assertion trigger
[BZ #9954]

With the following /etc/hosts:
127.0.0.1       www.my-domain.es
127.0.1.1       www.my-domain.es
192.168.0.1     www.my-domain.es

Using getaddrinfo() on www.my-domain.es, trigger the following assertion:
../sysdeps/posix/getaddrinfo.c:1473: rfc3484_sort: Assertion
`src->results[i].native == -1 || src->results[i].native == a1_native' failed.

This is due to two different bugs:
- In rfc3484_sort() rule 7, src->results[i].native is assigned even if
src->results[i].index is -1, meaning that no interface is associated.
- In getaddrinfo() the source IP address used with the lo interface needs a
special case, as it can be any IP within 127.X.Y.Z.
2013-10-25 14:28:32 +10:00
Joseph Myers 3c8325fb47 Add e500 port. 2013-10-18 21:04:22 +00:00
Andreas Schwab b957ced889 Don't use gethostbyaddr to determine canonical name 2013-10-17 16:34:27 +02:00
Ondřej Bílka c5d5d574cb Format floating routines. 2013-10-17 16:03:24 +02:00
Siddhesh Poyarekar 10e1cf6b73 Add systemtap markers to math function slow paths
Add systemtap probes to various slow paths in libm so that application
developers may use systemtap to find out if their applications are
hitting these slow paths.  We have added probes for pow, exp, log,
tan, atan and atan2.
2013-10-11 22:37:53 +05:30
David S. Miller 75b4202ab0 Fix readdir regressions on sparc 32-bit.
* sysdeps/posix/dirstream.h (struct __dirstream): Fix alignment of
	directory block.
2013-10-10 22:32:36 -07:00
David S. Miller 3bf78b7174 Update sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2013-10-10 14:42:58 -07:00
Joseph Myers bd878fc030 Extend powerpc-nofpu -fno-builtin-fabsl workaround to more files. 2013-10-10 19:12:09 +00:00
Joseph Myers 6f10289efb Avoid ordered comparisons of NaNs in ldbl-128ibm acosl and asinl. 2013-10-10 19:11:30 +00:00
Joseph Myers 2ae21ed2d2 soft-fp: fix negation NaN handling (bug 16034). 2013-10-10 11:38:56 +00:00
Ondřej Bílka e7044ea76b Use p2align instead ALIGN 2013-10-08 15:46:48 +02:00
Siddhesh Poyarekar 885766357d Format e_pow.c 2013-10-08 16:23:16 +05:30
Siddhesh Poyarekar e7b2d1dd62 Format e_exp.c 2013-10-08 16:22:28 +05:30
Siddhesh Poyarekar 09544cbcd6 Consolidate multiple precision sin/cos functions 2013-10-08 11:50:17 +05:30
Samuel Thibault 7b7bab1391 Add fork hooks for pthread_atfork
pthread_atfork needs application callbacks to be called outside any locking.
2013-10-04 22:29:51 +02:00
Joseph Myers 29d73d867e Move powerpc ports pieces to libc. 2013-10-04 16:02:33 +00:00
Joseph Myers e246b34759 e500 port: adjust sysdeps/unix/sysv/linux/configure.in case. 2013-10-04 15:57:50 +00:00
Joseph Myers 89c2003e84 e500 port: fix fpu_control.h constant values. 2013-10-04 15:56:48 +00:00
Joseph Myers cd78f7e767 e500 port: getcontext / setcontext / swapcontext. 2013-10-04 15:55:15 +00:00
Alan Modra 4cb81307b3 Use stdint.h types in union unaligned.
* sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela):
	Use stdint types in rather than __attribute__((mode())).
	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.
2013-10-04 12:51:11 +09:30
Alan Modra f8e3e9f31b Correct little-endian relocation of UADDR64,32,16.
* sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela):
	Correct handling of unaligned relocs for little-endian.
	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.
2013-10-04 11:33:12 +09:30
Alan Modra 466b039332 PowerPC LE memchr and memrchr
http://sourceware.org/ml/libc-alpha/2013-08/msg00105.html

Like strnlen, memchr and memrchr had a number of defects fixed by this
patch as well as adding little-endian support.  The first one I
noticed was that the entry to the main loop needlessly checked for
"are we done yet?" when we know the size is large enough that we can't
be done.  The second defect I noticed was that the main loop count was
wrong, which in turn meant that the small loop needed to handle an
extra word.  Thirdly, there is nothing to say that the string can't
wrap around zero, except of course that we'd normally hit a segfault
on trying to read from address zero.  Fixing that simplified a number
of places:

-	/* Are we done already?  */
-	addi    r9,r8,8
-	cmpld	r9,r7
-	bge	L(null)

becomes

+	cmpld	r8,r7
+	beqlr

However, the exit gets an extra test because I test for being on the
last word then if so whether the byte offset is less than the end.
Overall, the change is a win.

Lastly, memrchr used the wrong cache hint.

	* sysdeps/powerpc/powerpc64/power7/memchr.S: Replace rlwimi with
	insrdi.  Make better use of reg selection to speed exit slightly.
	Schedule entry path a little better.  Remove useless "are we done"
	checks on entry to main loop.  Handle wrapping around zero address.
	Correct main loop count.  Handle single left-over word from main
	loop inline rather than by using loop_small.  Remove extra word
	case in loop_small caused by wrong loop count.  Add little-endian
	support.
	* sysdeps/powerpc/powerpc32/power7/memchr.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/memrchr.S: Likewise.  Use proper
	cache hint.
	* sysdeps/powerpc/powerpc32/power7/memrchr.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/rawmemchr.S: Add little-endian
	support.  Avoid rlwimi.
	* sysdeps/powerpc/powerpc32/power7/rawmemchr.S: Likewise.
2013-10-04 10:41:46 +09:30
Alan Modra 3be87c77d2 PowerPC LE memset
http://sourceware.org/ml/libc-alpha/2013-08/msg00104.html

One of the things I noticed when looking at power7 timing is that rlwimi
is cracked and the two resulting insns have a register dependency.
That makes it a little slower than the equivalent rldimi.

	* sysdeps/powerpc/powerpc64/memset.S: Replace rlwimi with
        insrdi.  Formatting.
	* sysdeps/powerpc/powerpc64/power4/memset.S: Likewise.
	* sysdeps/powerpc/powerpc64/power6/memset.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/memset.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/memset.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/memset.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/memset.S: Likewise.
2013-10-04 10:41:35 +09:30
Alan Modra 759cfef3ac PowerPC LE memcpy
http://sourceware.org/ml/libc-alpha/2013-08/msg00103.html

LIttle-endian support for memcpy.  I spent some time cleaning up the
64-bit power7 memcpy, in order to avoid the extra alignment traps
power7 takes for little-endian.  It probably would have been better
to copy the linux kernel version of memcpy.

	* sysdeps/powerpc/powerpc32/power4/memcpy.S: Add little endian support.
	* sysdeps/powerpc/powerpc32/power6/memcpy.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/memcpy.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/mempcpy.S: Likewise.
	* sysdeps/powerpc/powerpc64/memcpy.S: Likewise.
	* sysdeps/powerpc/powerpc64/power4/memcpy.S: Likewise.
	* sysdeps/powerpc/powerpc64/power6/memcpy.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/memcpy.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/mempcpy.S: Likewise.  Make better
	use of regs.  Use power7 mtocrf.  Tidy function tails.
2013-10-04 10:41:24 +09:30
Alan Modra fe6e95d717 PowerPC LE memcmp
http://sourceware.org/ml/libc-alpha/2013-08/msg00102.html

This is a rather large patch due to formatting and renaming.  The
formatting changes were to make it possible to compare power7 and
power4 versions of memcmp.  Using different register defines came
about while I was wrestling with the code, trying to find spare
registers at one stage.  I found it much simpler if we refer to a reg
by the same name throughout a function, so it's better if short-term
multiple use regs like rTMP are referred to using their register
number.  I made the cr field usage changes when attempting to reload
rWORDn regs in the exit path to byte swap before comparing when
little-endian.  That proved a bad idea due to the pipelining involved
in the main loop;  Offsets to reload the regs were different first
time around the loop..  Anyway, I left the cr field usage changes in
place for consistency.

Aside from these more-or-less cosmetic changes, I fixed a number of
places where an early exit path restores regs unnecessarily, removed
some dead code, and optimised one or two exits.

	* sysdeps/powerpc/powerpc64/power7/memcmp.S: Add little-endian support.
	Formatting.  Consistently use rXXX register defines or rN defines.
	Use early exit labels that avoid restoring unused non-volatile regs.
	Make cr field use more consistent with rWORDn compares.  Rename
	regs used as shift registers for unaligned loop, using rN defines
	for short lifetime/multiple use regs.
	* sysdeps/powerpc/powerpc64/power4/memcmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/memcmp.S: Likewise.  Exit with
	addi 1,1,64 to pop stack frame.  Simplify return value code.
	* sysdeps/powerpc/powerpc32/power4/memcmp.S: Likewise.
2013-10-04 10:40:56 +09:30
Alan Modra 664318c3eb PowerPC LE strchr
http://sourceware.org/ml/libc-alpha/2013-08/msg00101.html

Adds little-endian support to optimised strchr assembly.  I've also
tweaked the big-endian code a little.  In power7/strchr.S there's a
check in the tail of the function that we didn't match 0 before
finding a c match, done by comparing leading zero counts.  It's just
as valid, and quicker, to compare the raw output from cmpb.

Another little tweak is to use rldimi/insrdi in place of rlwimi for
the power7 strchr functions.  Since rlwimi is cracked, it is a few
cycles slower.  rldimi can be used on the 32-bit power7 functions
too.

	* sysdeps/powerpc/powerpc64/power7/strchr.S (strchr): Add little-endian
	support.  Correct typos, formatting.  Optimize tail.  Use insrdi
	rather than rlwimi.
	* sysdeps/powerpc/powerpc32/power7/strchr.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/strchrnul.S (__strchrnul): Add
	little-endian support.  Correct typos.
	* sysdeps/powerpc/powerpc32/power7/strchrnul.S: Likewise.  Use insrdi
	rather than rlwimi.
	* sysdeps/powerpc/powerpc64/strchr.S (rTMP4, rTMP5): Define.  Use
	in loop and entry code to keep "and." results.
	(strchr): Add little-endian support.  Comment.  Move cntlzd
	earlier in tail.
	* sysdeps/powerpc/powerpc32/strchr.S: Likewise.
2013-10-04 10:40:22 +09:30
Alan Modra 43b8401371 PowerPC LE strcpy
http://sourceware.org/ml/libc-alpha/2013-08/msg00100.html

The strcpy changes for little-endian are quite straight-forward, just
a matter of rotating the last word differently.

I'll note that the powerpc64 version of stpcpy is just begging to be
converted to use 64-bit loads and stores..

	* sysdeps/powerpc/powerpc64/strcpy.S: Add little-endian support:
	* sysdeps/powerpc/powerpc32/strcpy.S: Likewise.
	* sysdeps/powerpc/powerpc64/stpcpy.S: Likewise.
	* sysdeps/powerpc/powerpc32/stpcpy.S: Likewise.
2013-10-04 10:40:11 +09:30
Alan Modra 8a7413f9b0 PowerPC LE strcmp and strncmp
http://sourceware.org/ml/libc-alpha/2013-08/msg00099.html

More little-endian support.  I leave the main strcmp loops unchanged,
(well, except for renumbering rTMP to something other than r0 since
it's needed in an addi insn) and modify the tail for little-endian.

I noticed some of the big-endian tail code was a little untidy so have
cleaned that up too.

	* sysdeps/powerpc/powerpc64/strcmp.S (rTMP2): Define as r0.
	(rTMP): Define as r11.
	(strcmp): Add little-endian support.  Optimise tail.
	* sysdeps/powerpc/powerpc32/strcmp.S: Similarly.
	* sysdeps/powerpc/powerpc64/strncmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/strncmp.S: Likewise.
	* sysdeps/powerpc/powerpc64/power4/strncmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/strncmp.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/strncmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/strncmp.S: Likewise.
2013-10-04 10:39:52 +09:30
Alan Modra 33ee81de05 PowerPC LE strnlen
http://sourceware.org/ml/libc-alpha/2013-08/msg00098.html

The existing strnlen code has a number of defects, so this patch is more
than just adding little-endian support.  The changes here are similar to
those for memchr.

	* sysdeps/powerpc/powerpc64/power7/strnlen.S (strnlen): Add
	little-endian support.  Remove unnecessary "are we done" tests.
	Handle "s" wrapping around zero and extremely large "size".
	Correct main loop count.  Handle single left-over word from main
	loop inline rather than by using small_loop.  Correct comments.
	Delete "zero" tail, use "end_max" instead.
	* sysdeps/powerpc/powerpc32/power7/strnlen.S: Likewise.
2013-10-04 10:39:42 +09:30
Alan Modra db9b4570c5 PowerPC LE strlen
http://sourceware.org/ml/libc-alpha/2013-08/msg00097.html

This is the first of nine patches adding little-endian support to the
existing optimised string and memory functions.  I did spend some
time with a power7 simulator looking at cycle by cycle behaviour for
memchr, but most of these patches have not been run on cpu simulators
to check that we are going as fast as possible.  I'm sure PowerPC can
do better.  However, the little-endian support mostly leaves main
loops unchanged, so I'm banking on previous authors having done a
good job on big-endian..  As with most code you stare at long enough,
I found some improvements for big-endian too.

Little-endian support for strlen.  Like most of the string functions,
I leave the main word or multiple-word loops substantially unchanged,
just needing to modify the tail.

Removing the branch in the power7 functions is just a tidy.  .align
produces a branch anyway.  Modifying regs in the non-power7 functions
is to suit the new little-endian tail.

	* sysdeps/powerpc/powerpc64/power7/strlen.S (strlen): Add little-endian
	support.  Don't branch over align.
	* sysdeps/powerpc/powerpc32/power7/strlen.S: Likewise.
	* sysdeps/powerpc/powerpc64/strlen.S (strlen): Add little-endian support.
	Rearrange tmp reg use to suit.  Comment.
	* sysdeps/powerpc/powerpc32/strlen.S: Likewise.
2013-10-04 10:39:32 +09:30
Alan Modra f7c399cff5 PowerPC SIGSTKSZ
http://sourceware.org/ml/libc-alpha/2013-08/msg00093.html

This copies the sparc version of sigstack.h, which gives powerpc
 #define MINSIGSTKSZ     4096
 #define SIGSTKSZ        16384

Before the VSX changes, struct rt_sigframe size was 1920 plus 128 for
__SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of
2048.

After VSX, ucontext increased by 256 bytes.  Oops, we're over
MINSIGSTKSZ, so powerpc has been using the wrong value for quite a
while.  Add another ucontext for TM and rt_sigframe is now at 3872,
giving actual MINSIGSTKSZ of 4000.

The glibc testcase that I was looking at was tst-cancel21, which
allocates 2*SIGSTKSZ (not because the test is trying to be
conservative, but because the test actually has nested signal stack
frames).  We blew the allocation by 48 bytes when using current
mainline gcc to compile glibc (le ppc64).

The required stack depth in _dl_lookup_symbol_x from the top of the
next signal frame was 10944 bytes.  I guess you'd want to add 288 to
that, implying an actual SIGSTKSZ of 11232.

	* sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h: New file.
2013-10-04 10:39:11 +09:30
Alan Modra 0b2c2ace36 PowerPC makecontext
http://sourceware.org/ml/libc-alpha/2013-08/msg00092.html

Use conditional form of branch and link to avoid destroying the cpu
link stack used to predict blr return addresses.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S: Use
	conditional form of branch and link when obtaining pc.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
2013-10-04 10:38:59 +09:30
Alan Modra 02f04a6c7f PowerPC LE _dl_hwcap access
http://sourceware.org/ml/libc-alpha/2013-08/msg00091.html

More LE support, correcting word accesses to _dl_hwcap.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use
	HIWORD/LOWORD.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto.
2013-10-04 10:38:46 +09:30
Alan Modra 9b874b2f1e PowerPC ugly symbol versioning
http://sourceware.org/ml/libc-alpha/2013-08/msg00090.html

This patch fixes symbol versioning in setjmp/longjmp.  The existing
code uses raw versions, which results in wrong symbol versioning when
you want to build glibc with a base version of 2.19 for LE.

Note that the merging the 64-bit and 32-bit versions in novmx-lonjmp.c
and pt-longjmp.c doesn't result in GLIBC_2.0 versions for 64-bit, due
to the base in shlib_versions.

	* sysdeps/powerpc/longjmp.c: Use proper symbol versioning macros.
	* sysdeps/powerpc/novmx-longjmp.c: Likewise.
	* sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/bsd-setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc32/mcount.c: Likewise.
	* sysdeps/powerpc/powerpc32/setjmp.S: Likewise.
	* sysdeps/powerpc/powerpc64/setjmp.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Likewise.
2013-10-04 10:38:28 +09:30
Anton Blanchard be1e5d3113 PowerPC LE setjmp/longjmp
http://sourceware.org/ml/libc-alpha/2013-08/msg00089.html

Little-endian fixes for setjmp/longjmp.  When writing these I noticed
the setjmp code corrupts the non volatile VMX registers when using an
unaligned buffer.  Anton fixed this, and also simplified it quite a
bit.

The current code uses boilerplate for the case where we want to store
16 bytes to an unaligned address.  For that we have to do a
read/modify/write of two aligned 16 byte quantities.  In our case we
are storing a bunch of back to back data (consective VMX registers),
and only the start and end of the region need the read/modify/write.

	[BZ #15723]
	* sysdeps/powerpc/jmpbuf-offsets.h: Comment fix.
	* sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: Correct
	_dl_hwcap access for little-endian.
	* sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise.  Don't
	destroy vmx regs when saving unaligned.
	* sysdeps/powerpc/powerpc64/__longjmp-common.S: Correct CR load.
	* sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise CR save.  Don't
	destroy vmx regs when saving unaligned.
2013-10-04 10:37:59 +09:30
Alan Modra fef13a78ea PowerPC floating point little-endian [15 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00206.html

The union loses when little-endian.

	* sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_NOW):
	Don't use a union to pack hi/low value.
2013-10-04 10:37:27 +09:30
Anton Blanchard 76a66d510a PowerPC floating point little-endian [14 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00205.html

These all wrongly specified float constants in a 64-bit word.

	* sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Correct float constants
	for little-endian.
	* sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.
2013-10-04 10:36:24 +09:30
Alan Modra 6a31fe7f9c PowerPC floating point little-endian [13 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00088.html

	* sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Increase alignment of
	constants to usual value for .cst8 section, and remove redundant
	high address load.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Use float
	constant for 0x1p52.  Load little-endian words of double from
	correct stack offsets.
2013-10-04 10:35:54 +09:30
Alan Modra 7b88401f3b PowerPC floating point little-endian [12 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00087.html

Fixes for little-endian in 32-bit assembly.

	* sysdeps/powerpc/sysdep.h (LOWORD, HIWORD, HISHORT): Define.
	* sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Load little-endian
	words of double from correct stack offsets.
	* sysdeps/powerpc/powerpc32/fpu/s_copysignl.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Likewise.
	* sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Use HISHORT.
	* sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise.
2013-10-04 10:35:43 +09:30
Alan Modra 9c008155b7 PowerPC floating point little-endian [11 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00202.html

Another little-endian fix.

	* sysdeps/powerpc/fpu_control.h (_FPU_GETCW): Rewrite using
	64-bit int/double union.
	(_FPU_SETCW): Likewise.
	* sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_GET_DI_FPSCR): Likewise.
	(_SET_DI_FPSCR, _GET_SI_FPSCR, _SET_SI_FPSCR): Likewise.
2013-10-04 10:35:21 +09:30
Alan Modra da13146da1 PowerPC floating point little-endian [10 of 15]
http://sourceware.org/ml/libc-alpha/2013-07/msg00201.html

These two functions oddly test x+1>0 when a double x is >= 0.0, and
similarly when x is negative.  I don't see the point of that since the
test should always be true.  I also don't see any need to convert x+1
to integer rather than simply using xr+1.  Note that the standard
allows these functions to return any value when the input is outside
the range of long long, but it's not too hard to prevent xr+1
overflowing so that's what I've done.

(With rounding mode FE_UPWARD, x+1 can be a lot more than what you
might naively expect, but perhaps that situation was covered by the
x - xrf < 1.0 test.)

	* sysdeps/powerpc/fpu/s_llround.c (__llround): Rewrite.
	* sysdeps/powerpc/fpu/s_llroundf.c (__llroundf): Rewrite.
2013-10-04 10:35:10 +09:30