zephyr/doc
Emil Gydesen d05de070db include: util: Add generic function to count bits set in a value
Adds a generic function that will count the number of bits set in
a value.

It uses POPCOUNT (e.g. __builtin_popcount for GCC) if available,
or else it will use Brian Kernighan’s Algorithm to count bits.

POPCOUNT will likely always support unsigned ints, but the function
was implemented to use it with uint8_t for the sake of simplicity
and compatibility with Brian Kernighan’s Algorithm.

A generic solution was chosen rather than a macro/function per
type (e.g. uint8_t, uint16_t, etc.) as that is easier to maintain
and also supports array types (e.g. counting the number of bits
in 128 or 256 octet arrays).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-17 21:03:56 -04:00
..
_doxygen doc: kernel: define additional doxygen groups 2024-09-17 05:24:09 -04:00
_extensions/zephyr doc: _extensions: handle custom bindings in board catalog 2025-03-17 20:04:10 +01:00
_scripts doc: _extensions: handle custom bindings in board catalog 2025-03-17 20:04:10 +01:00
_static doc: make graphviz diagrams look good in dark theme 2025-03-05 00:15:37 +00:00
_templates doc: enable three-way dark-mode switch 2024-10-16 16:33:24 +01:00
build scripts: kconfig: introduce dt_nodelabel_exists 2025-03-11 18:54:57 +01:00
connectivity Bluetooth: CSIP: Rename BT_CSIP_SET_MEMBER_NOTIFIABLE 2025-03-13 16:56:14 +00:00
contribute doc: extensions: Add line reference support to zephyr_file/zephyr_module 2025-02-28 10:10:47 +01:00
develop doc: update Rust documentation to say support Rust instead of CMake 2025-03-15 00:36:11 +01:00
hardware kscan: drop kscan and any reference 2025-03-13 16:56:26 +00:00
images
introduction doc: clarify what a subsystem is 2024-05-14 10:55:55 +02:00
kernel kernel: rename 'dumb' scheduler and simply call it 'simple' 2025-03-15 00:34:58 +01:00
project doc: review: switch labels to a definition list 2025-01-22 18:33:06 +01:00
releases include: util: Add generic function to count bits set in a value 2025-03-17 21:03:56 -04:00
safety doc: coding guidelines: move safety related language to saftey section 2025-01-18 02:33:02 +01:00
security doc: security: Disclose CVE-2025-1675 2025-02-27 08:01:08 +01:00
services kscan: drop kscan and any reference 2025-03-13 16:56:26 +00:00
templates doc: boards: extensions: add Sphinx directive for board supported hardware 2025-02-21 04:47:17 +01:00
404.rst
CMakeLists.txt doc: extensions: boards: Add hardware features filter to board catalog 2025-02-20 15:08:50 +00:00
conf.py doc: release: add v4.1.0 to the list of supported releases 2025-03-07 17:34:55 +00:00
glossary.rst doc: sphinx-lint: fix bad usage of "default role" 2024-09-13 11:42:51 -05:00
index-tex.rst
index.rst doc: reorder tiles 2024-12-25 12:41:09 +01:00
kconfig.rst
LICENSING.rst doc: LICENSING: Add BSD-3-clause for python-devicetree test files 2025-03-05 19:05:19 +00:00
Makefile doc: extensions: boards: Add hardware features filter to board catalog 2025-02-20 15:08:50 +00:00
requirements.txt doc: ci: pin to Sphinx < 8.2.0 2025-02-21 18:35:44 +00:00
substitutions.txt
zephyr.doxyfile.in fs: zms: multiple style fixes from previous PR review 2025-02-21 11:29:50 +00:00