+2017-07-01 Bruno Haible <bruno@clisp.org>
+
+ logbl: Work around a glibc bug on PowerPC64LE.
+ * m4/logbl.m4 (gl_FUNC_LOGBL_WORKS): Test also negative subnormal
+ numbers.
+ * doc/posix-functions/logbl.texi: Update.
+
2017-06-29 Bruno Haible <bruno@clisp.org>
stat, fstat: Compile stat-w32.c only on platforms that need it.
FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, older IRIX 6.5, Solaris 9, Cygwin, MSVC 9, Interix 3.5, BeOS.
@item
This function produces wrong results for subnormal numbers on some platforms:
-glibc 2.11/ppc, glibc 2.7/sparc, glibc 2.7/hppa, Solaris 11 2011-11.
+glibc 2.11/powerpc, glibc 2.7/sparc, glibc 2.7/hppa, Solaris 11 2011-11,
+glibc 2.23/powerpc64le.
@end itemize
Portability problems not fixed by Gnulib:
-# logbl.m4 serial 2
+# logbl.m4 serial 3
dnl Copyright (C) 2012-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
])
dnl Test whether logbl() works.
-dnl On glibc 2.11/ppc, glibc 2.7/sparc, glibc 2.7/hppa, Solaris 10/SPARC, the
-dnl return value for subnormal (denormalized) arguments is too large.
+dnl On glibc 2.11/powerpc, glibc 2.7/sparc, glibc 2.7/hppa, Solaris 10/SPARC,
+dnl the return value for subnormal (denormalized) arguments is too large.
+dnl On glibc 2.23/powerpc64le, the return value for negative subnormal arguments
+dnl is too large.
AC_DEFUN([gl_FUNC_LOGBL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
if ((i == LDBL_MIN_EXP - 1 || i == LDBL_MIN_EXP - 54)
&& (x > 0.0L && !(logbl (x) == (long double)(i - 1))))
return 1;
+ for (i = 1, x = -1.0L; i >= LDBL_MIN_EXP - 54; i--, x *= 0.5L)
+ /* Either x = -2^(i-1) or x = 0.0. */
+ if ((i == LDBL_MIN_EXP - 1 || i == LDBL_MIN_EXP - 54)
+ && (x < 0.0L && !(logbl (x) == (long double)(i - 1))))
+ return 1;
return 0;
}
]])],