glibc/sysdeps
Joseph Myers 228a78c21b Fix i386 fdim double rounding (bug 20255).
fdim suffers from double rounding on i386 because subtracting two
double values can produce an inexact long double value exactly half
way between two double values.  This patch fixes this by creating an
i386-specific version of fdim - C, based on the generic version,
unlike the previous .S version - which sets the x87 precision control
to double precision for the subtraction and then restores it
afterwards.  As noted in the comment added, there are no issues of
double rounding for subnormals (a case that setting precision control
does not address) because subtraction cannot produce an inexact result
in the subnormal range.

Tested for x86_64 and x86.

	[BZ #20255]
	* sysdeps/i386/fpu/s_fdim.c: New file.  Based on math/s_fdim.c.
	* math/libm-test.inc (fdim_test_data): Add another test.
2016-06-14 16:41:50 +00:00
..
aarch64
alpha
arm Bug 20198: quick_exit should not call destructors. 2016-06-06 21:40:25 -04:00
generic
gnu
hppa
i386 Fix i386 fdim double rounding (bug 20255). 2016-06-14 16:41:50 +00:00
ia64
ieee754 Fix dbl-64 atan2 (sNaN, qNaN) (bug 20252). 2016-06-13 21:43:22 +00:00
init_array
m68k
mach
microblaze
mips
nacl
nios2
nptl
posix
powerpc Use generic fdim on more architectures (bug 6796, bug 20255, bug 20256). 2016-06-14 16:04:19 +00:00
pthread
s390
sh
sparc
tile
unix Remove __ASSUME_FUTEX_LOCK_PI 2016-06-13 08:36:34 -03:00
wordsize-32
wordsize-64
x86 Check FMA after COMMON_CPUID_INDEX_80000001 2016-06-07 08:00:40 -07:00
x86_64 Use generic fdim on more architectures (bug 6796, bug 20255, bug 20256). 2016-06-14 16:04:19 +00:00