glibc/sysdeps
Joseph Myers f7be737659 Fix log (1) in round-downward mode (bug 16731).
According to ISO C Annex F, log (1) should be +0 in all rounding
modes, but some implementations in glibc wrongly return -0 in
round-downward mode (mapping to log1p (x - 1) is problematic because 1
- 1 is -0 in round-downward mode, and log1p (-0) is -0).  This patch
fixes this.  (It helps with some implementations of other functions
such as acosh, log2 and log10 that call out to log, but not enough to
enable all-rounding-modes testing for those functions without further
fixes to other implementations of them.)

Tested x86_64 and x86 and ulps updated accordingly, and did spot tests
for mips64 for the ldbl-128 fix, and i586 for the sysdeps/i386/fpu
implementations shadowed by those in sysdeps/i386/i686/fpu.

	[BZ #16731]
	* sysdeps/i386/fpu/e_log.S (__ieee754_log): Take absolute value
	when x - 1 is zero.
	* sysdeps/i386/fpu/e_logf.S (__ieee754_logf): Likewise.
	* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Likewise.
	* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
	* sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Return +0 when
	argument is 1.
	* sysdeps/ieee754/ldbl-128/e_logl.c (__ieee754_logl): Likewise.
	* sysdeps/x86_64/fpu/e_logl.S: Take absolute value when x - 1 is
	zero.
	* math/libm-test.inc (log_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-03-21 18:13:58 +00:00
..
aarch64 Compile with -Wundef. 2014-03-14 11:32:51 -07:00
alpha Compile with -Wundef. 2014-03-14 11:32:51 -07:00
arm Fix -Wundef warnins for __FP_FAST_FMA* 2014-03-21 17:28:43 +05:30
generic Revert "Fix HP_SMALL_TIMING_AVAIL -Wundef warnings" 2014-03-17 20:39:24 +00:00
gnu Combine __USE_BSD and __USE_SVID into __USE_MISC. 2014-02-12 23:41:01 +00:00
i386 Fix log (1) in round-downward mode (bug 16731). 2014-03-21 18:13:58 +00:00
ia64 Compile with -Wundef. 2014-03-14 11:32:51 -07:00
ieee754 Fix log (1) in round-downward mode (bug 16731). 2014-03-21 18:13:58 +00:00
init_array Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
m68k Compile with -Wundef. 2014-03-14 11:32:51 -07:00
mach Compile with -Wundef. 2014-03-14 11:32:51 -07:00
microblaze Compile with -Wundef. 2014-03-14 11:32:51 -07:00
mips Compile with -Wundef. 2014-03-14 11:32:51 -07:00
posix Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
powerpc PowerPC: optimized strpbrk for POWER7 2014-03-20 19:46:13 -05:00
pthread Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s390 Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
sh Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
sparc Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
tile Fix -Wundef warnins for __FP_FAST_FMA* 2014-03-21 17:28:43 +05:30
unix Fix __ASSUME_PREADV and __ASSUME_PWRITEV for Alpha and MicroBlaze (bug 16649). 2014-03-19 13:10:52 +00:00
wordsize-32 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wordsize-64 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
x86 Fix -Wundef warnins for __FP_FAST_FMA* 2014-03-21 17:28:43 +05:30
x86_64 Fix log (1) in round-downward mode (bug 16731). 2014-03-21 18:13:58 +00:00