Try using the builtin ffs() for egcs, it (by random inspection)

generates slightly better code and avoids the incl then subl when
using ffs(foo) - 1.
This commit is contained in:
Peter Wemm 1999-08-19 00:32:48 +00:00
parent ebf9e95f31
commit bb41d37104
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50038
2 changed files with 10 additions and 2 deletions

View file

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: cpufunc.h,v 1.87 1999/05/09 23:30:01 peter Exp $
* $Id: cpufunc.h,v 1.88 1999/07/23 23:45:19 alc Exp $
*/
/*
@ -84,6 +84,9 @@ enable_intr(void)
#define HAVE_INLINE_FFS
#if __GNUC__ == 2 && __GNUC_MINOR__ > 8
#define ffs(mask) __builtin_ffs(mask)
#else
static __inline int
ffs(int mask)
{
@ -102,6 +105,7 @@ ffs(int mask)
: "=r" (result) : "0" (mask));
return (result);
}
#endif
#define HAVE_INLINE_FLS

View file

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: cpufunc.h,v 1.87 1999/05/09 23:30:01 peter Exp $
* $Id: cpufunc.h,v 1.88 1999/07/23 23:45:19 alc Exp $
*/
/*
@ -84,6 +84,9 @@ enable_intr(void)
#define HAVE_INLINE_FFS
#if __GNUC__ == 2 && __GNUC_MINOR__ > 8
#define ffs(mask) __builtin_ffs(mask)
#else
static __inline int
ffs(int mask)
{
@ -102,6 +105,7 @@ ffs(int mask)
: "=r" (result) : "0" (mask));
return (result);
}
#endif
#define HAVE_INLINE_FLS