* 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.
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.
/* 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;
# 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. */
# 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,
])
])
-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])
# 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;
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__
# 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,
((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;