glibc/sysdeps
Joseph Myers 739babd775 Fix fma spurious underflows (bug 18824).
Various fma implementations have logic that, when computing fma (x, y,
z) where z is large (so care needs taking to avoid internal overflow)
but x * y is small, scale x * y up instead of down to avoid internal
underflows resulting from scaling down.  (In these cases, x * y is
small enough that only its sign actually matters rather than the exact
value.)

The threshold for scaling up instead of down was correct for "if the
unscaled values were multiplied, the low part of the multiplication
could underflow", and the scaling was sufficient to ensure that the
low part of the multiplication did not underflow (given that cases of
very small x * y - less than half the least subnormal - were
previously dealt with).  However, the choice in the functions wasn't
between scaling up or no scaling, but between scaling up and scaling
down (scaling down actually being needed when x * y isn't so small
compared to z and so the exact value does matter).  Thus a larger
threshold is needed to ensure that scaling down doesn't produce values
the multiplication of whose low parts underflows.  This patch
increases the thresholds accordingly.

Tested for x86_64, x86 and mips64 (with the MIPS version of s_fmal.c
removed so that the ldbl-128 version gets tested instead of the
soft-fp one).

	[BZ #18824]
	* sysdeps/ieee754/dbl-64/s_fma.c (__fma): Increase threshold for
	scaling x * y up instead of down.
	* sysdeps/ieee754/ldbl-128/s_fmal.c (__fmal): Likewise.
	* sysdeps/ieee754/ldbl-96/s_fmal.c (__fmal): Likewise.
	* math/auto-libm-test-in: Add more tests of fma.
	* math/auto-libm-test-out: Regenerated.
2015-08-14 17:15:06 +00:00
..
aarch64 Improve feenableexcept performance - avoid an unnecessary FPCR read in case 2015-08-05 16:24:02 +01:00
alpha alpha: Update libm-test-ulps 2015-05-19 09:43:54 -07:00
arm [ARM][BZ #17711] Fix extern protected data handling 2015-07-24 10:05:07 +01:00
generic Factor file identity rules out of generic rtld code. 2015-07-14 13:15:26 -07:00
gnu hurd: fix unwind-resume.c build 2015-02-08 18:46:00 +01:00
hppa hppa: _dl_symbol_address: add missing hidden def 2015-08-07 01:45:00 -04:00
i386 Add more random libm-test inputs. 2015-08-13 23:23:23 +00:00
ia64 ia64: atomic.h: fix atomic_exchange_and_add 64bit handling 2015-07-28 02:30:15 -04:00
ieee754 Fix fma spurious underflows (bug 18824). 2015-08-14 17:15:06 +00:00
init_array NPTL: Initializer for .init_array-only configurations. 2015-02-13 13:19:11 -08:00
m68k m68k: update libm test ULPs 2015-07-21 00:20:24 +02:00
mach PLT avoidance for _exit in rtld. 2015-07-09 15:25:47 -07:00
microblaze Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
mips Regenerate MIPS libm-test-ulps. 2015-07-01 17:24:37 +00:00
nacl NaCl: Remove bogus O_SHLOCK, O_EXLOCK definitions. 2015-07-24 12:31:23 -07:00
nios2 Fixes extern protected data handling testcases elf/tst-protected1a 2015-07-26 05:27:18 -07:00
nptl Add and use new glibc-internal futex API. 2015-07-10 13:47:09 +02:00
posix Fix BZ #18086 -- nice resets errno to 0. 2015-08-11 23:40:00 -07:00
powerpc powerpc: Fix stpcpy performance for power8 2015-08-11 10:03:10 -03:00
pthread Use unsigned types for counters in AIO code. 2015-06-24 17:43:32 -07:00
s390 S390: Regenerate ULPs 2015-07-15 09:33:14 +02:00
sh Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
sparc Improve performance of mempcpy by inlining and using memcpy. Enable 2015-08-05 16:24:04 +01:00
tile tilepro: fix warnings in sysdeps/tile/tilepro/bits/atomic.h 2015-08-04 12:07:53 -04:00
unix Don't include <cpuid.h> in elision-conf.h 2015-08-13 03:46:26 -07:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
x86 Check if cpuid is available in init_cpu_features 2015-08-13 04:53:03 -07:00
x86_64 Regenerated sysdeps/x86_64/fpu/libm-test-ulps with AVX2. 2015-08-14 09:59:04 -07:00