#include <bit>
#include <cstdint>
#include <iostream>
Go to the source code of this file.
|
| template<size_t Words> |
| uint64_t | pasta::popcount (uint64_t const *const buffer) |
| | Compute popcount of a specific number of 64-bit words.
|
| |
| template<size_t Words> |
| uint64_t | pasta::popcount_zeros (uint64_t const *const buffer) |
| | Counts the number of zero bits in a specific number of 64-bit words.
|
| |
◆ popcount()
template<size_t Words>
| uint64_t pasta::popcount |
( |
uint64_t const *const | buffer | ) |
|
|
nodiscard |
Compute popcount of a specific number of 64-bit words.
Note that there are no bound checks.
- Template Parameters
-
| Words | Number of 64-bit words the popcount is computed for. |
- Parameters
-
| buffer | Pointer to the beginning of the 64-bit words. |
- Returns
- Popcount of the
Words * 64 bits starting at buffer.
◆ popcount_zeros()
template<size_t Words>
| uint64_t pasta::popcount_zeros |
( |
uint64_t const *const | buffer | ) |
|
|
nodiscard |
Counts the number of zero bits in a specific number of 64-bit words.
Note that there are no bound checks.
- Template Parameters
-
| Words | Number of 64-bit words the zeros are counted in. |
- Parameters
-
| buffer | Pointer to the beginning of the 64-bit words. |
- Returns
- Number of zeros in the
Words * 64 bits starting at buffer.