]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
isnan*, isnan*-nolibm: Remove support for IRIX.
authorBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:00:16 +0000 (23:00 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:00:28 +0000 (23:00 +0200)
* m4/isnanf.m4 (gl_ISNANF_WORKS): Remove test for isnanf (NaN ()).
* m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Simplify test program.
* lib/isnanf-nolibm.h (isnanf): Remove code for IRIX.
* lib/isnan.c (FUNC): Remove code for IRIX.

ChangeLog
lib/isnan.c
lib/isnanf-nolibm.h
m4/isnanf.m4
m4/isnanl.m4

index a061c2a12acd05e3328013793d89a2e013db90f8..b62d9f027a7e006422a70a9798978a391e3a9172 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2025-09-10  Bruno Haible  <bruno@clisp.org>
 
+       isnan*, isnan*-nolibm: Remove support for IRIX.
+       * m4/isnanf.m4 (gl_ISNANF_WORKS): Remove test for isnanf (NaN ()).
+       * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Simplify test program.
+       * lib/isnanf-nolibm.h (isnanf): Remove code for IRIX.
+       * lib/isnan.c (FUNC): Remove code for IRIX.
+
        isinf: Remove support for IRIX.
        * m4/isinf.m4 (gl_ISINFL_WORKS): Remove code for IRIX.
 
index 3e119a333c30b70d49d58330df1412bd5c85f59c..c8a65caaa5bbc07e477021b80f4383a721ea1b31 100644 (file)
@@ -130,15 +130,13 @@ FUNC (DOUBLE x)
   /* Be careful to not do any floating-point operation on x, such as x == x,
      because x may be a signaling NaN.  */
 #  if defined __SUNPRO_C || defined __ICC || defined _MSC_VER \
-      || defined __DECC || defined __TINYC__ \
-      || (defined __sgi && !defined __GNUC__)
+      || defined __DECC || defined __TINYC__
   /* The Sun C 5.0, Intel ICC 10.0, Microsoft Visual C/C++ 9.0, Compaq (ex-DEC)
      6.4, and TinyCC compilers don't recognize the initializers as constant
      expressions.  The Compaq compiler also fails when constant-folding
      0.0 / 0.0 even when constant-folding is not required.  The Microsoft
      Visual C/C++ compiler also fails when constant-folding 1.0 / 0.0 even
-     when constant-folding is not required. The SGI MIPSpro C compiler
-     complains about "floating-point operation result is out of range".  */
+     when constant-folding is not required.  */
   static DOUBLE zero = L_(0.0);
   memory_double nan;
   DOUBLE plus_inf = L_(1.0) / zero;
index 4a4977cd566dd4f608985cdeadefb1af65c353ad..d2e5764403d2345d57245558e5005d8bc5c1ec45 100644 (file)
 # elif defined isnan
 #  undef isnanf
 #  define isnanf(x) isnan ((float)(x))
-# else
-   /* Get declaration of isnanf(), if not declared in <math.h>.  */
-#  if defined __sgi
-   /* We can't include <ieeefp.h>, because it conflicts with our definition of
-      isnand.  Therefore declare isnanf separately.  */
-extern
-#   ifdef __cplusplus
-"C"
-#   endif
-int isnanf (float x);
-#  endif
 # endif
 #else
 /* Test whether X is a NaN.  */
index 3aa2fbb83e30e72f43879b6eea30c7f9fdd1a1dd..a23b22b181f957ad9d19c14115fb0a0824f68a85 100644 (file)
@@ -1,5 +1,5 @@
 # isnanf.m4
-# serial 21
+# serial 22
 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -115,9 +115,7 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
     ])
 ])
 
-dnl Test whether isnanf() rejects Infinity (this fails on Solaris 2.5.1),
-dnl recognizes a NaN (this fails on IRIX 6.5 with cc), and recognizes a NaN
-dnl with in-memory representation 0x7fbfffff (this fails on IRIX 6.5).
+dnl Test whether isnanf() rejects Infinity (this fails on Solaris 2.5.1).
 AC_DEFUN([gl_ISNANF_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
@@ -135,20 +133,6 @@ AC_DEFUN([gl_ISNANF_WORKS],
 # undef isnanf
 # define isnanf(x) isnan ((float)(x))
 #endif
-/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
-#ifdef __DECC
-static float
-NaN ()
-{
-  static float zero = 0.0f;
-  return zero / zero;
-}
-#else
-# define NaN() (0.0f / 0.0f)
-#endif
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; float value; } memory_float;
 int main()
 {
   int result = 0;
@@ -156,32 +140,12 @@ int main()
   if (isnanf (1.0f / 0.0f))
     result |= 1;
 
-  if (!isnanf (NaN ()))
-    result |= 2;
-
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
-  /* The isnanf function should be immune against changes in the sign bit and
-     in the mantissa bits.  The xor operation twiddles a bit that can only be
-     a sign bit or a mantissa bit.  */
-  if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
-    {
-      memory_float m;
-
-      m.value = NaN ();
-      /* Set the bits below the exponent to 01111...111.  */
-      m.word[0] &= -1U << FLT_EXPBIT0_BIT;
-      m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1;
-      if (!isnanf (m.value))
-        result |= 4;
-    }
-#endif
-
   return result;
 }]])],
         [gl_cv_func_isnanf_works=yes],
         [gl_cv_func_isnanf_works=no],
         [case "$host_os" in
-           irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;;
+           solaris*) gl_cv_func_isnanf_works="guessing no" ;;
            mingw* | windows*) # Guess yes on mingw, no on MSVC.
              AC_EGREP_CPP([Known], [
 #ifdef __MINGW32__
index 66cc3f7f50ccd99b420b8f3c7f4e5fab91e954e7..01b2928a9d333b9b5a6317480934d7b84dec68b4 100644 (file)
@@ -1,5 +1,5 @@
 # isnanl.m4
-# serial 26
+# serial 27
 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -135,17 +135,7 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
   ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
 typedef union { unsigned int word[NWORDS]; long double value; }
         memory_long_double;
-/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
-   runtime type conversion.  */
-#ifdef __sgi
-static long double NaNl ()
-{
-  double zero = 0.0;
-  return zero / zero;
-}
-#else
-# define NaNl() (0.0L / 0.0L)
-#endif
+#define NaNl() (0.0L / 0.0L)
 int main ()
 {
   int result = 0;