diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-04-28 17:27:02 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-04-28 17:27:02 +0000 |
commit | 7d0b2575416aec2717e8665287d0ab77826a0ade (patch) | |
tree | d264ccfa2e441db9d74e41947567112a293a2f06 /NEWS | |
parent | fb4041ae532fd21a82618c2be09898ea8979dec5 (diff) | |
download | glibc-7d0b2575416aec2717e8665287d0ab77826a0ade.zip glibc-7d0b2575416aec2717e8665287d0ab77826a0ade.tar.gz glibc-7d0b2575416aec2717e8665287d0ab77826a0ade.tar.bz2 |
Fix ldbl-128 roundl for exponents in [31, 47] (bug 18346).
The implementation of roundl for ldbl-128 involves undefined behavior
for arguments with exponents from 31 to 47 inclusive, from the shift:
u_int64_t i = -1ULL >> (j0 - 48);
For example, on mips64, this means roundl (0xffffffffffff.8p0L)
wrongly returns its argument, which is not an integer. A condition
checking for exponents < 31 should actually be checking for exponents
< 48, and this patch makes it do so. (That condition is for whether
the bit representing 0.5 is in the high 64-bit half of the
floating-point number. The value 31 might have arisen from an
incorrect conversion of the ldbl-96 version to handle ldbl-128.)
This was originally reported as a GCC libquadmath bug
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65757>.
Tested for mips64; also tested for x86_64 and x86 to make sure the new
tests pass there.
[BZ #18346]
* sysdeps/ieee754/ldbl-128/s_roundl.c (__roundl): Handle all
exponents less than 48 as cases where high part of mantissa needs
examining to determine whether argument is integral.
* math/libm-test.inc (round_test_data): Add more tests.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -16,7 +16,7 @@ Version 2.22 17967, 17969, 17978, 17987, 17991, 17996, 17998, 17999, 18019, 18020, 18029, 18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047, 18068, 18080, 18093, 18100, 18104, 18110, 18111, 18128, 18138, 18185, - 18197, 18206, 18210, 18211, 18247, 18287, 18333. + 18197, 18206, 18210, 18211, 18247, 18287, 18333, 18346. * Cache information can be queried via sysconf() function on s390 e.g. with _SC_LEVEL1_ICACHE_SIZE as argument. |