From: Bruno Haible Date: Wed, 10 Sep 2025 21:00:16 +0000 (+0200) Subject: isnan*, isnan*-nolibm: Remove support for IRIX. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db5d0269a01e0f4a17b001136f0d4f2aae93bd0a;p=thirdparty%2Fgnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index a061c2a12a..b62d9f027a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2025-09-10 Bruno Haible + 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. diff --git a/lib/isnan.c b/lib/isnan.c index 3e119a333c..c8a65caaa5 100644 --- a/lib/isnan.c +++ b/lib/isnan.c @@ -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; diff --git a/lib/isnanf-nolibm.h b/lib/isnanf-nolibm.h index 4a4977cd56..d2e5764403 100644 --- a/lib/isnanf-nolibm.h +++ b/lib/isnanf-nolibm.h @@ -30,17 +30,6 @@ # elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) -# else - /* Get declaration of isnanf(), if not declared in . */ -# if defined __sgi - /* We can't include , 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. */ diff --git a/m4/isnanf.m4 b/m4/isnanf.m4 index 3aa2fbb83e..a23b22b181 100644 --- a/m4/isnanf.m4 +++ b/m4/isnanf.m4 @@ -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__ diff --git a/m4/isnanl.m4 b/m4/isnanl.m4 index 66cc3f7f50..01b2928a9d 100644 --- a/m4/isnanl.m4 +++ b/m4/isnanl.m4 @@ -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;