summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-04-01 20:31:01 +0000
committerUlrich Drepper <drepper@redhat.com>2004-04-01 20:31:01 +0000
commit3c55cffa1e1b55082db0b2e56a96a0ada30710eb (patch)
tree9bbc64332e8710c2f2d18450ed85f2a34a669b7a /sysdeps
parentd980f41a7eb9bc0f887cb15369b43e57b9a77b56 (diff)
Update.
* sysdeps/powerpc/fpu/bits/mathinline.h: Addn __signbitf and __signbit inlines.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/fpu/bits/mathinline.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/sysdeps/powerpc/fpu/bits/mathinline.h b/sysdeps/powerpc/fpu/bits/mathinline.h
index 01956d9ee8..e692df9b1a 100644
--- a/sysdeps/powerpc/fpu/bits/mathinline.h
+++ b/sysdeps/powerpc/fpu/bits/mathinline.h
@@ -18,6 +18,16 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#ifndef _MATH_H
+# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif /* __cplusplus */
+
#if defined __GNUC__ && !defined _SOFT_FLOAT
#ifdef __USE_ISOC99
@@ -45,16 +55,28 @@
# define isunordered(x, y) (__unordered_cmp (x, y) & 1)
# endif /* __GNUC_PREREQ (2,97) */
+
+/* The gcc, version 2.7 or below, has problems with all this inlining
+ code. So disable it for this version of the compiler. */
+# if __GNUC_PREREQ (2, 8)
+/* Test for negative number. Used in the signbit() macro. */
+__MATH_INLINE int
+__signbitf (float __x) __THROW
+{
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
+ return __u.__i < 0;
+}
+__MATH_INLINE int
+__signbit (double __x) __THROW
+{
+ __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+ return __u.__i[0] < 0;
+}
+# endif
#endif /* __USE_ISOC99 */
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-#ifdef __cplusplus
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE extern __inline
-#endif /* __cplusplus */
-
#ifdef __USE_ISOC99
# ifndef __powerpc64__
@@ -63,7 +85,7 @@ __MATH_INLINE long int
lrint (double __x) __THROW
{
union {
- double __d;
+ double __d;
int __ll[2];
} __u;
__asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));