aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/alpha/fpu
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-07-01 08:27:49 -0700
committerRichard Henderson <rth@twiddle.net>2014-07-01 09:54:29 -0700
commit631021e0aaefbf9fde4b4472e4ec1d51fffb9bbd (patch)
treeadbde954b9fc983591973944e92dbedd5aafaad8 /sysdeps/alpha/fpu
parenta1ac3184fad4e7f28a85dee91825fc85bfaef89a (diff)
downloadglibc-631021e0aaefbf9fde4b4472e4ec1d51fffb9bbd.zip
glibc-631021e0aaefbf9fde4b4472e4ec1d51fffb9bbd.tar.gz
glibc-631021e0aaefbf9fde4b4472e4ec1d51fffb9bbd.tar.bz2
alpha: Fix isnan
The isunordered formulation raises SIGFPE for SNaN.
Diffstat (limited to 'sysdeps/alpha/fpu')
-rw-r--r--sysdeps/alpha/fpu/bits/mathinline.h23
-rw-r--r--sysdeps/alpha/fpu/s_isnan.c4
2 files changed, 3 insertions, 24 deletions
diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
index 3d64b56..83f3b4a 100644
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ b/sysdeps/alpha/fpu/bits/mathinline.h
@@ -120,29 +120,6 @@ __NTH (__signbitl (long double __x))
return __builtin_signbitl (__x);
#endif
}
-
-/* Test for NaN. Used in the isnan() macro. */
-
-__MATH_INLINE int
-__NTH (__isnanf (float __x))
-{
- return isunordered (__x, __x);
-}
-
-__MATH_INLINE int
-__NTH (__isnan (double __x))
-{
- return isunordered (__x, __x);
-}
-
-#ifndef __NO_LONG_DOUBLE_MATH
-__MATH_INLINE int
-__NTH (__isnanl (long double __x))
-{
- return isunordered (__x, __x);
-}
-#endif
-
#endif /* C99 */
#endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/alpha/fpu/s_isnan.c b/sysdeps/alpha/fpu/s_isnan.c
index adfb4cc..d664f0c 100644
--- a/sysdeps/alpha/fpu/s_isnan.c
+++ b/sysdeps/alpha/fpu/s_isnan.c
@@ -31,7 +31,9 @@
int
__isnan (double x)
{
- return isunordered (x, x);
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, x);
+ return ix * 2 > 0xffe0000000000000ul;
}
hidden_def (__isnan)