◆ bit_shr
Callable object computing the logical right shift operation. Required header: Members Functions
template< value T, integral_real_value U > auto operator()( T x, U n ) const noexcept requires bit_compatible< T, U >;
Parameters
Return value Computes the elementwise logical right shift of the first parameter by the second one. the call The types must share the same cardinal or be scalar and if \(N\) is the size in bits of the element type of auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::bit_shr Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/bit_shr.hpp>
#include <eve/literals.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using w_t = eve::wide<std::uint32_t, eve::fixed<4>>;
w_t pi = {3, 602, 3, 4001}, qi = {4, 1, 2, 0};
std::uint32_t z = 5;
std::cout << "---- simd" << '\n'
<< " <- qi = " << qi << '\n'
<< " <- z = " << z << '\n'
std::uint32_t a = 1;
std::uint32_t n = 4;
std::cout << "---- scalar" << '\n'
<< " <- a = " << a << '\n'
<< " <- n = " << n << '\n'
return 0;
}
constexpr callable_bit_shr_ bit_shr Callable object computing the logical right shift operation. Definition: bit_shr.hpp:98 |