summaryrefslogtreecommitdiff
path: root/m4/isfinite.m4
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2015-10-25 10:49:41 +0000
committerAndy Wingo <wingo@pobox.com>2015-10-25 10:55:14 +0000
commit95ac2204d9084a01677fff9eb2669c495bd07d3d (patch)
treeb603eaaf67caaab75489478ab51605a70be006fa /m4/isfinite.m4
parent1c9e23c0901363ff24c1dc4e085e7ed68cb81e6d (diff)
downloadguile-95ac2204d9084a01677fff9eb2669c495bd07d3d.tar.gz
Revert "Update Gnulib to v0.1-603-g1d16a7b"
This reverts commit 2d4da30fdefbcdb065d4b1f48f2a77d06f69e3c3. This Gnulib update was causing failures related to timezones in stime.c. I tried to fix it by adopting the time_rz module from gnulib but that then caused other failures. We can try again later.
Diffstat (limited to 'm4/isfinite.m4')
-rw-r--r--m4/isfinite.m440
1 files changed, 28 insertions, 12 deletions
diff --git a/m4/isfinite.m4 b/m4/isfinite.m4
index 00d7e8042..53ad9092a 100644
--- a/m4/isfinite.m4
+++ b/m4/isfinite.m4
@@ -1,5 +1,5 @@
-# isfinite.m4 serial 15
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+# isfinite.m4 serial 13
+dnl Copyright (C) 2007-2014 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 with or without modifications, as long as this notice is preserved.
@@ -34,8 +34,13 @@ AC_DEFUN([gl_ISFINITE],
AC_SUBST([ISFINITE_LIBM])
])
-dnl Test whether isfinite() on 'long double' recognizes all canonical values
-dnl which are neither finite nor infinite.
+dnl Test whether isfinite() on 'long double' recognizes all numbers which are
+dnl neither finite nor infinite. This test fails e.g. on i686, x86_64, ia64,
+dnl because of
+dnl - pseudo-denormals on x86_64,
+dnl - pseudo-zeroes, unnormalized numbers, and pseudo-denormals on i686,
+dnl - pseudo-NaN, pseudo-Infinity, pseudo-zeroes, unnormalized numbers, and
+dnl pseudo-denormals on ia64.
AC_DEFUN([gl_ISFINITEL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
@@ -89,7 +94,7 @@ int main ()
# ifdef WORDS_BIGENDIAN
# define LDBL80_WORDS(exponent,manthi,mantlo) \
{ ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
- ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
+ ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
(unsigned int) (mantlo) << 16 \
}
# else
@@ -109,41 +114,52 @@ int main ()
if (isfinite (x.value))
result |= 2;
}
- /* isfinite should return something even for noncanonical values. */
+ /* The isfinite macro should recognize Pseudo-NaNs, Pseudo-Infinities,
+ Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in
+ Intel IA-64 Architecture Software Developer's Manual, Volume 1:
+ Application Architecture.
+ Table 5-2 "Floating-Point Register Encodings"
+ Figure 5-6 "Memory to Floating-Point Register Data Translation"
+ */
{ /* Pseudo-NaN. */
static memory_long_double x =
{ LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
- if (isfinite (x.value) && !isfinite (x.value))
+ if (isfinite (x.value))
result |= 4;
}
{ /* Pseudo-Infinity. */
static memory_long_double x =
{ LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
- if (isfinite (x.value) && !isfinite (x.value))
+ if (isfinite (x.value))
result |= 8;
}
{ /* Pseudo-Zero. */
static memory_long_double x =
{ LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
- if (isfinite (x.value) && !isfinite (x.value))
+ if (isfinite (x.value))
result |= 16;
}
{ /* Unnormalized number. */
static memory_long_double x =
{ LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
- if (isfinite (x.value) && !isfinite (x.value))
+ if (isfinite (x.value))
result |= 32;
}
{ /* Pseudo-Denormal. */
static memory_long_double x =
{ LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
- if (isfinite (x.value) && !isfinite (x.value))
+ if (isfinite (x.value))
result |= 64;
}
#endif
return result;
}]])], [gl_cv_func_isfinitel_works=yes], [gl_cv_func_isfinitel_works=no],
- [gl_cv_func_isfinitel_works="guessing yes"])
+ [case "$host_cpu" in
+ # Guess no on ia64, x86_64, i386.
+ ia64 | x86_64 | i*86) gl_cv_func_isfinitel_works="guessing no";;
+ *) gl_cv_func_isfinitel_works="guessing yes";;
+ esac
+ ])
])
])