Commit Graph

284 Commits

Author SHA1 Message Date
Joseph Myers
b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
David S. Miller
0d4ba8be9c Fix soft-fp build warning on sparc about strict aliasing.
* sysdeps/sparc/sparc32/soft-fp/q_neg.c (_Q_neg): Use a union to
	access the quad as both a long double and as a series of 4 words.
2014-12-19 13:45:31 -08:00
Siddhesh Poyarekar
a109996ef9 Remove IS_IN_libm
Replace with IS_IN (libm). Generated code unchanged on x86_64.

        * include/math.h: Use IS_IN instead of IS_IN_libm.
        * sysdeps/alpha/fpu/s_copysign.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_finitel.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_fmal.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_frexpl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_isinfl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_isnanl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_modfl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c: Likewise.
        * sysdeps/ieee754/ldbl-128ibm/s_signbitl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_copysignl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_finitel.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_frexpl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_isinfl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_isnanl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_modfl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_scalbnl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/s_signbitl.c: Likewise.
        * sysdeps/ieee754/ldbl-64-128/w_scalblnl.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_copysign.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_finite.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_frexp.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_isinf.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_isnan.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_ldexp.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_ldexpl.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_modf.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_scalbln.c: Likewise.
        * sysdeps/ieee754/ldbl-opt/s_scalbn.c: Likewise.
        * sysdeps/powerpc/power5+/fpu/s_modf.c: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/s_copysignl.S: Likewise.
        * sysdeps/powerpc/powerpc32/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise.
        * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c: Likewise.
        * sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.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/fpu/multiarch/s_copysign.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/s_copysignl.S: Likewise.
        * sysdeps/powerpc/powerpc64/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Likewise.
        * sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Likewise.
        * sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise.
        * sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S: Likewise.
        * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: Likewise.
        * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: Likewise.
        * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: Likewise.
        * sysdeps/sparc/sparc32/fpu/s_signbitl.S: Likewise.
        * sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S: Likewise.
        * sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S: Likewise.
2014-11-24 11:41:47 +05:30
Siddhesh Poyarekar
ce9f10f7f0 Remove IS_IN_libpthread
Replace with IS_IN (libpthread).  Generated code unchanged on
x86_64.

	* nptl/lowlevellock.c: Use IS_IN instead of IS_IN_libpthread.
	* nptl/pthreadP.h: Likewise.
	* nptl_db/structs.def: Likewise.
	* sysdeps/arm/sysdep.h: Likewise.
	* sysdeps/nptl/bits/libc-lock.h: Likewise.
	* sysdeps/nptl/bits/libc-lockP.h: Likewise.
	* sysdeps/sparc/sparc32/lowlevellock.c: Likewise.
	* sysdeps/unix/alpha/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/not-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2014-11-24 11:41:46 +05:30
Torvald Riegel
1ea339b697 Add arch-specific configuration for C11 atomics support.
This sets __HAVE_64B_ATOMICS if provided.  It also sets
USE_ATOMIC_COMPILER_BUILTINS to true if the existing atomic ops use the
__atomic* builtins (aarch64, mips partially) or if this has been
tested (x86_64); otherwise, this is set to false so that C11 atomics will
be based on the existing atomic operations.
2014-11-20 11:57:38 +01:00
Joseph Myers
c5684fdb2b Don't use INTDEF/INTUSE with _dl_init (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch eliminates its use for _dl_init.  Since _dl_init was already
declared with hidden visibility, creating a second hidden alias for it
was completely pointless, so this patch replaces all uses of
_dl_init_internal with plain _dl_init instead of using hidden_proto /
hidden_def (which are only needed when you want a hidden alias for a
non-hidden symbol; it's quite possible there are cases where they are
used but don't need to be because the symbol in question is not part
of the public ABI and is only used within a single library, so using
attributes_hidden instead would suffice).

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

	[BZ #14132]
	* elf/dl-init.c (_dl_init): Don't use INTDEF.
	* sysdeps/aarch64/dl-machine.h (RTLD_START): Use _dl_init instead
	of _dl_init_internal.
	* sysdeps/alpha/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/arm/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/hppa/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/i386/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/ia64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/m68k/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/microblaze/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/mips/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/powerpc/powerpc32/dl-start.S (_start): Likewise.
	* sysdeps/s390/s390-32/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/s390/s390-64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/sh/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/sparc/sparc32/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/sparc/sparc64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/tile/dl-start.S (_start): Likewise.
	* sysdeps/x86_64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/x86_64/x32/dl-machine.h (RTLD_START): Likewise.
2014-11-04 23:26:39 +00:00
Torvald Riegel
ff9dbdc048 Fix SPARC atomic_write_barrier. 2014-10-31 12:00:38 +01:00
Joseph Myers
73e28d9c88 soft-fp: Refactor exception handling for comparisons.
This patch refactors how soft-fp comparisons handle setting exceptions
for NaN operands, so that exceptions are set through the FP_CMP macros
rather than directly in the C files calling them.

The _FP_CMP* and FP_CMP* macros gain an extra argument to specify when
exceptions should be set, 0 for no exception setting (I'm not sure
this is actually needed - at least it's not needed for IEEE operations
in glibc / libgcc, but might be relevant in some cases for kernel
use), 1 for exceptions only for signaling NaNs and 2 for exceptions
for all NaNs.  This argument is handled through _FP_CMP_CHECK_NAN,
newly called by the _FP_CMP* macros when a NaN is encountered.  Calls
to these macros are updated, which eliminates all the existing
checking and exception setting in soft-fp *.c files in glibc.

Tested for powerpc-nofpu.  (The __unord* functions have no code
changes; the __eq* / __ge* / __le* functions get slightly larger, but
I don't think that's significant.)

	* soft-fp/op-common.h (_FP_CMP_CHECK_NAN): New macro.
	(_FP_CMP): Add extra argument EX.  Call _FP_CMP_CHECK_NAN.
	(_FP_CMP_EQ): Likewise.
	(_FP_CMP_UNORD): Likewise.
	* soft-fp/double.h (FP_CMP_D): Add extra argument EX.
	(FP_CMP_EQ_D): Likewise.
	(FP_CMP_UNORD_D): Likewise.
	* soft-fp/extended.h (FP_CMP_E): Likewise.
	(FP_CMP_EQ_E): Likewise.
	(FP_CMP_UNORD_E): Likewise.
	* soft-fp/quad.h (FP_CMP_Q): Likewise.
	(FP_CMP_EQ_Q): Likewise.
	(FP_CMP_UNORD_Q): Likewise.
	* soft-fp/single.h (FP_CMP_S): Likewise.
	(FP_CMP_EQ_S): Likewise.
	(FP_CMP_UNORD_S): Likewise.
	* soft-fp/eqdf2.c (__eqdf2): Update call to FP_CMP_EQ_D.
	* soft-fp/eqsf2.c (__eqsf2): Update call to FP_CMP_EQ_S.
	* soft-fp/eqtf2.c (__eqtf2): Update call to FP_CMP_EQ_Q.
	* soft-fp/gedf2.c (__gedf2): Update call to FP_CMP_D.
	* soft-fp/gesf2.c (__gesf2): Update call to FP_CMP_S.
	* soft-fp/getf2.c (__getf2): Update call to FP_CMP_Q.
	* soft-fp/ledf2.c (__ledf2): Update call to FP_CMP_D.
	* soft-fp/lesf2.c (__lesf2): Update call to FP_CMP_S.
	* soft-fp/letf2.c (__letf2): Update call to FP_CMP_Q.
	* soft-fp/unorddf2.c (__unorddf2): Update call to FP_CMP_UNORD_D.
	* soft-fp/unordsf2.c (__unordsf2): Update call to FP_CMP_UNORD_S.
	* soft-fp/unordtf2.c (__unordtf2): Update call to FP_CMP_UNORD_Q.
	* sysdeps/alpha/soft-fp/ots_cmpe.c (internal_compare): Update call
	to FP_CMP_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_cmp.c (_Q_cmp): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_cmpe.c (_Q_cmpe): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_feq.c (_Q_feq): Update call to
	FP_CMP_EQ_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_fge.c (_Q_fge): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_fgt.c (_Q_fgt): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_fle.c (_Q_fle): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_flt.c (_Q_flt): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_fne.c (_Q_fne): Update call to
	FP_CMP_EQ_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_cmp.c (_Qp_cmp): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c (_Qp_cmpe): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_feq.c (_Qp_feq): Update call to
	FP_CMP_EQ_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_fge.c (_Qp_fge): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_fgt.c (_Qp_fgt): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_fle.c (_Qp_fle): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_flt.c (_Qp_flt): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_fne.c (_Qp_fne): Update call to
	FP_CMP_EQ_Q.
2014-10-09 01:03:56 +00:00
Joseph Myers
2d6a47ba4c soft-fp: Remove FP_CLEAR_EXCEPTIONS.
As noted in
<https://sourceware.org/ml/libc-alpha/2013-10/msg00516.html>, the
soft-fp macro FP_CLEAR_EXCEPTIONS should not be necessary, as soft-fp
code should never set an exception and later clear it.

In fact, all four uses in glibc (for SPARC) are indeed unnecessary:
they appear in files that convert 32-bit or 64-bit integers to IEEE
binary128, an operation that can never raise any exceptions.  If this
was intended to enable the compiler to optimize away any FP_FROM_INT
code testing for exceptional cases, we now have a better way of doing
this: defining FP_NO_EXCEPTIONS before including soft-fp.h causes all
code handling exceptions to be stubbed out, and the rounding mode to
be hardwired for round-to-zero, to allow such optimizations for source
files where (a) the operation in question, for the particular types in
question, can never raise exceptions, but (b) some instances of the
operation for other types can, so the macros used in the file do
contain references to rounding or exceptions, albeit dead in that
particular file.

The uses in the Linux kernel are also unnecessary (clearing exceptions
at a point where they are already cleared).

This patch duly removes FP_CLEAR_EXCEPTIONS, making the SPARC code in
question use FP_NO_EXCEPTIONS and stop using exception-related macros.

	* soft-fp/soft-fp.h (FP_CLEAR_EXCEPTIONS): Remove macro.
	* sysdeps/sparc/sparc32/soft-fp/q_itoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_itoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
	* sysdeps/sparc/sparc32/soft-fp/q_lltoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_lltoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
	* sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_ulltoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
	* sysdeps/sparc/sparc32/soft-fp/q_utoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_utoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
2014-10-09 00:58:42 +00:00
David S. Miller
7000d82e01 Get rid of sparc specific NPTL internaltypes.h header.
* sysdeps/sparc/nptl/internaltypes.h: Delete.
	* sysdeps/sparc/nptl/sparc-nptl.h: New file.
	* sysdeps/sparc/nptl/pthread_barrier_destroy.c: Include it.
	* sysdeps/sparc/nptl/pthread_barrier_init.c: Likewise.
	* sysdeps/sparc/nptl/pthread_barrier_wait.c: Likewise.
	* sysdeps/sparc/nptl/sem_init.c: Likewise.
	* sysdeps/sparc/nptl/sem_post.c: Likewise.
	* sysdeps/sparc/nptl/sem_timedwait.c: Likewise.
	* sysdeps/sparc/nptl/sem_wait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/pthread_barrier_wait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_post.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_timedwait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_wait.c: Likewise.
2014-07-09 22:19:09 -07:00
Roland McGrath
08192659bb Get rid of nptl/sysdeps/ entirely! 2014-07-07 09:28:38 -07:00
Richard Henderson
05502548e9 Always provide HP_SMALL_TIMING_AVAIL 2014-07-03 08:38:36 -07:00
Richard Henderson
86e1a7ff92 Unify hp-timing implementations
Provide an hp-timing-common.h for ports to use.
2014-07-03 08:38:30 -07:00
Richard Henderson
428dd03f5a Remove HP_TIMING_DIFF_INIT and dl_hp_timing_overhead
Without HP_TIMING_ACCUM, dl_hp_timing_overhead is write-only.
If we remove it, there's no point in HP_TIMING_DIFF_INIT either.
2014-07-03 08:38:25 -07:00
Richard Henderson
c39323e9d2 Removing HP_TIMING_ACCUM as unused 2014-07-03 08:38:21 -07:00
Richard Henderson
850e0e032b Removing HP_TIMING_ZERO as unused 2014-07-03 08:38:18 -07:00
Siddhesh Poyarekar
4cf5b6d0d7 Fix Wundef warning for ELF_MACHINE_NO_RELA
This patch defines ELF_MACHINE_NO_RELA on all architectures.  Tested
only on x86_64 to verify that the sources before and after are
identical except for two instructions that pass the current line
number in dl-machine.h to assert_fail.
2014-06-26 22:30:40 +05:30
Roland McGrath
74836003ed SPARC: Consolidate unnecessary nptl/ subdirectories. 2014-06-25 10:04:14 -07:00
Roland McGrath
4b88139b6f Move remaining SPARC code out of nptl/. 2014-06-20 17:13:47 -07:00
Roland McGrath
e26822463f Move SPARC code out of nptl/sysdeps/sparc/. 2014-06-12 14:33:59 -07:00
Joseph Myers
ace614b8a5 soft-fp: support after-rounding tininess detection.
IEEE 754-2008 defines two ways in which tiny results can be detected,
"before rounding" (based on the infinite-precision result) and "after
rounding" (based on the result when rounded to normal precision as if
the exponent range were unbounded).  All binary operations on an
architecture must use the same choice of how tininess is detected.

soft-fp has so far implemented only before-rounding tininess
detection.  This patch adds support for after-rounding tininess
detection.  A new macro _FP_TININESS_AFTER_ROUNDING is added that
sfp-machine.h must define (soft-fp is meant to be self-contained so
the existing tininess.h files aren't used here, though the information
going in sfp-machine.h has been taken from them).  The soft-fp macros
dealing with raising underflow exceptions then handle the cases where
the choice matters specially, rounding a copy of the input to the
appropriate precision to see if a value that's tiny before rounding
isn't tiny after rounding.

Tested for mips64 using GCC trunk (which now uses soft-fp on MIPS, so
supporting exceptions and rounding modes for long double where not
previously supported - this is the immediate motivation for doing this
patch now) together with (a) a patch to sysdeps/mips/math-tests.h to
enable exceptions / rounding modes tests for long double for GCC 4.9
and later, and (b) corresponding changes applied to libgcc's soft-fp
and sfp-machine.h files.  In the libgcc context this is also tested on
x86_64 (also an after-rounding architecture) with testcases for
__float128 that I intend to add to the GCC testsuite when updating
soft-fp there.

(To be clear: this patch does not fix any glibc bugs that were
user-visible in past releases, since after-rounding architectures
didn't use soft-fp in any affected case with support for
floating-point exceptions - so there is no corresponding Bugzilla bug.
Rather, it works together with the GCC changes to use soft-fp on MIPS
to allow previously absent long double functionality to work properly,
and allows soft-fp to be used in glibc on after-rounding architectures
in cases where it couldn't previously be used.)

	* soft-fp/op-common.h (_FP_DECL): Mark exponent as possibly
	unused.
	(_FP_PACK_SEMIRAW): Determine tininess based on rounding shifted
	value if _FP_TININESS_AFTER_ROUNDING and unrounded value is in
	subnormal range.
	(_FP_PACK_CANONICAL): Determine tininess based on rounding to
	normal precision if _FP_TININESS_AFTER_ROUNDING and unrounded
	value has largest subnormal exponent.
	* soft-fp/soft-fp.h [FP_NO_EXCEPTIONS]
	(_FP_TININESS_AFTER_ROUNDING): Undefine and redefine to 0.
	* sysdeps/aarch64/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): New macro.
	* sysdeps/alpha/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/arm/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
	Likewise.
	* sysdeps/mips/mips64/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/mips/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/powerpc/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/sh/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
	Likewise.
	* sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/sfp-machine.h
	(_FP_TININESS_AFTER_ROUNDING): Likewise.
	* sysdeps/tile/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
	Likewise.
2014-02-12 18:27:12 +00:00
Ondřej Bílka
a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Allan McRae
d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10: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
Joseph Myers
2ae21ed2d2 soft-fp: fix negation NaN handling (bug 16034). 2013-10-10 11:38:56 +00:00
Carlos O'Donell
c61b4d41c9 BZ #15754: CVE-2013-4788
The pointer guard used for pointer mangling was not initialized for
static applications resulting in the security feature being disabled.
The pointer guard is now correctly initialized to a random value for
static applications. Existing static applications need to be
recompiled to take advantage of the fix.

The test tst-ptrguard1-static and tst-ptrguard1 add regression
coverage to ensure the pointer guards are sufficiently random
and initialized to a default value.
2013-09-23 00:52:09 -04: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
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
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
Joseph Myers
daaa7713e9 Remove bounded-pointers build system support. 2013-02-15 15:07:54 +00:00
Joseph Myers
6277fdabc0 Remove CHECK_STRING, CHECK_STRING_NULL_OK and __ubp_memchr. 2013-02-04 16:29:39 +00:00
David S. Miller
bae8e7f5ed Add a minor 'cas' atomic optimization on sparc.
* sysdeps/sparc/sparc32/sparcv9/bits/atomic.h
	(__arch_compare_and_exchange_val_32_acq): Use %g0 as second
	argument of CAS if possible.
	* sysdeps/sparc/sparc64/bits/atomic.h
	(__arch_compare_and_exchange_val_32_acq): Likewise.
	(__arch_compare_and_exchange_val_64_acq): Likewise.
2013-01-23 11:27:24 -08:00
David S. Miller
7c1e01aabc Use libgcc unwinder for sparc backtraces, if available.
* sysdeps/sparc/backtrace.c: New file.
	* sysdeps/sparc/sparc32/backtrace.h: New file.
	* sysdeps/sparc/sparc32/sparcv9/backtrace.h: New file.
	* sysdeps/sparc/sparc64/backtrace.h: New file.
	* sysdeps/sparc/sparc64/backtrace.c: Delete.
	* sysdeps/sparc/Makefile (CFLAGS-backtrace.c): Add
	-funwind-tables.
2013-01-21 14:15:30 -08:00
David S. Miller
1aa6176780 Optimize trunc{,f} on sparc.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add vis3
	trunc{,f} to libm-sysdep_routes.
	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_trunc.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_truncf.S: New file.
2013-01-16 00:00:54 -08:00
David S. Miller
c42d5e9862 Optimize nearbyint{,f} on sparc.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add vis3
	nearbyint{,f} to libm-sysdep_routes.
	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S:
	New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S:
	New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S: New
	file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S: New
	file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_nearbyint.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_nearbyintf.S: New file.
2013-01-15 20:59:54 -08:00
David S. Miller
8b954ab9b8 Optimize sparc {ceil,floor}{,f} using vis2 'siam' instruction.
* sysdeps/sparc/sparc-ifunc.h (SPARC_ASM_IFUNC2): New macro.
	(SPARC_ASM_VIS2_IFUNC): Likewise.
	(SPARC_ASM_VIS3_VIS2_IFUNC): Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S: Make
	use of 'siam' instruction.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S: New
	file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S: Hook in
	new VIS2 routines.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S:
	Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add new VIS2
	routines to libm-sysdep_routines.
	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Likewise.
2013-01-14 21:47:29 -08:00
David S. Miller
65a82e3dd5 Optimize fdim/fdimf on sparc.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add vis3
	fdim/fdimf to libm-sysdep_routines.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S: New file.
	* sysdeps/sparc/sparc32/fpu/s_fdim.S: New file.
	* sysdeps/sparc/sparc32/fpu/s_fdimf.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_fdim.S: New file.
	* sysdeps/sparc/sparc64/fpu/s_fdimf.S: New file.
2013-01-14 18:21:59 -08:00
David S. Miller
4ae4244d4b Redo sparc 32-bit V9 GMP optimizations with fixed copyrights.
* sysdeps/sparc/sparc32/sparcv9/mul_1.S: Properly optimize for 32-bit
	sparc V9 rather than using V8 code.
	* sysdeps/sparc/sparc32/sparcv9/addmul_1.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/submul_1.S: Likewise.
2013-01-11 20:53:10 -08:00
David S. Miller
8794a96418 Adjust sparc for Roland's multiarch sysdep directory changes.
* sysdeps/sparc/sparc32/sparcv9/fpu/unix/sysv/linux/multiarch/Implies:
	Move to...
	* sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/fpu/multiarch/Implies:
	Here.
2013-01-11 18:04:10 -08:00
David S. Miller
9e6919c8ae Undo receive sparc 32-bit V9 gmp routine commit.
* sysdeps/sparc/sparc32/sparcv9/mul_1.S: Revert previous changes.
	* sysdeps/sparc/sparc32/sparcv9/addmul_1.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/submul_1.S: Likewise.
2013-01-10 21:28:07 -08:00
David S. Miller
b9de2dde53 Optimize sparc 32-bit V9 GMP multiply routines.
* sysdeps/sparc/sparc32/sparcv9/mul_1.S: Properly optimize for 32-bit
	sparc V9 rather than using V8 code.
	* sysdeps/sparc/sparc32/sparcv9/addmul_1.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/submul_1.S: Likewise.
2013-01-10 16:15:32 -08:00
Joseph Myers
568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
David S. Miller
3a0d900a99 Add support for sparc cryptographic hash opcodes.
* crypt/Makefile: Move test targets after toplevel Rules
	inclusion.  Grab any necessary sysdep routines when linking.
	* crypt/md5.c (md5_process_block): Remove define, we will always
	name it __md5_process_block.
	(md5_finish_ctx): Update md5_process_block call.
	(md5_stream): Likewise.
	(md5_process_bytes): Likewise.
	(md5_process_block): Rename to __md5_process_block and move to ...
	* crypt/md5-block.c: ... here.
	* crypt/sha256.c (sha256_process_block): Move to ...
	* crypt/sha256-block.c: ... here.
	* crypt/sha512.c (sha512_process_block): Move to ...
	* crypt/sha512-block.c: ... here.
	* locale/Makefile (CFLAGS-md5.c): Define to add crypt/ to include
	path.
	* sysdeps/sparc/sparc-ifunc.c (sparc_libc_ifunc): Define.
	* sysdeps/sparc/sparc64/multiarch/Makefile
	(libcrypt-sysdep_routines): Add crypto assembler sysdeps when in
	crypt subdir.
	(localedef-aux): Add md5 crypto assembler when in locale subdir.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Mirror sparc64
	multiarch changes.
	* sysdeps/sparc/sparc64/multiarch/md5-block.c: New file.
	* sysdeps/sparc/sparc64/multiarch/md5-crop.S: New file.
	* sysdeps/sparc/sparc64/multiarch/sha256-block.c: New file.
	* sysdeps/sparc/sparc64/multiarch/sha256-crop.S: New file.
	* sysdeps/sparc/sparc64/multiarch/sha512-block.c: New file.
	* sysdeps/sparc/sparc64/multiarch/sha512-crop.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/md5-block.c: New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/md5-crop.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-block.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-crop.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-block.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-crop.S: New file.
2012-11-13 17:12:45 -08:00
David S. Miller
f303f97c29 Add IFUNC test lists for memcpy/mempcpy/memset on sparc.
* sysdeps/sparc/sparc64/multiarch/memcpy.S: Add comments for
	ifunc-impl-list.c
	* sysdeps/sparc/sparc64/multiarch/memset.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c: New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/ifunc-impl-list.c: New
	file.
2012-10-25 16:34:26 -07:00
David S. Miller
3baddb72a4 Add Niagara-4 optimized memset/bzero implementation.
* sysdeps/sparc/sparc64/multiarch/memset-niagara4.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara4.S: New
	file.
	* sysdeps/sparc/sparc64/multiarch/Makefile: Add to
	sysdep_routines.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memset.S: Use Niagara-4 memset
	and bzero when HWCAP_SPARC_CRYPTO is present.
2012-10-05 14:46:47 -07:00
David S. Miller
1d9a6d96ac Add Niagara-4 optimized memcpy and mempcpy.
* sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-niagara4.S: New
	file.
	* sysdeps/sparc/sparc64/multiarch/Makefile: Add to
	sysdep_routines.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy.S: Use Niagara-4 memcpy
	and mempcpy when HWCAP_SPARC_CRYPTO is set.
2012-09-28 13:06:24 -07:00
H.J. Lu
9bac1d8624 Define VERSYMIDX/VALIDX/ADDRIDX in ldsodefs.h 2012-09-28 11:30:57 -07:00
David S. Miller
0a9f1987ad Use sparcv8 GMP routines when building 32-bit sparcv9.
* sysdeps/sparc/sparc32/sparcv9/addmul_1.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/submul_1.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/mul_1.S: New file.
2012-09-04 19:20:03 -07:00
Joseph Myers
3129cfc6ec Move testsuite audit definitions to sysdeps tst-audit.h files. 2012-07-26 11:29:07 +00:00