]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
m68k: define __signbit inlines
authorAndreas Schwab <schwab@linux-m68k.org>
Sat, 13 Mar 2010 15:59:42 +0000 (16:59 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Sat, 13 Mar 2010 15:59:42 +0000 (16:59 +0100)
ChangeLog.m68k
sysdeps/m68k/m680x0/fpu/bits/mathinline.h

index b16fde2e50bfe0ba17cedc4f4d300b62edb727f2..1c8d232365512b52e8a92826b96ddcda84e1b9f0 100644 (file)
@@ -1,5 +1,8 @@
 2010-03-13  Andreas Schwab  <schwab@linux-m68k.org>
 
+       * sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__signbit)
+       (__signbitf, __signbitl): Define.
+
        * sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER):
        Add variant for USE__THREAD.
 
index 6b69f7a493f847843f5de5d8c06a50a59173db66..0da98e40ca123f965c5da0627c1c490bf3db8593 100644 (file)
@@ -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.
 
               : "=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