svn commit: r261891 - in head/sys: amd64/include conf i386/include

Andriy Gapon avg at FreeBSD.org
Fri Feb 14 15:18:40 UTC 2014


Author: avg
Date: Fri Feb 14 15:18:37 2014
New Revision: 261891
URL: http://svnweb.freebsd.org/changeset/base/261891

Log:
  provide fast versions of ffsl and flsl for i386; ffsll and flsll for amd64
  
  Reviewed by:	jhb
  MFC after:	10 days
  X-MFC note:	consider thirdparty modules depending on these symbols
  Sponsored by:	HybridCluster

Modified:
  head/sys/amd64/include/cpufunc.h
  head/sys/conf/files
  head/sys/conf/files.arm
  head/sys/conf/files.i386
  head/sys/conf/files.ia64
  head/sys/conf/files.mips
  head/sys/conf/files.pc98
  head/sys/conf/files.powerpc
  head/sys/conf/files.sparc64
  head/sys/i386/include/cpufunc.h

Modified: head/sys/amd64/include/cpufunc.h
==============================================================================
--- head/sys/amd64/include/cpufunc.h	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/amd64/include/cpufunc.h	Fri Feb 14 15:18:37 2014	(r261891)
@@ -154,6 +154,14 @@ ffsl(long mask)
 	return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1);
 }
 
+#define	HAVE_INLINE_FFSLL
+
+static __inline int
+ffsll(long long mask)
+{
+	return (ffsl((long)mask));
+}
+
 #define	HAVE_INLINE_FLS
 
 static __inline int
@@ -170,6 +178,14 @@ flsl(long mask)
 	return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1);
 }
 
+#define	HAVE_INLINE_FLSLL
+
+static __inline int
+flsll(long long mask)
+{
+	return (flsl((long)mask));
+}
+
 #endif /* _KERNEL */
 
 static __inline void

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files	Fri Feb 14 15:18:37 2014	(r261891)
@@ -3025,7 +3025,6 @@ libkern/arc4random.c		standard
 libkern/bcd.c			standard
 libkern/bsearch.c		standard
 libkern/crc32.c			standard
-libkern/flsll.c                 standard
 libkern/fnmatch.c		standard
 libkern/iconv.c			optional libiconv
 libkern/iconv_converter_if.m	optional libiconv

Modified: head/sys/conf/files.arm
==============================================================================
--- head/sys/conf/files.arm	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files.arm	Fri Feb 14 15:18:37 2014	(r261891)
@@ -89,6 +89,7 @@ libkern/divdi3.c		standard
 libkern/ffsl.c			standard
 libkern/fls.c			standard
 libkern/flsl.c			standard
+libkern/flsll.c			standard
 libkern/lshrdi3.c		standard
 libkern/moddi3.c		standard
 libkern/qdivrem.c		standard

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files.i386	Fri Feb 14 15:18:37 2014	(r261891)
@@ -536,8 +536,7 @@ kern/kern_clocksource.c		standard
 kern/imgact_aout.c		optional compat_aout
 kern/imgact_gzip.c		optional gzip
 libkern/divdi3.c		standard
-libkern/ffsl.c			standard
-libkern/flsl.c			standard
+libkern/flsll.c			standard
 libkern/memmove.c		standard
 libkern/memset.c		standard
 libkern/moddi3.c		standard

Modified: head/sys/conf/files.ia64
==============================================================================
--- head/sys/conf/files.ia64	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files.ia64	Fri Feb 14 15:18:37 2014	(r261891)
@@ -120,6 +120,7 @@ libkern/bcmp.c			standard
 libkern/ffsl.c			standard
 libkern/fls.c			standard
 libkern/flsl.c			standard
+libkern/flsll.c			standard
 libkern/ia64/__divdi3.S		standard
 libkern/ia64/__divsi3.S		standard
 libkern/ia64/__moddi3.S		standard

Modified: head/sys/conf/files.mips
==============================================================================
--- head/sys/conf/files.mips	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files.mips	Fri Feb 14 15:18:37 2014	(r261891)
@@ -56,6 +56,7 @@ kern/subr_dummy_vdso_tc.c		standard
 libkern/ffsl.c				standard
 libkern/fls.c				standard
 libkern/flsl.c				standard
+libkern/flsll.c				standard
 libkern/memmove.c			standard
 libkern/cmpdi2.c			optional	mips | mipsel
 libkern/ucmpdi2.c			optional	mips | mipsel

Modified: head/sys/conf/files.pc98
==============================================================================
--- head/sys/conf/files.pc98	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files.pc98	Fri Feb 14 15:18:37 2014	(r261891)
@@ -208,8 +208,7 @@ kern/kern_clocksource.c		standard
 kern/imgact_aout.c		optional compat_aout
 kern/imgact_gzip.c		optional gzip
 libkern/divdi3.c		standard
-libkern/ffsl.c			standard
-libkern/flsl.c			standard
+libkern/flsll.c			standard
 libkern/memmove.c		standard
 libkern/memset.c		standard
 libkern/moddi3.c		standard

Modified: head/sys/conf/files.powerpc
==============================================================================
--- head/sys/conf/files.powerpc	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files.powerpc	Fri Feb 14 15:18:37 2014	(r261891)
@@ -80,6 +80,7 @@ libkern/ffs.c			standard
 libkern/ffsl.c			standard
 libkern/fls.c			standard
 libkern/flsl.c			standard
+libkern/flsll.c			standard
 libkern/lshrdi3.c		optional	powerpc
 libkern/memmove.c		standard
 libkern/memset.c		standard

Modified: head/sys/conf/files.sparc64
==============================================================================
--- head/sys/conf/files.sparc64	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/conf/files.sparc64	Fri Feb 14 15:18:37 2014	(r261891)
@@ -68,6 +68,7 @@ libkern/ffs.c			standard
 libkern/ffsl.c			standard
 libkern/fls.c			standard
 libkern/flsl.c			standard
+libkern/flsll.c			standard
 libkern/memmove.c		standard
 sparc64/central/central.c	optional	central
 sparc64/ebus/ebus.c		optional	ebus

Modified: head/sys/i386/include/cpufunc.h
==============================================================================
--- head/sys/i386/include/cpufunc.h	Fri Feb 14 15:03:55 2014	(r261890)
+++ head/sys/i386/include/cpufunc.h	Fri Feb 14 15:18:37 2014	(r261891)
@@ -184,6 +184,14 @@ ffs(int mask)
 	 return (mask == 0 ? mask : (int)bsfl((u_int)mask) + 1);
 }
 
+#define	HAVE_INLINE_FFSL
+
+static __inline int
+ffsl(long mask)
+{
+	return (ffs((int)mask));
+}
+
 #define	HAVE_INLINE_FLS
 
 static __inline int
@@ -192,6 +200,14 @@ fls(int mask)
 	return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
 }
 
+#define	HAVE_INLINE_FLSL
+
+static __inline int
+flsl(long mask)
+{
+	return (fls((int)mask));
+}
+
 #endif /* _KERNEL */
 
 static __inline void


More information about the svn-src-head mailing list