glibc/sysdeps
Joseph Myers 24e9ae1bc2 Avoid "invalid" exceptions from powerpc fabsl (sNaN) (bug 20157).
The powerpc implementations of fabsl for ldbl-128ibm (both powerpc32
and powerpc64) wrongly raise the "invalid" exception for sNaN
arguments.  fabs functions should be quiet for all inputs including
signaling NaNs.  The problem is the use of a comparison instruction
fcmpu to determine if the high part of the argument is negative and so
the low part needs to be negated; such instructions raise "invalid"
for sNaNs.

There is a pure integer implementation of fabsl in
sysdeps/ieee754/ldbl-128ibm/s_fabsl.c.  However, it's not necessary to
use it to avoid such exceptions.  The fsel instruction does not raise
exceptions for sNaNs, and can be used in place of the original
comparison.  (Note that if the high part is zero or a NaN, it does not
matter whether the low part is negated; the choice of whether the low
part of a zero is +0 or -0 does not affect the value, and the low part
of a NaN does not affect the value / payload either.)

The condition in GCC for fsel to be available is TARGET_PPC_GFXOPT,
corresponding to the _ARCH_PPCGR predefined macro.  fsel is available
on all 64-bit processors supported by GCC.  A few 32-bit processors
supported by GCC do not have TARGET_PPC_GFXOPT despite having hard
float support.  To support those processors, integer code (similar to
that in copysignl) is included for the !_ARCH_PPCGR case for
powerpc32.

Tested for powerpc32 (configurations with and without _ARCH_PPCGR) and
powerpc64.

	[BZ #20157]
	* sysdeps/powerpc/powerpc32/fpu/s_fabsl.S (__fabsl): Use fsel to
	determine whether to negate low half if [_ARCH_PPCGR], and integer
	comparison otherwise.
	* sysdeps/powerpc/powerpc64/fpu/s_fabsl.S (__fabsl): Use fsel to
	determine whether to negate low half.
2016-05-27 15:29:31 +00:00
..
aarch64 This is an optimized memset for AArch64. Memset is split into 4 main cases: 2016-05-12 16:44:53 +01:00
alpha Update Alpha libm-test-ulps 2016-01-25 10:43:41 -08:00
arm Fix building glibc master with NDEBUG and --with-cpu. 2016-03-15 23:23:24 -04:00
generic Fix crash on getauxval call without HAVE_AUX_VECTOR 2016-04-10 23:58:43 +02:00
gnu Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hppa hppa: fix dladdr [BZ #19415] 2016-01-08 02:19:26 -05:00
i386 Call init_cpu_features only if SHARED is defined 2016-05-13 08:29:33 -07:00
ia64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ieee754 Fix ldbl-128ibm ceill, rintl etc. for sNaN arguments (bug 20156). 2016-05-27 13:59:24 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k m68k: use large PIC model for gcrt1.o 2016-04-30 18:51:43 +02:00
mach Make padding in struct sockaddr_storage explicit [BZ #20111] 2016-05-23 19:43:09 +02:00
microblaze Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mips Fix MIPS64 memcpy regression. 2016-01-28 01:52:05 +00:00
nacl Fix build with HAVE_AUX_VECTOR 2016-04-11 10:27:25 +02:00
nios2 Maintainence patch for nios2: update ULPS file and localplt.data changes. 2016-01-21 22:58:03 -08:00
nptl Increase fork signal safety for single-threaded processes [BZ #19703] 2016-05-12 15:26:55 +02:00
posix getaddrinfo: Convert from extend_alloca to struct scratch_buffer 2016-05-12 14:07:56 +02:00
powerpc Avoid "invalid" exceptions from powerpc fabsl (sNaN) (bug 20157). 2016-05-27 15:29:31 +00:00
pthread Revert "aio: fix newp->running data race" 2016-05-04 15:52:30 +02:00
s390 S390: Fix utf32 to utf16 handling of low surrogates (disable cu42). 2016-05-25 17:18:06 +02:00
sh Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sparc Add _STRING_INLINE_unaligned and string_private.h 2016-02-18 14:55:29 -02:00
tile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
unix network: Fix missing bits from {recv,send}{m}msg standard com,pliance 2016-05-26 11:11:33 -03:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
x86 Remove special L2 cache case for Knights Landing 2016-05-20 14:42:00 -07:00
x86_64 Do not raise "inexact" from x86_64 SSE4.1 ceil, floor (bug 15479). 2016-05-24 21:11:18 +00:00