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
\f
#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,
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))