Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/include/linux Add hweight8 (hamming we...
details: https://anonhg.NetBSD.org/src/rev/f686087a6374
branches: trunk
changeset: 336322:f686087a6374
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Feb 25 15:40:20 2015 +0000
description:
Add hweight8 (hamming weight of 8-bit quantity).
diffstat:
sys/external/bsd/drm2/include/linux/bitops.h | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (21 lines):
diff -r d83da36b4f3b -r f686087a6374 sys/external/bsd/drm2/include/linux/bitops.h
--- a/sys/external/bsd/drm2/include/linux/bitops.h Wed Feb 25 15:11:07 2015 +0000
+++ b/sys/external/bsd/drm2/include/linux/bitops.h Wed Feb 25 15:40:20 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bitops.h,v 1.8 2014/08/23 08:03:33 riastradh Exp $ */
+/* $NetBSD: bitops.h,v 1.9 2015/02/25 15:40:20 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -167,4 +167,11 @@
return result;
}
+static inline unsigned
+hweight8(unsigned w)
+{
+
+ return popcount(w & 0xff);
+}
+
#endif /* _LINUX_BITOPS_H_ */
Home |
Main Index |
Thread Index |
Old Index