]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/alpha/fpu/s_isnan.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / alpha / fpu / s_isnan.c
index a9230329c57dfec0e364254f90e3a18e7460ad57..cab8e43b3802f8de64fd27dee423aae149ca2343 100644 (file)
@@ -1,5 +1,5 @@
 /* Return 1 if argument is a NaN, else 0.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
 
 /* Ugly kludge to avoid declarations.  */
 #define __isnanf       not___isnanf
 #define __GI___isnanf  not__GI___isnanf
 
 #include <math.h>
+#include <math_private.h>
 #include <math_ldbl_opt.h>
 
 #undef __isnanf
 #undef isnanf
 #undef __GI___isnanf
 
-/* The hidden_proto in include/math.h was obscured by the macro hackery.  */
-__typeof (__isnan) __isnanf;
-hidden_proto (__isnanf)
-
-
 int
 __isnan (double x)
 {
-  return isunordered (x, x);
+  uint64_t ix;
+  EXTRACT_WORDS64 (ix, x);
+  return ix * 2 > 0xffe0000000000000ul;
 }
 
 hidden_def (__isnan)
@@ -46,8 +43,11 @@ weak_alias (__isnan, isnan)
 /* It turns out that the 'double' version will also always work for
    single-precision.  */
 strong_alias (__isnan, __isnanf)
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
+weak_alias (__isnan, isnanf)
+
+/* ??? GCC 4.8 fails to look through chains of aliases with asm names
+   attached.  Work around this for now.  */
+hidden_ver (__isnan, __isnanf)
 
 #ifdef NO_LONG_DOUBLE
 strong_alias (__isnan, __isnanl)