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> 2000-10-05 Richard Henderson <rth@cygnus.com>
* config/alpha/alpha.c (alpha_emit_setcc): Don't swap GT tests * 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. # Library members defined in libgcc2.c.
LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \ LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
_lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \ _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz \
_udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \ _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
_fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \ _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
_fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \

View File

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

View File

@ -299,12 +299,6 @@ typedef union
DWtype ll; DWtype ll;
} DWunion; } 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" #include "longlong.h"
#endif /* udiv or mul */
#endif /* __LIBGCC2_H__ */ #endif /* __LIBGCC2_H__ */