E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
countl_one
eve::countl_one = functor<countl_one_t>
inline
constexpr
Header file
#include <eve/module/core.hpp>
Callable Signatures
namespace
eve
{
// Regular overload
constexpr
auto
countl_one
(
unsigned_value
auto
x
)
noexcept
;
// 1
// Lanes masking
constexpr
auto
countl_one
[
conditional_expr
auto
c
](
unsigned_value
auto
x
)
noexcept
;
// 2
constexpr
auto
countl_one
[
logical_value
auto
m
](
unsigned_value
auto
x
)
noexcept
;
// 2
}
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition
conditional.hpp:28
eve::logical_value
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition
value.hpp:134
eve::unsigned_value
The concept unsigned_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition
value.hpp:84
eve::countl_one
constexpr auto countl_one
elementwise_callable object computing the number of consecutive bits unset in a value starting from l...
Definition
countl_one.hpp:72
eve::translate_t
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition
translation.hpp:107
eve
EVE Main Namespace.
Definition
abi.hpp:19
Parameters
x
:
argument
.
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
The value of the number of consecutive 1 ("one") bits in the value of
x
, starting from the most significant bit ("left"), with same type as
x
is returned.
The operation is performed conditionnaly
.
External references
C++ standard reference
Example
// revision 0
#include <eve/module/core.hpp>
#include <iostream>
int
main
()
{
eve::wide
wu0
{0
u
, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
std::cout <<
"<- wu0 = "
<<
wu0
<<
"\n"
;
std::cout <<
"-> countl_one(wu0) = "
<<
eve::countl_one
(
wu0
) <<
"\n"
;
std::cout <<
"-> countl_one[ignore_last(2)](wu0) = "
<<
eve::countl_one
[
eve::ignore_last
(2)](
wu0
) <<
"\n"
;
std::cout <<
"-> countl_one[wu0 != 0](wu0) = "
<<
eve::countl_one
[
wu0
!= 0](
wu0
) <<
"\n"
;
}
eve::ignore_last
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition
conditional.hpp:320
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve