svn commit: r363633 - stable/12/sys/amd64/include

Mateusz Guzik mjg at FreeBSD.org
Tue Jul 28 07:04:47 UTC 2020


Author: mjg
Date: Tue Jul 28 07:04:46 2020
New Revision: 363633
URL: https://svnweb.freebsd.org/changeset/base/363633

Log:
  MFC r363242:
  
      amd64: patch ffsl to use the compiler builtin

Modified:
  stable/12/sys/amd64/include/cpufunc.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/include/cpufunc.h
==============================================================================
--- stable/12/sys/amd64/include/cpufunc.h	Tue Jul 28 04:58:01 2020	(r363632)
+++ stable/12/sys/amd64/include/cpufunc.h	Tue Jul 28 07:04:46 2020	(r363633)
@@ -167,7 +167,8 @@ enable_intr(void)
 static __inline __pure2 int
 ffsl(long mask)
 {
-	return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1);
+
+	return (__builtin_ffsl(mask));
 }
 
 #define	HAVE_INLINE_FFSLL


More information about the svn-src-all mailing list