about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/math_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/fpu/math_private.h')
-rw-r--r--sysdeps/x86_64/fpu/math_private.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 4be753654a..37357d317a 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -56,3 +56,24 @@ do {								\
 } while (0)
 
 #endif
+
+#define __isnan(d) \
+  ({ long int __di; EXTRACT_WORDS64 (__di, d);				      \
+     (__di & 0x7fffffffffffffffl) > 0x7ff0000000000000l; })
+#define __isnanf(d) \
+  ({ int __di; GET_FLOAT_WORD (__di, d);				      \
+     (__di & 0x7fffffff) > 0x7f800000; })
+
+#define __isinf_ns(d) \
+  ({ long int __di; EXTRACT_WORDS64 (__di, d);				      \
+     (__di & 0x7fffffffffffffffl) == 0x7ff0000000000000l; })
+#define __isinf_nsf(d) \
+  ({ int __di; GET_FLOAT_WORD (__di, d);				      \
+     (__di & 0x7fffffff) == 0x7f800000; })
+
+#define __finite(d) \
+  ({ long int __di; EXTRACT_WORDS64 (__di, d);				      \
+     (__di & 0x7fffffffffffffffl) < 0x7ff0000000000000l; })
+#define __finitef(d) \
+  ({ int __di; GET_FLOAT_WORD (__di, d);				      \
+     (__di & 0x7fffffff) < 0x7f800000; })