diff --git a/ChangeLog.m68k b/ChangeLog.m68k index b16fde2e50..1c8d232365 100644 --- a/ChangeLog.m68k +++ b/ChangeLog.m68k @@ -1,5 +1,8 @@ 2010-03-13 Andreas Schwab + * 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. 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