mirror of git://sourceware.org/git/glibc.git
Better distinguish between NaN/qNaN/sNaN.
This commit is contained in:
parent
64487e1264
commit
67e971f18f
17
ChangeLog
17
ChangeLog
|
@ -1,5 +1,22 @@
|
|||
2013-03-15 Thomas Schwinge <thomas@codesourcery.com>
|
||||
|
||||
* math/basic-test.c (TEST_FUNC, TEST_TRUNC): Rename NaN_var to
|
||||
qNaN_var. Fix a few strings, too.
|
||||
* math/libm-test.inc (nan_value): Rename to qnan_value.
|
||||
* math/gen-libm-test.pl (%beautify): Adjust to that.
|
||||
* math/bits/mathcalls.h (nan): Refer to qNaN instead of NaN.
|
||||
* math/test-misc.c (main): Likewise.
|
||||
* sysdeps/ieee754/bits/nan.h (__nan_bytes, __nan_union): Rename
|
||||
to __qnan_bytes, and __qnan_union, respectively.
|
||||
* ports/sysdeps/mips/bits/nan.h (__nan_bytes, __nan_union):
|
||||
Likewise.
|
||||
* stdio-common/tstdiomisc.c (nanval, lnanval): Rename to qnanval,
|
||||
and lqnanval, respectively.
|
||||
* sysdeps/powerpc/bits/fenv.h: Fix usage of NaN/qNaN/sNaN.
|
||||
* sysdeps/powerpc/fpu/fenv_libc.h: Likewise.
|
||||
* sysdeps/powerpc/fpu/test-powerpc-snan.c (TEST_FUNC): Likewise,
|
||||
and rename NaN_var to qNaN_var, and SNaN_var to sNaN_var.
|
||||
|
||||
* math/libm-test.inc (fpstack_test) [__x86_64__]: Enable test.
|
||||
* math/test-misc.c (main) [__x86_64__]: Enable test for long
|
||||
doubles.
|
||||
|
|
|
@ -32,40 +32,40 @@ check (const char *testname, int result)
|
|||
}
|
||||
}
|
||||
|
||||
#define TEST_FUNC(NAME, FLOAT, NANFUNC, EPSILON, HUGEVAL) \
|
||||
#define TEST_FUNC(NAME, FLOAT, NANFUNC, EPSILON, HUGEVAL) \
|
||||
static void \
|
||||
NAME (void) \
|
||||
{ \
|
||||
/* Variables are declared volatile to forbid some compiler \
|
||||
optimizations. */ \
|
||||
volatile FLOAT Inf_var, NaN_var, zero_var, one_var; \
|
||||
volatile FLOAT Inf_var, qNaN_var, zero_var, one_var; \
|
||||
FLOAT x1, x2; \
|
||||
\
|
||||
zero_var = 0.0; \
|
||||
one_var = 1.0; \
|
||||
NaN_var = zero_var / zero_var; \
|
||||
qNaN_var = zero_var / zero_var; \
|
||||
Inf_var = one_var / zero_var; \
|
||||
\
|
||||
(void) &zero_var; \
|
||||
(void) &one_var; \
|
||||
(void) &NaN_var; \
|
||||
(void) &qNaN_var; \
|
||||
(void) &Inf_var; \
|
||||
\
|
||||
\
|
||||
check (#FLOAT " isinf (inf) == 1", isinf (Inf_var) == 1); \
|
||||
check (#FLOAT " isinf (-inf) == -1", isinf (-Inf_var) == -1); \
|
||||
check (#FLOAT " !isinf (1)", !(isinf (one_var))); \
|
||||
check (#FLOAT " !isinf (NaN)", !(isinf (NaN_var))); \
|
||||
check (#FLOAT " !isinf (qNaN)", !(isinf (qNaN_var))); \
|
||||
\
|
||||
check (#FLOAT " isnan (NaN)", isnan (NaN_var)); \
|
||||
check (#FLOAT " isnan (-NaN)", isnan (-NaN_var)); \
|
||||
check (#FLOAT " isnan (qNaN)", isnan (qNaN_var)); \
|
||||
check (#FLOAT " isnan (-qNaN)", isnan (-qNaN_var)); \
|
||||
check (#FLOAT " !isnan (1)", !(isnan (one_var))); \
|
||||
check (#FLOAT " !isnan (inf)", !(isnan (Inf_var))); \
|
||||
\
|
||||
check (#FLOAT " inf == inf", Inf_var == Inf_var); \
|
||||
check (#FLOAT " -inf == -inf", -Inf_var == -Inf_var); \
|
||||
check (#FLOAT " inf != -inf", Inf_var != -Inf_var); \
|
||||
check (#FLOAT " NaN != NaN", NaN_var != NaN_var); \
|
||||
check (#FLOAT " qNaN != qNaN", qNaN_var != qNaN_var); \
|
||||
\
|
||||
/* \
|
||||
the same tests but this time with NAN from <bits/nan.h> \
|
||||
|
@ -80,11 +80,11 @@ NAME (void) \
|
|||
/* \
|
||||
And again with the value returned by the `nan' function. \
|
||||
*/ \
|
||||
check (#FLOAT " isnan (NAN)", isnan (NANFUNC (""))); \
|
||||
check (#FLOAT " isnan (-NAN)", isnan (-NANFUNC (""))); \
|
||||
check (#FLOAT " !isinf (NAN)", !(isinf (NANFUNC ("")))); \
|
||||
check (#FLOAT " !isinf (-NAN)", !(isinf (-NANFUNC ("")))); \
|
||||
check (#FLOAT " NAN != NAN", NANFUNC ("") != NANFUNC ("")); \
|
||||
check (#FLOAT " isnan (nan (\"\"))", isnan (NANFUNC (""))); \
|
||||
check (#FLOAT " isnan (-nan (\"\"))", isnan (-NANFUNC (""))); \
|
||||
check (#FLOAT " !isinf (nan (\"\"))", !(isinf (NANFUNC ("")))); \
|
||||
check (#FLOAT " !isinf (-nan (\"\"))", !(isinf (-NANFUNC ("")))); \
|
||||
check (#FLOAT " nan (\"\") != nan (\"\")", NANFUNC ("") != NANFUNC ("")); \
|
||||
\
|
||||
/* test if EPSILON is ok */ \
|
||||
x1 = 1.0; \
|
||||
|
@ -106,19 +106,19 @@ NAME (void) \
|
|||
void \
|
||||
NAME (void) \
|
||||
{ \
|
||||
volatile DOUBLE Inf_var, NaN_var, zero_var, one_var; \
|
||||
volatile DOUBLE Inf_var, qNaN_var, zero_var, one_var; \
|
||||
FLOAT x1, x2; \
|
||||
\
|
||||
zero_var = 0.0; \
|
||||
one_var = 1.0; \
|
||||
NaN_var = zero_var / zero_var; \
|
||||
qNaN_var = zero_var / zero_var; \
|
||||
Inf_var = one_var / zero_var; \
|
||||
\
|
||||
(void) &NaN_var; \
|
||||
(void) &qNaN_var; \
|
||||
(void) &Inf_var; \
|
||||
\
|
||||
x1 = (FLOAT) NaN_var; \
|
||||
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") NaN", isnan (x1) != 0); \
|
||||
x1 = (FLOAT) qNaN_var; \
|
||||
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") qNaN", isnan (x1) != 0); \
|
||||
x2 = (FLOAT) Inf_var; \
|
||||
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") Inf", isinf (x2) != 0); \
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ __END_NAMESPACE_C99
|
|||
|
||||
#ifdef __USE_ISOC99
|
||||
__BEGIN_NAMESPACE_C99
|
||||
/* Return representation of NaN for double type. */
|
||||
/* Return representation of qNaN for double type. */
|
||||
__MATHCALLX (nan,, (const char *__tagb), (__const__));
|
||||
__END_NAMESPACE_C99
|
||||
#endif
|
||||
|
|
|
@ -58,7 +58,7 @@ use vars qw ($output_dir $ulps_file);
|
|||
"plus_zero" => "+0",
|
||||
"minus_infty" => "-inf",
|
||||
"plus_infty" => "inf",
|
||||
"nan_value" => "NaN",
|
||||
"qnan_value" => "qNaN",
|
||||
"M_El" => "e",
|
||||
"M_E2l" => "e^2",
|
||||
"M_E3l" => "e^3",
|
||||
|
|
1148
math/libm-test.inc
1148
math/libm-test.inc
File diff suppressed because it is too large
Load Diff
|
@ -1074,7 +1074,7 @@ main (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* Special NaNs in x86 long double. Test for scalbl. */
|
||||
/* Special qNaNs in x86 long double. Test for scalbl. */
|
||||
{
|
||||
union
|
||||
{
|
||||
|
@ -1087,12 +1087,12 @@ main (void)
|
|||
r = scalbl (u.d, 0.0);
|
||||
if (!isnan (r))
|
||||
{
|
||||
puts ("scalbl(NaN, 0) does not return NaN");
|
||||
puts ("scalbl (qNaN, 0) does not return NaN");
|
||||
result = 1;
|
||||
}
|
||||
else if (memcmp (&r, &u.d, sizeof (double)) != 0)
|
||||
{
|
||||
puts ("scalbl(NaN, 0) does not return the same NaN");
|
||||
puts ("scalbl (qNaN, 0) does not return the same NaN");
|
||||
result = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
|
||||
/* IEEE Not A Number. */
|
||||
/* Note that MIPS has the QNaN and SNaN patterns reversed compared to most
|
||||
other architectures. The IEEE spec left the definition of this open to
|
||||
/* Note that MIPS has the qNaN and sNaN patterns reversed compared to most
|
||||
other architectures. IEEE 754-1985 left the definition of this open to
|
||||
implementations, and for MIPS the top bit of the mantissa must be SET to
|
||||
indicate a SNaN. */
|
||||
indicate a sNaN. */
|
||||
|
||||
#if __GNUC_PREREQ(3,3)
|
||||
|
||||
|
@ -43,14 +43,14 @@
|
|||
# include <endian.h>
|
||||
|
||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define __nan_bytes { 0x7f, 0xbf, 0xff, 0xff }
|
||||
# define __qnan_bytes { 0x7f, 0xbf, 0xff, 0xff }
|
||||
# endif
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
# define __nan_bytes { 0xff, 0xff, 0xbf, 0x7f }
|
||||
# define __qnan_bytes { 0xff, 0xff, 0xbf, 0x7f }
|
||||
# endif
|
||||
|
||||
static union { unsigned char __c[4]; float __d; } __nan_union
|
||||
__attribute__ ((__unused__)) = { __nan_bytes };
|
||||
# define NAN (__nan_union.__d)
|
||||
static union { unsigned char __c[4]; float __d; } __qnan_union
|
||||
__attribute__ ((__unused__)) = { __qnan_bytes };
|
||||
# define NAN (__qnan_union.__d)
|
||||
|
||||
#endif /* GCC. */
|
||||
|
|
|
@ -46,9 +46,9 @@ t2 (void)
|
|||
return result;
|
||||
}
|
||||
|
||||
volatile double nanval;
|
||||
volatile double qnanval;
|
||||
volatile double infval;
|
||||
volatile long double lnanval;
|
||||
volatile long double lqnanval;
|
||||
volatile long double linfval;
|
||||
|
||||
|
||||
|
@ -59,16 +59,17 @@ F (void)
|
|||
wchar_t wbuf[40];
|
||||
int result;
|
||||
|
||||
nanval = NAN;
|
||||
qnanval = NAN;
|
||||
|
||||
snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
|
||||
nanval, nanval, nanval, nanval, nanval, nanval, nanval, nanval);
|
||||
qnanval, qnanval, qnanval, qnanval,
|
||||
qnanval, qnanval, qnanval, qnanval);
|
||||
result = strcmp (buf, "nan NAN nan NAN nan NAN nan NAN") != 0;
|
||||
printf ("expected \"nan NAN nan NAN nan NAN nan NAN\", got \"%s\"\n", buf);
|
||||
|
||||
snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
|
||||
-nanval, -nanval, -nanval, -nanval,
|
||||
-nanval, -nanval, -nanval, -nanval);
|
||||
-qnanval, -qnanval, -qnanval, -qnanval,
|
||||
-qnanval, -qnanval, -qnanval, -qnanval);
|
||||
result = strcmp (buf, "-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
|
||||
printf ("expected \"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got \"%s\"\n",
|
||||
buf);
|
||||
|
@ -88,13 +89,14 @@ F (void)
|
|||
buf);
|
||||
|
||||
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
|
||||
nanval, nanval, nanval, nanval, nanval, nanval, nanval, nanval);
|
||||
qnanval, qnanval, qnanval, qnanval,
|
||||
qnanval, qnanval, qnanval, qnanval);
|
||||
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
|
||||
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
|
||||
|
||||
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
|
||||
-nanval, -nanval, -nanval, -nanval,
|
||||
-nanval, -nanval, -nanval, -nanval);
|
||||
-qnanval, -qnanval, -qnanval, -qnanval,
|
||||
-qnanval, -qnanval, -qnanval, -qnanval);
|
||||
result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
|
||||
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
|
||||
wbuf);
|
||||
|
@ -111,17 +113,17 @@ F (void)
|
|||
printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
|
||||
wbuf);
|
||||
|
||||
lnanval = NAN;
|
||||
lqnanval = NAN;
|
||||
|
||||
snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
|
||||
lnanval, lnanval, lnanval, lnanval,
|
||||
lnanval, lnanval, lnanval, lnanval);
|
||||
lqnanval, lqnanval, lqnanval, lqnanval,
|
||||
lqnanval, lqnanval, lqnanval, lqnanval);
|
||||
result = strcmp (buf, "nan NAN nan NAN nan NAN nan NAN") != 0;
|
||||
printf ("expected \"nan NAN nan NAN nan NAN nan NAN\", got \"%s\"\n", buf);
|
||||
|
||||
snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
|
||||
-lnanval, -lnanval, -lnanval, -lnanval,
|
||||
-lnanval, -lnanval, -lnanval, -lnanval);
|
||||
-lqnanval, -lqnanval, -lqnanval, -lqnanval,
|
||||
-lqnanval, -lqnanval, -lqnanval, -lqnanval);
|
||||
result = strcmp (buf, "-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
|
||||
printf ("expected \"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got \"%s\"\n",
|
||||
buf);
|
||||
|
@ -143,15 +145,15 @@ F (void)
|
|||
|
||||
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
|
||||
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
|
||||
lnanval, lnanval, lnanval, lnanval,
|
||||
lnanval, lnanval, lnanval, lnanval);
|
||||
lqnanval, lqnanval, lqnanval, lqnanval,
|
||||
lqnanval, lqnanval, lqnanval, lqnanval);
|
||||
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
|
||||
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
|
||||
|
||||
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
|
||||
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
|
||||
-lnanval, -lnanval, -lnanval, -lnanval,
|
||||
-lnanval, -lnanval, -lnanval, -lnanval);
|
||||
-lqnanval, -lqnanval, -lqnanval, -lqnanval,
|
||||
-lqnanval, -lqnanval, -lqnanval, -lqnanval);
|
||||
result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
|
||||
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
|
||||
wbuf);
|
||||
|
|
|
@ -39,14 +39,14 @@
|
|||
# include <endian.h>
|
||||
|
||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define __nan_bytes { 0x7f, 0xc0, 0, 0 }
|
||||
# define __qnan_bytes { 0x7f, 0xc0, 0, 0 }
|
||||
# endif
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
# define __nan_bytes { 0, 0, 0xc0, 0x7f }
|
||||
# define __qnan_bytes { 0, 0, 0xc0, 0x7f }
|
||||
# endif
|
||||
|
||||
static union { unsigned char __c[4]; float __d; } __nan_union
|
||||
__attribute__ ((__unused__)) = { __nan_bytes };
|
||||
# define NAN (__nan_union.__d)
|
||||
static union { unsigned char __c[4]; float __d; } __qnan_union
|
||||
__attribute__ ((__unused__)) = { __qnan_bytes };
|
||||
# define NAN (__qnan_union.__d)
|
||||
|
||||
#endif /* GCC. */
|
||||
|
|
|
@ -54,7 +54,7 @@ enum
|
|||
these bits is set. Note, though, that you can't disable or
|
||||
enable these exceptions individually. */
|
||||
|
||||
/* Operation with SNaN. */
|
||||
/* Operation with a sNaN. */
|
||||
FE_INVALID_SNAN =
|
||||
# define FE_INVALID_SNAN (1 << (31 - 7))
|
||||
FE_INVALID_SNAN,
|
||||
|
@ -79,7 +79,7 @@ enum
|
|||
# define FE_INVALID_IMZ (1 << (31 - 11))
|
||||
FE_INVALID_IMZ,
|
||||
|
||||
/* Comparison with NaN or SNaN. */
|
||||
/* Comparison with a NaN. */
|
||||
FE_INVALID_COMPARE =
|
||||
# define FE_INVALID_COMPARE (1 << (31 - 12))
|
||||
FE_INVALID_COMPARE,
|
||||
|
|
|
@ -116,7 +116,7 @@ enum {
|
|||
FPSCR_UX, /* underflow */
|
||||
FPSCR_ZX, /* zero divide */
|
||||
FPSCR_XX, /* inexact */
|
||||
FPSCR_VXSNAN, /* invalid operation for SNaN */
|
||||
FPSCR_VXSNAN, /* invalid operation for sNaN */
|
||||
FPSCR_VXISI, /* invalid operation for Inf-Inf */
|
||||
FPSCR_VXIDI, /* invalid operation for Inf/Inf */
|
||||
FPSCR_VXZDZ, /* invalid operation for 0/0 */
|
||||
|
@ -152,7 +152,7 @@ enum {
|
|||
#endif /* _ARCH_PWR6 */
|
||||
|
||||
/* This operation (i) sets the appropriate FPSCR bits for its
|
||||
parameter, (ii) converts SNaN to the corresponding NaN, and (iii)
|
||||
parameter, (ii) converts sNaN to the corresponding qNaN, and (iii)
|
||||
otherwise passes its parameter through unchanged (in particular, -0
|
||||
and +0 stay as they were). The `obvious' way to do this is optimised
|
||||
out by gcc. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Test Signalling NaN in isnan, isinf etc functions.
|
||||
/* Test signaling NaNs in isnan, isinf, and similar functions.
|
||||
Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Jaeger <aj@suse.de>, 2005.
|
||||
|
@ -136,19 +136,19 @@ NAME (void) \
|
|||
{ \
|
||||
/* Variables are declared volatile to forbid some compiler \
|
||||
optimizations. */ \
|
||||
volatile FLOAT Inf_var, NaN_var, zero_var, one_var, SNaN_var; \
|
||||
volatile FLOAT Inf_var, qNaN_var, zero_var, one_var, sNaN_var; \
|
||||
fenv_t saved_fenv; \
|
||||
\
|
||||
zero_var = 0.0; \
|
||||
one_var = 1.0; \
|
||||
NaN_var = zero_var / zero_var; \
|
||||
SNaN_var = snan_##FLOAT (); \
|
||||
qNaN_var = zero_var / zero_var; \
|
||||
sNaN_var = snan_##FLOAT (); \
|
||||
Inf_var = one_var / zero_var; \
|
||||
\
|
||||
(void) &zero_var; \
|
||||
(void) &one_var; \
|
||||
(void) &NaN_var; \
|
||||
(void) &SNaN_var; \
|
||||
(void) &qNaN_var; \
|
||||
(void) &sNaN_var; \
|
||||
(void) &Inf_var; \
|
||||
\
|
||||
set_sigaction_FP (); \
|
||||
|
@ -158,200 +158,200 @@ NAME (void) \
|
|||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnan(NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isnan (qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnan (NaN)", isnan (NaN_var)); \
|
||||
check (#FLOAT " isnan (qNaN)", isnan (qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnan(-NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isnan (-qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnan (-NaN)", isnan (-NaN_var)); \
|
||||
check (#FLOAT " isnan (-qNaN)", isnan (-qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnan(SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isnan (sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnan (SNaN)", isnan (SNaN_var)); \
|
||||
check (#FLOAT " isnan (sNaN)", isnan (sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnan(-SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isnan (-sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnan (-SNaN)", isnan (-SNaN_var)); \
|
||||
check (#FLOAT " isnan (-sNaN)", isnan (-sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isinf(NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isinf (qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isinf (NaN)", !isinf (NaN_var)); \
|
||||
check (#FLOAT " isinf (qNaN)", !isinf (qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isinf(-NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isinf (-qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isinf (-NaN)", !isinf (-NaN_var)); \
|
||||
check (#FLOAT " isinf (-qNaN)", !isinf (-qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isinf(SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isinf (sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isinf (SNaN)", !isinf (SNaN_var)); \
|
||||
check (#FLOAT " isinf (sNaN)", !isinf (sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isinf(-SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isinf (-sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isinf (-SNaN)", !isinf (-SNaN_var)); \
|
||||
check (#FLOAT " isinf (-sNaN)", !isinf (-sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isfinite(NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isfinite (qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isfinite (NaN)", !isfinite (NaN_var)); \
|
||||
check (#FLOAT " isfinite (qNaN)", !isfinite (qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isfinite(-NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isfinite (-qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isfinite (-NaN)", !isfinite (-NaN_var)); \
|
||||
check (#FLOAT " isfinite (-qNaN)", !isfinite (-qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isfinite(SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isfinite (sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isfinite (SNaN)", !isfinite (SNaN_var)); \
|
||||
check (#FLOAT " isfinite (sNaN)", !isfinite (sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isfinite(-SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isfinite (-sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isfinite (-SNaN)", !isfinite (-SNaN_var)); \
|
||||
check (#FLOAT " isfinite (-sNaN)", !isfinite (-sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnormal(NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isnormal (qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnormal (NaN)", !isnormal (NaN_var)); \
|
||||
check (#FLOAT " isnormal (qNaN)", !isnormal (qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnormal(-NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isnormal (-qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnormal (-NaN)", !isnormal (-NaN_var)); \
|
||||
check (#FLOAT " isnormal (-qNaN)", !isnormal (-qNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnormal(SNaN) isnormal SIGFPE\n"); \
|
||||
printf (#FLOAT " isnormal (sNaN) isnormal SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnormal (SNaN)", !isnormal (SNaN_var)); \
|
||||
check (#FLOAT " isnormal (sNaN)", !isnormal (sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " isnormal(-SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " isnormal (-sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " isnormal (-SNaN)", !isnormal (-SNaN_var)); \
|
||||
check (#FLOAT " isnormal (-sNaN)", !isnormal (-sNaN_var)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " fpclassify(NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " fpclassify (qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " fpclassify (NaN)", (fpclassify (NaN_var)==FP_NAN)); \
|
||||
check (#FLOAT " fpclassify (qNaN)", (fpclassify (qNaN_var)==FP_NAN)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " fpclassify(-NaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " fpclassify (-qNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " fpclassify (-NaN)", (fpclassify (-NaN_var)==FP_NAN)); \
|
||||
check (#FLOAT " fpclassify (-qNaN)", (fpclassify (-qNaN_var)==FP_NAN)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " fpclassify(SNaN) isnormal SIGFPE\n"); \
|
||||
printf (#FLOAT " fpclassify (sNaN) isnormal SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " fpclassify (SNaN)", (fpclassify (SNaN_var)==FP_NAN)); \
|
||||
check (#FLOAT " fpclassify (sNaN)", (fpclassify (sNaN_var)==FP_NAN)); \
|
||||
} \
|
||||
\
|
||||
feclearexcept(FE_ALL_EXCEPT); \
|
||||
feenableexcept (FE_ALL_EXCEPT); \
|
||||
if (sigsetjmp(sigfpe_buf, 0)) \
|
||||
{ \
|
||||
printf (#FLOAT " fpclassify(-SNaN) raised SIGFPE\n"); \
|
||||
printf (#FLOAT " fpclassify (-sNaN) raised SIGFPE\n"); \
|
||||
errors++; \
|
||||
} else { \
|
||||
check (#FLOAT " fpclassify (-SNaN)", (fpclassify (-SNaN_var)==FP_NAN)); \
|
||||
check (#FLOAT " fpclassify (-sNaN)", (fpclassify (-sNaN_var)==FP_NAN)); \
|
||||
} \
|
||||
\
|
||||
fesetenv(&saved_fenv); /* restore saved fenv */ \
|
||||
|
|
Loading…
Reference in New Issue