summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2015-10-23 10:05:43 +0000
committeravg <avg@FreeBSD.org>2015-10-23 10:05:43 +0000
commitbef317767a95df3d2c01aeedba0ec877e4757e3f (patch)
treef5eaaf2cdb2b652e900c3d0877153a96453222d4 /sys/amd64
parent608734213072334d2243ad8a29c1f68641582e58 (diff)
downloadFreeBSD-src-bef317767a95df3d2c01aeedba0ec877e4757e3f.zip
FreeBSD-src-bef317767a95df3d2c01aeedba0ec877e4757e3f.tar.gz
MFC r261891: provide fast versions of ffsl and flsl for i386; ffsll and
flsll for amd64
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/include/cpufunc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 5f8197b..7464739 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -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
OpenPOWER on IntegriCloud