OSDN Git Service

* libgcc2.h, libgcc2.c (__ffsSI2): New.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Feb 2003 00:52:24 +0000 (00:52 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Feb 2003 00:52:24 +0000 (00:52 +0000)
        (__ffsDI2): Rename from __ffsdi2.
        * mklibgcc.in (lib2funcs): Add _ffssi2.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62422 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/libgcc2.c
gcc/libgcc2.h
gcc/mklibgcc.in

index 17553a3..c3f0e05 100644 (file)
@@ -1,5 +1,11 @@
 2003-02-04  Richard Henderson  <rth@redhat.com>
 
+       * libgcc2.h, libgcc2.c (__ffsSI2): New.
+       (__ffsDI2): Rename from __ffsdi2.
+       * mklibgcc.in (lib2funcs): Add _ffssi2.
+
+2003-02-04  Richard Henderson  <rth@redhat.com>
+
        * libgcc2.c (__paritysi2, __paritydi2): Replace last two reduction
        rounds with a "bit table" lookup.
 
index 2801681..3736b2c 100644 (file)
@@ -340,11 +340,27 @@ __ashrdi3 (DWtype u, word_type b)
 }
 #endif
 \f
+#ifdef L_ffssi2
+#undef int
+extern int __ffsSI2 (UWtype u);
+int
+__ffsSI2 (UWtype u)
+{
+  UWtype count;
+
+  if (u == 0)
+    return 0;
+
+  count_trailing_zeros (count, u);
+  return count + 1;
+}
+#endif
+\f
 #ifdef L_ffsdi2
 #undef int
-extern int __ffsdi2 (DWtype u);
+extern int __ffsDI2 (DWtype u);
 int
-__ffsdi2 (DWtype u)
+__ffsDI2 (DWtype u)
 {
   DWunion uu;
   UWtype word, count, add;
index f32f4a0..876e1d5 100644 (file)
@@ -182,7 +182,6 @@ typedef int word_type __attribute__ ((mode (__word__)));
 #define __lshrdi3      __NDW(lshr,3)
 #define __ashldi3      __NDW(ashl,3)
 #define __ashrdi3      __NDW(ashr,3)
-#define __ffsdi2       __NDW(ffs,2)
 #define __cmpdi2       __NDW(cmp,2)
 #define __ucmpdi2      __NDW(ucmp,2)
 #define __udivmoddi4   __NDW(udivmod,4)
@@ -203,6 +202,9 @@ typedef int word_type __attribute__ ((mode (__word__)));
 #define __fixunsdfSI   __NW(fixunsdf,)
 #define __fixunssfSI   __NW(fixunssf,)
 
+#define __ffsSI2       __NW(ffs,2)
+#define __ffsDI2       __NDW(ffs,2)
+
 extern DWtype __muldi3 (DWtype, DWtype);
 extern DWtype __divdi3 (DWtype, DWtype);
 extern UDWtype __udivdi3 (UDWtype, UDWtype);
index 74f7203..3a492da 100644 (file)
@@ -44,14 +44,14 @@ echo 'force:'
 echo
 
 # Library members defined in libgcc2.c.
-lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz
+lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
        _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
        _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
        _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
        _trampoline __main _exit _absvsi2 _absvdi2 _addvsi3 _addvdi3
        _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
-       _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2
-       _popcountdi2 _paritysi2 _paritydi2'
+       _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
+       _popcountsi2 _popcountdi2 _paritysi2 _paritydi2'
 
 # Disable SHLIB_LINK if shared libgcc not enabled.
 if [ "@enable_shared@" = "no" ]; then