aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-02-04 16:52:24 -0800
committerRichard Henderson <rth@gcc.gnu.org>2003-02-04 16:52:24 -0800
commitdfff898c2701ef3d7934c1efb88b89974770d25d (patch)
tree3cec67f0cfc96008129e3fab75a5e212b3cbd7f0 /gcc
parent0c9ed8564d0214c1f1ac18a165e9d2869a25f8d5 (diff)
downloadgcc-dfff898c2701ef3d7934c1efb88b89974770d25d.zip
gcc-dfff898c2701ef3d7934c1efb88b89974770d25d.tar.gz
gcc-dfff898c2701ef3d7934c1efb88b89974770d25d.tar.bz2
libgcc2.h, libgcc2.c (__ffsSI2): New.
* libgcc2.h, libgcc2.c (__ffsSI2): New. (__ffsDI2): Rename from __ffsdi2. * mklibgcc.in (lib2funcs): Add _ffssi2. From-SVN: r62422
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/libgcc2.c20
-rw-r--r--gcc/libgcc2.h4
-rw-r--r--gcc/mklibgcc.in6
4 files changed, 30 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 17553a3..c3f0e05 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 2801681..3736b2c 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -340,11 +340,27 @@ __ashrdi3 (DWtype u, word_type b)
}
#endif
+#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
+
#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;
diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h
index f32f4a0..876e1d5 100644
--- a/gcc/libgcc2.h
+++ b/gcc/libgcc2.h
@@ -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);
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index 74f7203..3a492da 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -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