E.V.E
v2023.02.15

◆ countr_zero

eve::countr_zero = {}
inlineconstexpr

Computes the number of consecutive 0 in a value starting from right.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T countr_zero(T x) noexcept;
}
constexpr callable_countr_zero_ countr_zero
Computes the number of consecutive 0 in a value starting from right.
Definition: countr_zero.hpp:51
Definition: abi.hpp:18

Parameters

Return value

The value of the number of consecutive 0 ("zero") bits in the value of x, starting from the least significant bit ("right"), with same type as x, is returned.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_it pi = {14, 1, 3, 0};
std::cout << "---- simd" << '\n'
<< "<- pi = " << pi << '\n'
<< "-> countr_zero(pi) = " << eve::countr_zero(pi) << '\n';
std::uint32_t xf = 48;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> countr_zero(xf) = " << eve::countr_zero(xf) << '\n';
return 0;
}
constexpr callable_pi_ pi
Callable object computing the constant .
Definition: pi.hpp:49
Wrapper for SIMD registers.
Definition: wide.hpp:65