aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/fpu
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-09-01 15:30:12 -0700
committerUlrich Drepper <drepper@redhat.com>2009-09-01 15:30:12 -0700
commit240441038f2d2b1a32d4239270c7f76531a484f3 (patch)
tree0118c5e89428ef38129e1f3cd5d2d364ef0c51b0 /sysdeps/x86_64/fpu
parentc2735e958acc6a69daab71fdc463564860f20794 (diff)
downloadglibc-240441038f2d2b1a32d4239270c7f76531a484f3.tar
glibc-240441038f2d2b1a32d4239270c7f76531a484f3.tar.gz
glibc-240441038f2d2b1a32d4239270c7f76531a484f3.tar.bz2
glibc-240441038f2d2b1a32d4239270c7f76531a484f3.zip
Fix x86_64 bits/mathinline.h for -m32 compilation.
Diffstat (limited to 'sysdeps/x86_64/fpu')
-rw-r--r--sysdeps/x86_64/fpu/bits/mathinline.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/bits/mathinline.h b/sysdeps/x86_64/fpu/bits/mathinline.h
index ece0f02678..dc58f67d6c 100644
--- a/sysdeps/x86_64/fpu/bits/mathinline.h
+++ b/sysdeps/x86_64/fpu/bits/mathinline.h
@@ -22,6 +22,8 @@
# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
#endif
+#include <bits/wordsize.h>
+
#ifndef __extern_inline
# define __MATH_INLINE __inline
#else
@@ -35,16 +37,26 @@
__MATH_INLINE int
__NTH (__signbitf (float __x))
{
+#if __WORDSIZE == 32
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
+ return __u.__i < 0;
+#else
int __m;
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x8;
+#endif
}
__MATH_INLINE int
__NTH (__signbit (double __x))
{
+#if __WORDSIZE == 32
+ __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+ return __u.__i[1] < 0;
+#else
int __m;
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x80;
+#endif
}
__MATH_INLINE int
__NTH (__signbitl (long double __x))