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

◆ countr_zero

auto eve::countr_zero = functor<countr_zero_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto countr_zero(unsigned_value auto x) noexcept; // 1
// Lanes masking
constexpr auto countr_zero[conditional_expr auto c](unsigned_value auto x) noexcept; // 2
constexpr auto countr_zero[logical_value auto m](unsigned_value auto x) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
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 countr_zero
elementwise_callable object computing the number of consecutive bits unset in a value starting from r...
Definition countr_zero.hpp:69
EVE Main Namespace.
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.

External references

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 << "-> countr_zero(wu0) = " << eve::countr_zero(wu0) << "\n";
std::cout << "-> countr_zero[ignore_last(2)](wu0) = " << eve::countr_zero[eve::ignore_last(2)](wu0) << "\n";
std::cout << "-> countr_zero[wu0 != 0](wu0) = " << eve::countr_zero[wu0 != 0](wu0) << "\n";
}
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Wrapper for SIMD registers.
Definition wide.hpp:70