summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-08-19 00:32:48 +0000
committerpeter <peter@FreeBSD.org>1999-08-19 00:32:48 +0000
commit527fa149136dffd80f5b36c338b544f09df1fe10 (patch)
treeb51fa89367f347193af59cfecbac0060ad038afb /sys/amd64
parentfc24e28a1e340db2942e9ea61467cd0f63a6071f (diff)
downloadFreeBSD-src-527fa149136dffd80f5b36c338b544f09df1fe10.zip
FreeBSD-src-527fa149136dffd80f5b36c338b544f09df1fe10.tar.gz
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.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/include/cpufunc.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index c5ba2de..60928b8 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -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
OpenPOWER on IntegriCloud