Makefile.in (LIB2FUNCS): Add _clz.

* Makefile.in (LIB2FUNCS): Add _clz.
        * libgcc2.c (__ffsdi2): Use count_trailing_zeros.
        (__clz_tab): Put in its own unit, non-static.
        * libgcc2.h: Always include longlong.h.

From-SVN: r36744
This commit is contained in:
Richard Henderson 2000-10-05 22:29:56 -07:00 committed by Richard Henderson
parent c74fa144ca
commit d6eacd4836
4 changed files with 25 additions and 21 deletions

View File

@ -1,3 +1,10 @@
2000-10-05 Richard Henderson <rth@cygnus.com>
* Makefile.in (LIB2FUNCS): Add _clz.
* libgcc2.c (__ffsdi2): Use count_trailing_zeros.
(__clz_tab): Put in its own unit, non-static.
* libgcc2.h: Always include longlong.h.
2000-10-05 Richard Henderson <rth@cygnus.com>
* config/alpha/alpha.c (alpha_emit_setcc): Don't swap GT tests

View File

@ -738,7 +738,7 @@ LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
# Library members defined in libgcc2.c.
LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
_lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
_lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz \
_udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
_fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
_fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \

View File

@ -165,19 +165,19 @@ __ashrdi3 (DWtype u, word_type b)
DWtype
__ffsdi2 (DWtype u)
{
DWunion uu, w;
DWunion uu;
UWtype word, count, add;
uu.ll = u;
w.s.high = 0;
w.s.low = ffs (uu.s.low);
if (w.s.low != 0)
return w.ll;
w.s.low = ffs (uu.s.high);
if (w.s.low != 0)
{
w.s.low += BITS_PER_UNIT * sizeof (Wtype);
return w.ll;
}
return w.ll;
if (uu.s.low != 0)
word = uu.s.low, add = 0;
else if (uu.s.high != 0)
word = uu.s.high, add = BITS_PER_UNIT * sizeof (Wtype);
else
return 0;
count_trailing_zeros (count, word);
return count + add + 1;
}
#endif
@ -315,8 +315,8 @@ __udiv_w_sdiv (UWtype *rp __attribute__ ((__unused__)),
#define L_udivmoddi4
#endif
#ifdef L_udivmoddi4
static const UQItype __clz_tab[] =
#ifdef L_clz
const UQItype __clz_tab[] =
{
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
@ -327,6 +327,9 @@ static const UQItype __clz_tab[] =
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
};
#endif
#ifdef L_udivmoddi4
#if (defined (L_udivdi3) || defined (L_divdi3) || \
defined (L_umoddi3) || defined (L_moddi3))

View File

@ -299,12 +299,6 @@ typedef union
DWtype ll;
} DWunion;
#if (defined (L_udivmoddi4) || defined (L_muldi3) || defined (L_udiv_w_sdiv)\
|| defined (L_divdi3) || defined (L_udivdi3) \
|| defined (L_moddi3) || defined (L_umoddi3))
#include "longlong.h"
#endif /* udiv or mul */
#endif /* __LIBGCC2_H__ */