]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
alpha: Fix isnan
authorRichard Henderson <rth@twiddle.net>
Tue, 1 Jul 2014 15:27:49 +0000 (08:27 -0700)
committerRichard Henderson <rth@twiddle.net>
Tue, 1 Jul 2014 16:54:29 +0000 (09:54 -0700)
The isunordered formulation raises SIGFPE for SNaN.

ChangeLog
sysdeps/alpha/fpu/bits/mathinline.h
sysdeps/alpha/fpu/s_isnan.c

index 39b6b54c26a3eb1981ce6e1565955b9b82c1e354..a079a18d7e79042ac5869b48cd329d0aab1fb0bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-07-01  Richard henderson  <rth@redhat.com>
 
+       * sysdeps/alpha/fpu/bits/mathinline.h (__isnanf): Remove.
+       (__isnan, __isnanl): Remove.
+       * sysdeps/alpha/fpu/s_isnan.c (__isnan): Use integer arithmetic.
+
        * sysdeps/alpha/fpu/libm-test-ulps: Update.
 
 2014-07-01  Stefan Liebler  <stli@linux.vnet.ibm.com>
index 3d64b56107134944673cf449acf3fbbfe387822c..83f3b4ad0a258a5c197a83acebd17f86a699235c 100644 (file)
@@ -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 */
index adfb4ccf364622fea36fe765c5855f05b89bc271..d664f0cb10ba0565104c410b1e73da31ebe69b53 100644 (file)
@@ -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)