|
From: <kin...@us...> - 2025-08-15 23:13:16
|
Revision: 7275
http://sourceforge.net/p/teem/code/7275
Author: kindlmann
Date: 2025-08-15 23:13:13 +0000 (Fri, 15 Aug 2025)
Log Message:
-----------
Dropping support for qnan vs snan, and all the annoying QNaNHiBit stuff. The world has decided that QNaNHiBit==1
Modified Paths:
--------------
teem/trunk/CMakeLists.txt
teem/trunk/src/air/754.c
teem/trunk/src/air/air.h
teem/trunk/src/air/miscAir.c
teem/trunk/src/air/sane.c
teem/trunk/src/nrrd/apply1D.c
teem/trunk/src/unrrdu/built.c
Removed Paths:
-------------
teem/trunk/CMake/TestQnanhibit.c
teem/trunk/CMake/TestQnanhibit.cmake
teem/trunk/include/teemQnanhibit.h
Deleted: teem/trunk/CMake/TestQnanhibit.c
===================================================================
--- teem/trunk/CMake/TestQnanhibit.c 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/CMake/TestQnanhibit.c 2025-08-15 23:13:13 UTC (rev 7275)
@@ -1,33 +0,0 @@
-#include <stdio.h>
-#include <float.h>
-
-#if defined(__BORLANDC__)
-# include <math.h>
-# include <float.h>
-#endif
-
-int
-main(int argc, char *argv[]) {
- const char *const me = argv[0];
- const float zero = 0.0F;
- union {
- float flt32bit;
- int int32bit;
- } qnan;
-
- (void)argc; /* Force usage of parameter */
-
-#if defined(__BORLANDC__)
- // Disable floating point exceptions in Borland
- _control87(MCW_EM, MCW_EM);
-#endif // defined(__BORLANDC__)
-
- if (sizeof(float) != sizeof(int)) {
- fprintf(stderr, "%s: MADNESS: sizeof(float)=%d != sizeof(int)=%d\n", me,
- (int)sizeof(float), (int)sizeof(int));
- return -1;
- }
- qnan.flt32bit = zero / zero;
- printf("-DTEEM_QNANHIBIT=%d\n", (qnan.int32bit >> 22) & 1);
- return (int)((qnan.int32bit >> 22) & 1);
-}
Deleted: teem/trunk/CMake/TestQnanhibit.cmake
===================================================================
--- teem/trunk/CMake/TestQnanhibit.cmake 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/CMake/TestQnanhibit.cmake 2025-08-15 23:13:13 UTC (rev 7275)
@@ -1,58 +0,0 @@
-#
-# Teem: Tools to process and visualize scientific data and images
-# Copyright (C) 2009--2019 University of Chicago
-# Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
-# Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# (LGPL) as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# The terms of redistributing and/or modifying this software also
-# include exceptions to the LGPL that facilitate static linking.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-#
-# Checks whether the 22nd bit of a 32-bit quiet-NaN is 1 (1) or 0 (0). This
-# distinction is needed in handling of IEEE floating point special values.
-# This quantity is independent of endian-ness.
-#
-# VARIABLE - variable to store the result to
-#
-
-macro(TEST_QNANHIBIT VARIABLE LOCAL_TEST_DIR)
- if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
- try_run(${VARIABLE} HAVE_${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${LOCAL_TEST_DIR}/TestQnanhibit.c
- OUTPUT_VARIABLE OUTPUT)
- message(STATUS "Find the value of the 22nd bit of a 32-bit quiet NaN")
- if(HAVE_${VARIABLE})
- if(${VARIABLE} LESS 0)
- # GLK wonders if this should instead be a FATAL_ERROR
- message(ERROR " A test (TestQnanhibit.c) necessary for NrrdIO configuration returned error code. NrrdIO may not properly handle NaN's.")
- endif()
- if(${VARIABLE})
- file(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log "22nd bit of a 32-bit quiet NaN = 1")
- message(STATUS "22nd bit of a 32-bit quiet NaN = 1")
- else()
- file(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log "22nd bit of a 32-bit quiet NaN = 0")
- message(STATUS "22nd bit of a 32-bit quiet NaN = 0")
- endif()
- else()
- file(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
- "\tFailed to compile a test (TestQnanhibit.c) necessary to configure for proper handling of IEEE floating point NaNs.\n")
- message(FATAL_ERROR " Failed to compile a test (TestQnanhibit.c) necessary to configure for proper handling of IEEE floating point NaNs")
- endif()
- file(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log "TestQnanhibit.c produced following output:\n${OUTPUT}\n\n")
- endif()
-endmacro()
Modified: teem/trunk/CMakeLists.txt
===================================================================
--- teem/trunk/CMakeLists.txt 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/CMakeLists.txt 2025-08-15 23:13:13 UTC (rev 7275)
@@ -97,23 +97,6 @@
file(MAKE_DIRECTORY ${Teem_BINARY_DIR}/include/teem)
#-----------------------------------------------------------------------------
-# Find platform-specific differences in the handling of IEEE floating point special values.
-# This is needed by Teem
-include(${Teem_SOURCE_DIR}/CMake/TestQnanhibit.cmake)
-TEST_QNANHIBIT(QNANHIBIT_VALUE ${Teem_SOURCE_DIR}/CMake)
-if(QNANHIBIT_VALUE)
- set(QNANHIBIT 1 CACHE INTERNAL "The 22nd bit of 32-bit floating-point quiet NaN.")
-else()
- set(QNANHIBIT 0 CACHE INTERNAL "The 22nd bit of 32-bit floating-point quiet NaN.")
-endif()
-# Teem Defines
-if(QNANHIBIT)
- add_definitions(-DTEEM_QNANHIBIT=1)
-else()
- add_definitions(-DTEEM_QNANHIBIT=0)
-endif()
-
-#-----------------------------------------------------------------------------
# test if AIR_EXISTS macro fails
message(STATUS "Check if AIR_EXISTS works to detect IEEE754 special values")
# try_run(<runResultVar> <compileResultVar> <bindir> <srcfile>)
Deleted: teem/trunk/include/teemQnanhibit.h
===================================================================
--- teem/trunk/include/teemQnanhibit.h 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/include/teemQnanhibit.h 2025-08-15 23:13:13 UTC (rev 7275)
@@ -1,39 +0,0 @@
-/*
- Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-
-/*
-** the end result of this is that the source file which includes
-** this can be sure that TEEM_QNANHIBIT is set, and can be sure that
-** it is set to either 0 or 1
-*/
-
-#ifndef TEEM_QNANHIBIT
-# error TEEM_QNANHIBIT not defined
-#elif TEEM_QNANHIBIT == 1
-# /* okay, its 1 */
-#elif TEEM_QNANHIBIT == 0
-# /* okay, its 0 */
-#else
-# error TEEM_QNANHIBIT not set to 0 or 1
-#endif
Modified: teem/trunk/src/air/754.c
===================================================================
--- teem/trunk/src/air/754.c 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/src/air/754.c 2025-08-15 23:13:13 UTC (rev 7275)
@@ -21,13 +21,11 @@
#include "air.h"
#include "privateAir.h"
-#include <teemQnanhibit.h>
/* clang-format off */
static const char *_airFPClass_Str[AIR_FP_MAX+1] = {
"(unknown_class)",
- "snan",
- "qnan",
+ "nan",
"pinf",
"ninf",
"pnorm",
@@ -40,8 +38,7 @@
static const char *_airFPClass_Desc[AIR_FP_MAX+1] = {
"unknown_class",
- "signalling nan",
- "quiet nan",
+ "(quiet) nan",
"positive infinity",
"negative infinity",
"positive normalized",
@@ -53,8 +50,7 @@
};
static const char *_airFPClass_StrEqv[] = {
- "snan", "signan",
- "qnan", "nan",
+ "nan", "qnan",
"pinf", "posinf", "+inf", "inf",
"ninf", "neginf", "-inf",
"pnorm", "posnorm", "+norm", "norm",
@@ -67,8 +63,7 @@
};
static const int _airFPClass_ValEqv[] = {
- airFP_SNAN, airFP_SNAN,
- airFP_QNAN, airFP_QNAN,
+ airFP_NAN, airFP_NAN,
airFP_POS_INF, airFP_POS_INF, airFP_POS_INF, airFP_POS_INF,
airFP_NEG_INF, airFP_NEG_INF, airFP_NEG_INF,
airFP_POS_NORM, airFP_POS_NORM, airFP_POS_NORM, airFP_POS_NORM,
@@ -107,16 +102,38 @@
** aggregate initialization.
*/
-#if TEEM_QNANHIBIT == 1
-const unsigned int airMyQNaNHiBit = 1;
-const airFloat airFloatQNaN = {0x7fffffff};
-const airFloat airFloatSNaN = {0x7fbfffff};
-#else
-const unsigned int airMyQNaNHiBit = 0;
-const airFloat airFloatQNaN = {0x7fbfffff};
-const airFloat airFloatSNaN = {0x7fffffff};
-#endif
+/*
+With Teem v2, GLK decided to drop configuration-time learning of, and compile-time
+handling of, "QNaNHiBit": the most significant bit (MSB) of the fraction bitfield in a
+quiet (versus signalling) NaN.
+In ~2000 when this code was written, if you generated a NaN from scratch via floating
+point (FP) operations (e.g. create an inf by overflowing multiplication, and then divide
+inf by itself), then SGI IRIX machines would set to the MSB fraction bit to 0, rather
+than the 1 that other machines used. With the assumption that these operations should
+have created what should be a quiet NaN, GLK interpreted this as a platform dependence in
+how a quiet NaN with the same bit pattern should be created at compile time. This
+motivated handling variable QNaNHiBit at configuration time, and the associated
+complication in the code below.
+
+Now, the world now seems to agree that QNaNHiBit should be 1 (and the
+http://en.wikipedia.org/wiki/NaN#Encoding URL, noted above in the first iterations of
+754.c and which has happily remained valid over 25 years, now documents this). For
+whatever tiny extant fraction of the world wants QNaNHiBit to be 0, they may risk
+floating point signal handlers being triggered by the NaN generated here at compile
+time. Hopefully they have the wherewithal to disable those signal handlers for that
+circumstance.
+
+With the simplification of how QNaN is handled, the decision was also made to make
+"NaN" in Teem code refer to a quiet NaN, with no pretense of generating signalling
+NaNs at compile-time. Teem has never invoked an FP signal handler, and has no reason
+to start now. So airFloatQNaN turned into airFloatQNaN and airFloatSNaN was dropped.
+*/
+/* #if TEEM_QNANHIBIT == 1 ... (no more) */
+/* const unsigned int airMyQNaNHiBit = 1; (no more) */
+#define _QNANHIBIT 1 /* just for this file */
+const airFloat airFloatNaN = {0x7fffffff};
+
const airFloat airFloatPosInf = {0x7f800000};
const airFloat airFloatNegInf = {0xff800000}; /* why does solaris whine? */
@@ -218,13 +235,10 @@
mant = (mm)
switch (cls) {
- case airFP_SNAN:
- /* sgn: anything, mant: anything non-zero with high bit !TEEM_QNANHIBIT */
- SET_SEM(0, 0xff, (!TEEM_QNANHIBIT << 22) | 0x3fffff);
+ case airFP_NAN:
+ /* (no separate handling of signalling NaN) */
+ SET_SEM(0, 0xff, (_QNANHIBIT << 22) | 0x3fffff);
break;
- case airFP_QNAN:
- SET_SEM(0, 0xff, (TEEM_QNANHIBIT << 22) | 0x3fffff);
- break;
case airFP_POS_INF:
SET_SEM(0, 0xff, 0);
break;
@@ -279,14 +293,11 @@
mant1 = (m1)
switch (cls) {
- case airFP_SNAN:
- /* sgn: anything, mant: anything non-zero with high bit !TEEM_QNANHIBIT */
- SET_SEM(0, 0x7ff, (!TEEM_QNANHIBIT << 19) | 0x7ffff, 0xffffffff);
+ case airFP_NAN:
+ /* (no separate handling of signalling NaN) */
+ /* sgn: anything, mant anything non-zero with high bit _QNANHIBIT */
+ SET_SEM(0, 0x7ff, (_QNANHIBIT << 19) | 0x7ffff, 0xffffffff);
break;
- case airFP_QNAN:
- /* sgn: anything, mant anything non-zero with high bit TEEM_QNANHIBIT */
- SET_SEM(0, 0x7ff, (TEEM_QNANHIBIT << 19) | 0x7ffff, 0xffffffff);
- break;
case airFP_POS_INF:
SET_SEM(0, 0x7ff, 0, 0);
break;
@@ -323,7 +334,7 @@
}
static int
-wutClass(unsigned int index, int expoMax, unsigned int nanHiBit) {
+wutClass(unsigned int index, int expoMax) {
int ret = airFP_Unknown;
switch (index) {
case 0:
@@ -345,11 +356,8 @@
case 3:
/* exponent and mantissa fields are non-zero */
if (expoMax) {
- if (TEEM_QNANHIBIT == nanHiBit) {
- ret = airFP_QNAN;
- } else {
- ret = airFP_SNAN;
- }
+ /* we don't distinguish (any longer) between qnan and snan */
+ ret = airFP_NAN;
} else {
ret = airFP_POS_NORM;
}
@@ -373,11 +381,8 @@
case 7:
/* all fields are non-zero */
if (expoMax) {
- if (TEEM_QNANHIBIT == nanHiBit) {
- ret = airFP_QNAN;
- } else {
- ret = airFP_SNAN;
- }
+ /* we don't distinguish (any longer) between qnan and snan */
+ ret = airFP_NAN;
} else {
ret = airFP_NEG_NORM;
}
@@ -397,7 +402,7 @@
airFPValToParts_f(&sign, &expo, &mant, val);
/* "!" produces an int: https://en.cppreference.com/w/c/language/operator_logical */
indexv = (AIR_UINT(!!sign) << 2) | (AIR_UINT(!!expo) << 1) | AIR_UINT(!!mant);
- return wutClass(indexv, 0xff == expo, mant >> 22);
+ return wutClass(indexv, 0xff == expo);
}
/*
@@ -412,7 +417,7 @@
airFPValToParts_d(&sign, &expo, &mant0, &mant1, val);
indexv = (AIR_UINT(!!sign) << 2) | (AIR_UINT(!!expo) << 1)
| (AIR_UINT(!!mant0) || AIR_UINT(!!mant1));
- return wutClass(indexv, 0x7ff == expo, mant0 >> 19);
+ return wutClass(indexv, 0x7ff == expo);
}
/*
@@ -499,7 +504,7 @@
float
airNaN(void) {
- return airFPGen_f(airFP_QNAN);
+ return airFPGen_f(airFP_NAN);
}
/*
Modified: teem/trunk/src/air/air.h
===================================================================
--- teem/trunk/src/air/air.h 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/src/air/air.h 2025-08-15 23:13:13 UTC (rev 7275)
@@ -351,9 +351,10 @@
** the different kinds of floating point number afforded by IEEE 754,
** and the values returned by airFPClass_f().
**
-** The values probably won't agree with those in #include's like
+** The numeric enum values probably won't agree with those in #include's like
** ieee.h, ieeefp.h, fp_class.h. This is because IEEE 754 hasn't
-** defined standard values for these, so everyone does it differently.
+** defined standard values for these, so everyone does it differently
+** (or at least that was so around AD 2000 when this code was born)
**
** This enum uses underscores (against Teem convention) to help
** legibility while also conforming to the spirit of the somewhat
@@ -360,20 +361,19 @@
** standard naming conventions
*/
enum {
- airFP_Unknown, /* 0: nobody knows */
- airFP_SNAN, /* 1: signalling NaN */
- airFP_QNAN, /* 2: quiet NaN */
- airFP_POS_INF, /* 3: positive infinity */
- airFP_NEG_INF, /* 4: negative infinity */
- airFP_POS_NORM, /* 5: positive normalized non-zero */
- airFP_NEG_NORM, /* 6: negative normalized non-zero */
- airFP_POS_DENORM, /* 7: positive denormalized non-zero */
- airFP_NEG_DENORM, /* 8: negative denormalized non-zero */
- airFP_POS_ZERO, /* 9: +0.0, positive zero */
- airFP_NEG_ZERO, /* 10: -0.0, negative zero */
+ airFP_Unknown, /* 0: nobody knows */
+ airFP_NAN, /* 1: (quiet) NaN */
+ airFP_POS_INF, /* 2: positive infinity */
+ airFP_NEG_INF, /* 3: negative infinity */
+ airFP_POS_NORM, /* 4: positive normalized non-zero */
+ airFP_NEG_NORM, /* 5: negative normalized non-zero */
+ airFP_POS_DENORM, /* 6: positive denormalized non-zero */
+ airFP_NEG_DENORM, /* 7: negative denormalized non-zero */
+ airFP_POS_ZERO, /* 8: +0.0, positive zero */
+ airFP_NEG_ZERO, /* 9: -0.0, negative zero */
airFP_Last /* after the last valid one */
};
-#define AIR_FP_MAX 10
+#define AIR_FP_MAX 9
/* 754.c: IEEE-754 related stuff values */
typedef union {
unsigned int i;
@@ -384,7 +384,6 @@
double d;
} airDouble;
AIR_EXPORT const airEnum *const airFPClass_ae;
-AIR_EXPORT const unsigned int airMyQNaNHiBit;
AIR_EXPORT float airFPPartsToVal_f(unsigned int sign,
unsigned int expo,
unsigned int mant);
@@ -405,8 +404,7 @@
AIR_EXPORT int airFPClass_d(double val);
AIR_EXPORT void airFPFprintf_f(FILE *file, float val);
AIR_EXPORT void airFPFprintf_d(FILE *file, double val);
-AIR_EXPORT const airFloat airFloatQNaN;
-AIR_EXPORT const airFloat airFloatSNaN;
+AIR_EXPORT const airFloat airFloatNaN;
AIR_EXPORT const airFloat airFloatPosInf;
AIR_EXPORT const airFloat airFloatNegInf;
AIR_EXPORT float airNaN(void);
@@ -551,13 +549,11 @@
airInsane_NaNExists, /* 4: AIR_EXISTS(NaN) was true */
airInsane_ExistsBad, /* 5: AIR_EXISTS of some finite values was false */
airInsane_FltDblFPClass, /* 6: double -> float assignment messed up the
- airFPClass_f() of the value */
- airInsane_QNaNHiBit, /* 7: airMyQNaNHiBit is wrong */
- airInsane_AIR_NAN, /* 8: airFPClass_f(AIR_QNAN) wrong
- (no longer checking on problematic SNAN) */
- airInsane_UCSize, /* 9: unsigned char isn't 8 bits */
- airInsane_FISize, /* 10: sizeof(float), sizeof(int) not 4 */
- airInsane_DLSize, /* 11: sizeof(double), sizeof(airLLong) not 8 */
+ airFPClass_f() of the value */
+ airInsane_AIR_NAN, /* 7: airFPClass_f(AIR_NAN) wrong */
+ airInsane_UCSize, /* 8: unsigned char isn't 8 bits */
+ airInsane_FISize, /* 9: sizeof(float), sizeof(int) not 4 */
+ airInsane_DLSize, /* 10: sizeof(double), sizeof(airLLong) not 8 */
airInsane_last
};
#define AIR_INSANE_MAX 11
@@ -723,9 +719,9 @@
#define AIR_CALLOC(N, T) (T *)(calloc((N), sizeof(T)))
/*
-******** AIR_ENDIAN, AIR_QNANHIBIT
+******** AIR_ENDIAN
**
-** These reflect particulars of hardware which we're running on. The
+** This reflects particulars of hardware which we're running on. The
** difference from the things starting with TEEM_ is that the TEEM_
** values are for passing architecture-specific to compilation of source
** files, and thes AIR_ variables are for advertising that information
@@ -732,10 +728,9 @@
** to anyone linking against air (or Teem) and including air.h.
*/
#define AIR_ENDIAN (airMyEndian())
-#define AIR_QNANHIBIT (airMyQNaNHiBit)
/*
-******** AIR_NAN, AIR_QNAN, AIR_SNAN, AIR_POS_INF, AIR_NEG_INF
+******** AIR_NAN, AIR_POS_INF, AIR_NEG_INF
**
** its nice to have these values available without the cost of a
** function call.
@@ -745,9 +740,7 @@
** the NaNs, however, they are only one of many possible
** representations.
*/
-#define AIR_NAN (airFloatQNaN.f)
-#define AIR_QNAN (airFloatQNaN.f)
-#define AIR_SNAN (airFloatSNaN.f)
+#define AIR_NAN (airFloatNaN.f)
#define AIR_POS_INF (airFloatPosInf.f)
#define AIR_NEG_INF (airFloatNegInf.f)
Modified: teem/trunk/src/air/miscAir.c
===================================================================
--- teem/trunk/src/air/miscAir.c 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/src/air/miscAir.c 2025-08-15 23:13:13 UTC (rev 7275)
@@ -159,7 +159,7 @@
** a complete stand-in for {f|s}printf(), as long as the given format
** string contains exactly one conversion sequence. The utility of
** this is to standardize the printing of IEEE 754 special values:
-** QNAN, SNAN -> "NaN"
+** NAN (any kind) -> "NaN"
** POS_INF -> "+inf"
** NEG_INF -> "-inf"
** The format string can contain other things besides just the
@@ -206,8 +206,7 @@
val = va_arg(ap, double);
cls = airFPClass_d(val);
switch (cls) {
- case airFP_SNAN:
- case airFP_QNAN:
+ case airFP_NAN:
case airFP_POS_INF:
case airFP_NEG_INF:
if (isF) {
@@ -222,8 +221,7 @@
}
#define PRINT(F, S, C, V) ((F) ? fprintf((F), (C), (V)) : sprintf((S), (C), (V)))
switch (cls) {
- case airFP_SNAN:
- case airFP_QNAN:
+ case airFP_NAN:
ret = PRINT(file, str, fmt, "NaN");
break;
case airFP_POS_INF:
Modified: teem/trunk/src/air/sane.c
===================================================================
--- teem/trunk/src/air/sane.c 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/src/air/sane.c 2025-08-15 23:13:13 UTC (rev 7275)
@@ -129,9 +129,6 @@
ninfF = (float)ninf;
airFPValToParts_f(&sign, &expvalue, &mant, nanF);
mant >>= 22;
- if (AIR_QNANHIBIT != mant) {
- return airInsane_QNaNHiBit;
- }
/* this a rough test of the _F and _D macros at the end of air.h; they aren't currently
used within Teem so it is harder to justify making an airInsane case just for these;
but if that happens this might be a start
@@ -153,8 +150,7 @@
} while (0);
*/
- if (!(airFP_QNAN == airFPClass_f(AIR_NAN)
- && airFP_QNAN == airFPClass_f(AIR_QNAN)
+ if (!(airFP_NAN == airFPClass_f(AIR_NAN)
/*
As of July 4 2012 GLK decides that the signalling NaN tests are
more trouble than they're worth: the signal-ness of the NaN is not
@@ -172,11 +168,12 @@
following line is now commented out for all platforms.
*/
/* && airFP_SNAN == airFPClass_f((double)AIR_SNAN) */
- && airFP_QNAN == airFPClass_d((double)AIR_NAN)
- && airFP_QNAN == airFPClass_d((double)AIR_QNAN))) {
+ /* (and on August 15 2025 GLK decides to drop SNAN altogether) */
+ && airFP_NAN == airFPClass_d((double)AIR_NAN))) {
return airInsane_AIR_NAN;
}
- if (!(airFP_QNAN == airFPClass_f(nanF) && airFP_POS_INF == airFPClass_f(pinfF)
+ if (!(airFP_NAN == airFPClass_f(nanF) /* */
+ && airFP_POS_INF == airFPClass_f(pinfF)
&& airFP_NEG_INF == airFPClass_f(ninfF))) {
/* really, this is verifying that assigning from a double to a
float maintains the FPClass for non-existent values */
Modified: teem/trunk/src/nrrd/apply1D.c
===================================================================
--- teem/trunk/src/nrrd/apply1D.c 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/src/nrrd/apply1D.c 2025-08-15 23:13:13 UTC (rev 7275)
@@ -643,7 +643,7 @@
return 1;
}
if (!(airFP_NEG_INF == airFPClass_d(mapLup(nmap->data, 0 * entLen))
- && airFP_QNAN == airFPClass_d(mapLup(nmap->data, 1 * entLen))
+ && airFP_NAN == airFPClass_d(mapLup(nmap->data, 1 * entLen))
&& airFP_POS_INF == airFPClass_d(mapLup(nmap->data, 2 * entLen)))) {
biffAddf(NRRD,
"%s: 1st entry's position non-existent, but position "
@@ -961,8 +961,7 @@
case airFP_NEG_INF:
mapIdx = 0;
break;
- case airFP_SNAN:
- case airFP_QNAN:
+ case airFP_NAN:
mapIdx = 1;
break;
case airFP_POS_INF:
Modified: teem/trunk/src/unrrdu/built.c
===================================================================
--- teem/trunk/src/unrrdu/built.c 2025-08-15 22:21:41 UTC (rev 7274)
+++ teem/trunk/src/unrrdu/built.c 2025-08-15 23:13:13 UTC (rev 7275)
@@ -74,7 +74,6 @@
/* NOT shown: status of Levmar */
printf("# platform parameters:\n");
printf("%u = sizeof(void*)\n", (unsigned int)sizeof(void *));
- printf("%u = airMyQNaNHiBit\n", airMyQNaNHiBit);
printf("%s = airMyEndian()\n", airEnumStr(airEndian, airMyEndian()));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|