E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ popcount

auto eve::popcount = functor<popcount_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
constexpr auto popcount(unsigned_value auto x) noexcept;
}
The concept unsigned_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:84
constexpr auto popcount
elementwise_callable object computing elementwise the number of bits set in the parameter.
Definition popcount.hpp:61
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

The value of number of bits set in the value x is returned.

Example

// revision 0
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wu0{0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
std::cout << "<- wu0 = " << wu0 << "\n";
std::cout << "-> popcount(wu0) = " << eve::popcount(wu0) << "\n";
}
Wrapper for SIMD registers.
Definition wide.hpp:70