summaryrefslogtreecommitdiff
path: root/sysdeps/m68k/m680x0
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2010-03-13 16:59:42 +0100
committerAndreas Schwab <schwab@linux-m68k.org>2010-03-13 16:59:42 +0100
commit326a03edf9a702f60ea2116364d8177dc682b9a5 (patch)
tree096ea7f832282d7e1bf5ddd7b40ef1cecb4b8a93 /sysdeps/m68k/m680x0
parentdbd0094b3f71213bc178cd1946496defbedb1d62 (diff)
downloadglibc-326a03edf9a702f60ea2116364d8177dc682b9a5.tar.gz
m68k: define __signbit inlines
Diffstat (limited to 'sysdeps/m68k/m680x0')
-rw-r--r--sysdeps/m68k/m680x0/fpu/bits/mathinline.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index 6b69f7a493..0da98e40ca 100644
--- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Definitions of inline math functions implemented by the m68881/2.
- Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008
+ Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -85,6 +85,26 @@
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# endif /* GCC 3.1 */
+
+/* Test for negative number. Used in the signbit() macro. */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
+{
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
+ return __u.__i < 0;
+}
+__MATH_INLINE int
+__NTH (__signbit (double __x))
+{
+ __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+ return __u.__i[0] < 0;
+}
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+ __extension__ union { long double __d; int __i[3]; } __u = { __d: __x };
+ return __u.__i[0] < 0;
+}
#endif