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/1f61ba32710c
branches:  trunk
changeset: 806464:1f61ba32710c
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 270ee9781bea -r 1f61ba32710c 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