◆ rshr
Callable object computing the arithmetic left/right shift operation according to shift sign. 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 arithmetic left/right shift of the first parameter by the second one. the call The types must share the same cardinal or be scalar and if auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::rshr Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/rshr.hpp>
#include <eve/wide.hpp>
#include <iostream>
using iT = std::int32_t;
using uiT = std::uint32_t;
using wide_it = eve::wide<iT, eve::fixed<4>>;
using wide_uit = eve::wide<uiT, eve::fixed<4>>;
int main()
{
wide_uit pi = {100, 200, 2, 3};
wide_it qi = {1, -2, 3, -1};
std::cout << "---- simd" << '\n'
<< "<- qi = " << qi << '\n'
uiT xi = 2, yi = 3;
std::cout << "---- scalar" << '\n'
<< "<- xi = " << xi << '\n'
<< "<- yi = " << yi << '\n'
return 0;
}
constexpr callable_rshr_ rshr Callable object computing the arithmetic left/right shift operation according to shift sign. Definition: rshr.hpp:102 |