Move macros for finding floating-point exponents into separate M4 files.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 24 Jul 2008 04:34:48 +0000 (21:34 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 26 Jul 2008 04:56:39 +0000 (21:56 -0700)
ChangeLog
m4/exponentd.m4 [new file with mode: 0644]
m4/exponentf.m4 [new file with mode: 0644]
m4/exponentl.m4 [new file with mode: 0644]
m4/isnand.m4
m4/isnanf.m4
m4/isnanl.m4
modules/isnand
modules/isnanf
modules/isnanl

index 6c48308..e7770ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-07-14  Ben Pfaff  <blp@gnu.org>
+
+       Factor out some macros for use by additional modules.
+       * m4/isnanf.m4 (gl_FLOAT_EXPONENT_LOCATION): Move into new file
+       exponentf.m4.
+       * m4/isnand.m4 (gl_DOUBLE_EXPONENT_LOCATION): Move into new file
+       exponentd.m4.
+       * m4/isnanl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Move into new
+       file exponentl.m4.
+       * m4/exponentf.m4: New file.
+       * m4/exponentd.m4: New file.
+       * m4/exponentl.m4: New file.
+       * modules/isnanf: Use new file m4/exponentf.m4.
+       * modules/isnand: Use new file m4/exponentd.m4.
+       * modules/isnanl: Use new file m4/exponentl.m4.
+
 2008-07-23  Ulrich Drepper  <drepper@redhat.com>
 
        mktime.c: normalize tp->tm_isdst value to -1/0/1.
diff --git a/m4/exponentd.m4 b/m4/exponentd.m4
new file mode 100644 (file)
index 0000000..140cee4
--- /dev/null
@@ -0,0 +1,114 @@
+# exponentd.m4 serial 1
+dnl Copyright (C) 2007-2008 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.
+AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION],
+[
+  AC_CACHE_CHECK([where to find the exponent in a 'double'],
+    [gl_cv_cc_double_expbit0],
+    [
+      AC_TRY_RUN([
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (double x)
+{
+  memory_double m;
+  size_t i;
+  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
+  memset (&m, 0, sizeof (memory_double));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25);
+  add_to_ored_words (0.5);
+  add_to_ored_words (1.0);
+  add_to_ored_words (2.0);
+  add_to_ored_words (4.0);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
+        ],
+        [gl_cv_cc_double_expbit0=`cat conftest.out`],
+        [gl_cv_cc_double_expbit0="unknown"],
+        [
+          dnl On ARM, there are two 'double' floating-point formats, used by
+          dnl different sets of instructions: The older FPA instructions assume
+          dnl that they are stored in big-endian word order, while the words
+          dnl (like integer types) are stored in little-endian byte order.
+          dnl The newer VFP instructions assume little-endian order consistenly.
+          AC_EGREP_CPP([mixed_endianness], [
+#if defined arm || defined __arm || defined __arm__
+  mixed_endianness
+#endif
+            ],
+            [gl_cv_cc_double_expbit0="unknown"],
+            [
+              pushdef([AC_MSG_CHECKING],[:])dnl
+              pushdef([AC_MSG_RESULT],[:])dnl
+              pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
+              AC_C_BIGENDIAN(
+                [gl_cv_cc_double_expbit0="word 0 bit 20"],
+                [gl_cv_cc_double_expbit0="word 1 bit 20"],
+                [gl_cv_cc_double_expbit0="unknown"])
+              popdef([AC_MSG_RESULT_UNQUOTED])dnl
+              popdef([AC_MSG_RESULT])dnl
+              popdef([AC_MSG_CHECKING])dnl
+            ])
+        ])
+      rm -f conftest.out
+    ])
+  case "$gl_cv_cc_double_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+      AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word],
+        [Define as the word index where to find the exponent of 'double'.])
+      AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit],
+        [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.])
+      ;;
+  esac
+])
diff --git a/m4/exponentf.m4 b/m4/exponentf.m4
new file mode 100644 (file)
index 0000000..7ff3413
--- /dev/null
@@ -0,0 +1,91 @@
+# exponentf.m4 serial 1
+dnl Copyright (C) 2007-2008 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.
+AC_DEFUN([gl_FLOAT_EXPONENT_LOCATION],
+[
+  AC_CACHE_CHECK([where to find the exponent in a 'float'],
+    [gl_cv_cc_float_expbit0],
+    [
+      AC_TRY_RUN([
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { float value; unsigned int word[NWORDS]; } memory_float;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (float x)
+{
+  memory_float m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (float) < sizeof (memory_float).  */
+  memset (&m, 0, sizeof (memory_float));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25f);
+  add_to_ored_words (0.5f);
+  add_to_ored_words (1.0f);
+  add_to_ored_words (2.0f);
+  add_to_ored_words (4.0f);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
+        ],
+        [gl_cv_cc_float_expbit0=`cat conftest.out`],
+        [gl_cv_cc_float_expbit0="unknown"],
+        [gl_cv_cc_float_expbit0="word 0 bit 23"])
+      rm -f conftest.out
+    ])
+  case "$gl_cv_cc_float_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
+      AC_DEFINE_UNQUOTED([FLT_EXPBIT0_WORD], [$word],
+        [Define as the word index where to find the exponent of 'float'.])
+      AC_DEFINE_UNQUOTED([FLT_EXPBIT0_BIT], [$bit],
+        [Define as the bit index in the word where to find bit 0 of the exponent of 'float'.])
+      ;;
+  esac
+])
diff --git a/m4/exponentl.m4 b/m4/exponentl.m4
new file mode 100644 (file)
index 0000000..59b77eb
--- /dev/null
@@ -0,0 +1,97 @@
+# exponentl.m4 serial 1
+dnl Copyright (C) 2007-2008 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.
+AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
+[
+  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_CACHE_CHECK([where to find the exponent in a 'long double'],
+    [gl_cv_cc_long_double_expbit0],
+    [
+      AC_TRY_RUN([
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { long double value; unsigned int word[NWORDS]; }
+        memory_long_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (long double x)
+{
+  memory_long_double m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (long double) < sizeof (memory_long_double).  */
+  memset (&m, 0, sizeof (memory_long_double));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25L);
+  add_to_ored_words (0.5L);
+  add_to_ored_words (1.0L);
+  add_to_ored_words (2.0L);
+  add_to_ored_words (4.0L);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
+        ],
+        [gl_cv_cc_long_double_expbit0=`cat conftest.out`],
+        [gl_cv_cc_long_double_expbit0="unknown"],
+        [
+          dnl When cross-compiling, we don't know. It depends on the
+          dnl ABI and compiler version. There are too many cases.
+          gl_cv_cc_long_double_expbit0="unknown"
+        ])
+      rm -f conftest.out
+    ])
+  case "$gl_cv_cc_long_double_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
+      AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_WORD], [$word],
+        [Define as the word index where to find the exponent of 'long double'.])
+      AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_BIT], [$bit],
+        [Define as the bit index in the word where to find bit 0 of the exponent of 'long double'.])
+      ;;
+  esac
+])
index f21d384..fbb03f8 100644 (file)
@@ -1,4 +1,4 @@
-# isnand.m4 serial 3
+# isnand.m4 serial 4
 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -92,113 +92,3 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
         [gl_cv_func_isnand_no_libm=no])
     ])
 ])
-
-AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION],
-[
-  AC_CACHE_CHECK([where to find the exponent in a 'double'],
-    [gl_cv_cc_double_expbit0],
-    [
-      AC_TRY_RUN([
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (double x)
-{
-  memory_double m;
-  size_t i;
-  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
-  memset (&m, 0, sizeof (memory_double));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25);
-  add_to_ored_words (0.5);
-  add_to_ored_words (1.0);
-  add_to_ored_words (2.0);
-  add_to_ored_words (4.0);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
-        ],
-        [gl_cv_cc_double_expbit0=`cat conftest.out`],
-        [gl_cv_cc_double_expbit0="unknown"],
-        [
-          dnl On ARM, there are two 'double' floating-point formats, used by
-          dnl different sets of instructions: The older FPA instructions assume
-          dnl that they are stored in big-endian word order, while the words
-          dnl (like integer types) are stored in little-endian byte order.
-          dnl The newer VFP instructions assume little-endian order consistenly.
-          AC_EGREP_CPP([mixed_endianness], [
-#if defined arm || defined __arm || defined __arm__
-  mixed_endianness
-#endif
-            ],
-            [gl_cv_cc_double_expbit0="unknown"],
-            [
-              pushdef([AC_MSG_CHECKING],[:])dnl
-              pushdef([AC_MSG_RESULT],[:])dnl
-              pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
-              AC_C_BIGENDIAN(
-                [gl_cv_cc_double_expbit0="word 0 bit 20"],
-                [gl_cv_cc_double_expbit0="word 1 bit 20"],
-                [gl_cv_cc_double_expbit0="unknown"])
-              popdef([AC_MSG_RESULT_UNQUOTED])dnl
-              popdef([AC_MSG_RESULT])dnl
-              popdef([AC_MSG_CHECKING])dnl
-            ])
-        ])
-      rm -f conftest.out
-    ])
-  case "$gl_cv_cc_double_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
-      AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word],
-        [Define as the word index where to find the exponent of 'double'.])
-      AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit],
-        [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.])
-      ;;
-  esac
-])
index de7ebe8..289a49b 100644 (file)
@@ -1,4 +1,4 @@
-# isnanf.m4 serial 7
+# isnanf.m4 serial 8
 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -178,90 +178,3 @@ int main()
         ])
     ])
 ])
-
-AC_DEFUN([gl_FLOAT_EXPONENT_LOCATION],
-[
-  AC_CACHE_CHECK([where to find the exponent in a 'float'],
-    [gl_cv_cc_float_expbit0],
-    [
-      AC_TRY_RUN([
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (float x)
-{
-  memory_float m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (float) < sizeof (memory_float).  */
-  memset (&m, 0, sizeof (memory_float));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25f);
-  add_to_ored_words (0.5f);
-  add_to_ored_words (1.0f);
-  add_to_ored_words (2.0f);
-  add_to_ored_words (4.0f);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
-        ],
-        [gl_cv_cc_float_expbit0=`cat conftest.out`],
-        [gl_cv_cc_float_expbit0="unknown"],
-        [gl_cv_cc_float_expbit0="word 0 bit 23"])
-      rm -f conftest.out
-    ])
-  case "$gl_cv_cc_float_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
-      AC_DEFINE_UNQUOTED([FLT_EXPBIT0_WORD], [$word],
-        [Define as the word index where to find the exponent of 'float'.])
-      AC_DEFINE_UNQUOTED([FLT_EXPBIT0_BIT], [$bit],
-        [Define as the bit index in the word where to find bit 0 of the exponent of 'float'.])
-      ;;
-  esac
-])
index 55be261..c2f050f 100644 (file)
@@ -1,4 +1,4 @@
-# isnanl.m4 serial 7
+# isnanl.m4 serial 8
 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -234,96 +234,3 @@ int main ()
       ])
     ])
 ])
-
-AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
-[
-  AC_REQUIRE([AC_C_BIGENDIAN])
-  AC_CACHE_CHECK([where to find the exponent in a 'long double'],
-    [gl_cv_cc_long_double_expbit0],
-    [
-      AC_TRY_RUN([
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { long double value; unsigned int word[NWORDS]; }
-        memory_long_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (long double x)
-{
-  memory_long_double m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (long double) < sizeof (memory_long_double).  */
-  memset (&m, 0, sizeof (memory_long_double));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25L);
-  add_to_ored_words (0.5L);
-  add_to_ored_words (1.0L);
-  add_to_ored_words (2.0L);
-  add_to_ored_words (4.0L);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
-        ],
-        [gl_cv_cc_long_double_expbit0=`cat conftest.out`],
-        [gl_cv_cc_long_double_expbit0="unknown"],
-        [
-          dnl When cross-compiling, we don't know. It depends on the
-          dnl ABI and compiler version. There are too many cases.
-          gl_cv_cc_long_double_expbit0="unknown"
-        ])
-      rm -f conftest.out
-    ])
-  case "$gl_cv_cc_long_double_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
-      AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_WORD], [$word],
-        [Define as the word index where to find the exponent of 'long double'.])
-      AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_BIT], [$bit],
-        [Define as the bit index in the word where to find bit 0 of the exponent of 'long double'.])
-      ;;
-  esac
-])
index ab6cda5..b88e563 100644 (file)
@@ -6,6 +6,7 @@ lib/isnand.h
 lib/isnand.c
 lib/isnan.c
 lib/float+.h
+m4/exponentd.m4
 m4/isnand.m4
 
 Depends-on:
index 72da537..429acfe 100644 (file)
@@ -6,6 +6,7 @@ lib/isnanf.h
 lib/isnanf.c
 lib/isnan.c
 lib/float+.h
+m4/exponentf.m4
 m4/isnanf.m4
 
 Depends-on:
index 026981f..66d84c1 100644 (file)
@@ -6,6 +6,7 @@ lib/isnanl.h
 lib/isnanl.c
 lib/isnan.c
 lib/float+.h
+m4/exponentl.m4
 m4/isnanl.m4
 
 Depends-on: