mirror of git://sourceware.org/git/glibc.git
* soft-fp/op-common.h (__FP_CLZ): Define using __builtin_clz,
__builtin_clzl and __builtin_clzll.
This commit is contained in:
parent
d719443fee
commit
0d86378f95
|
|
@ -1,3 +1,8 @@
|
||||||
|
2005-12-04 Joseph S. Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* soft-fp/op-common.h (__FP_CLZ): Define using __builtin_clz,
|
||||||
|
__builtin_clzl and __builtin_clzll.
|
||||||
|
|
||||||
2005-01-05 Mike Frysinger <vapier@gentoo.org>
|
2005-01-05 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* include/alloca.h (extend_alloca): Fix typoed name 'extern_alloca'.
|
* include/alloca.h (extend_alloca): Fix typoed name 'extern_alloca'.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/* Software floating-point emulation. Common operations.
|
/* Software floating-point emulation. Common operations.
|
||||||
Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
|
Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Richard Henderson (rth@cygnus.com),
|
Contributed by Richard Henderson (rth@cygnus.com),
|
||||||
Jakub Jelinek (jj@ultra.linux.cz),
|
Jakub Jelinek (jj@ultra.linux.cz),
|
||||||
|
|
@ -725,40 +725,18 @@ do { \
|
||||||
/* Count leading zeros in a word. */
|
/* Count leading zeros in a word. */
|
||||||
|
|
||||||
#ifndef __FP_CLZ
|
#ifndef __FP_CLZ
|
||||||
#if _FP_W_TYPE_SIZE < 64
|
/* GCC 3.4 and later provide the builtins for us. */
|
||||||
/* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */
|
#define __FP_CLZ(r, x) \
|
||||||
#define __FP_CLZ(r, x) \
|
do { \
|
||||||
do { \
|
if (sizeof (_FP_W_TYPE) == sizeof (unsigned int)) \
|
||||||
_FP_W_TYPE _t = (x); \
|
r = __builtin_clz (x); \
|
||||||
r = _FP_W_TYPE_SIZE - 1; \
|
else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long)) \
|
||||||
if (_t > 0xffff) r -= 16; \
|
r = __builtin_clzl (x); \
|
||||||
if (_t > 0xffff) _t >>= 16; \
|
else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long long)) \
|
||||||
if (_t > 0xff) r -= 8; \
|
r = __builtin_clzll (x); \
|
||||||
if (_t > 0xff) _t >>= 8; \
|
else \
|
||||||
if (_t & 0xf0) r -= 4; \
|
abort (); \
|
||||||
if (_t & 0xf0) _t >>= 4; \
|
|
||||||
if (_t & 0xc) r -= 2; \
|
|
||||||
if (_t & 0xc) _t >>= 2; \
|
|
||||||
if (_t & 0x2) r -= 1; \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
#else /* not _FP_W_TYPE_SIZE < 64 */
|
|
||||||
#define __FP_CLZ(r, x) \
|
|
||||||
do { \
|
|
||||||
_FP_W_TYPE _t = (x); \
|
|
||||||
r = _FP_W_TYPE_SIZE - 1; \
|
|
||||||
if (_t > 0xffffffff) r -= 32; \
|
|
||||||
if (_t > 0xffffffff) _t >>= 32; \
|
|
||||||
if (_t > 0xffff) r -= 16; \
|
|
||||||
if (_t > 0xffff) _t >>= 16; \
|
|
||||||
if (_t > 0xff) r -= 8; \
|
|
||||||
if (_t > 0xff) _t >>= 8; \
|
|
||||||
if (_t & 0xf0) r -= 4; \
|
|
||||||
if (_t & 0xf0) _t >>= 4; \
|
|
||||||
if (_t & 0xc) r -= 2; \
|
|
||||||
if (_t & 0xc) _t >>= 2; \
|
|
||||||
if (_t & 0x2) r -= 1; \
|
|
||||||
} while (0)
|
|
||||||
#endif /* not _FP_W_TYPE_SIZE < 64 */
|
|
||||||
#endif /* ndef __FP_CLZ */
|
#endif /* ndef __FP_CLZ */
|
||||||
|
|
||||||
#define _FP_DIV_HELP_imm(q, r, n, d) \
|
#define _FP_DIV_HELP_imm(q, r, n, d) \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue