mirror of git://sourceware.org/git/glibc.git
Fix x86_64 bits/mathinline.h for -m32 compilation.
This commit is contained in:
parent
c2735e958a
commit
240441038f
|
@ -1,3 +1,8 @@
|
||||||
|
2009-09-01 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/x86_64/fpu/bits/mathinline.h: Include bits/wordsize.h.
|
||||||
|
(__signbitf, __signbit): Only use SSE inline asm for 64-bit.
|
||||||
|
|
||||||
2009-08-31 Andreas Schwab <schwab@redhat.com>
|
2009-08-31 Andreas Schwab <schwab@redhat.com>
|
||||||
|
|
||||||
* sysdeps/x86_64/fpu/bits/mathinline.h: Use __asm instead of asm.
|
* sysdeps/x86_64/fpu/bits/mathinline.h: Use __asm instead of asm.
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
|
# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <bits/wordsize.h>
|
||||||
|
|
||||||
#ifndef __extern_inline
|
#ifndef __extern_inline
|
||||||
# define __MATH_INLINE __inline
|
# define __MATH_INLINE __inline
|
||||||
#else
|
#else
|
||||||
|
@ -35,16 +37,26 @@
|
||||||
__MATH_INLINE int
|
__MATH_INLINE int
|
||||||
__NTH (__signbitf (float __x))
|
__NTH (__signbitf (float __x))
|
||||||
{
|
{
|
||||||
|
#if __WORDSIZE == 32
|
||||||
|
__extension__ union { float __f; int __i; } __u = { __f: __x };
|
||||||
|
return __u.__i < 0;
|
||||||
|
#else
|
||||||
int __m;
|
int __m;
|
||||||
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
|
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
|
||||||
return __m & 0x8;
|
return __m & 0x8;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
__MATH_INLINE int
|
__MATH_INLINE int
|
||||||
__NTH (__signbit (double __x))
|
__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;
|
int __m;
|
||||||
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
|
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
|
||||||
return __m & 0x80;
|
return __m & 0x80;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
__MATH_INLINE int
|
__MATH_INLINE int
|
||||||
__NTH (__signbitl (long double __x))
|
__NTH (__signbitl (long double __x))
|
||||||
|
|
Loading…
Reference in New Issue