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

◆ rshl

auto eve::rshl = functor<rshl_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overloads
constexpr auto rshl(integral_value auto x, integral_value auto n) noexcept; // 2
// Lanes masking
constexpr auto rshl[conditional_expr auto c](integral_value auto x, integral_value auto n) noexcept; // 3
constexpr auto rshl[logical_value auto m](integral_value auto x, integral_value auto n) noexcept; // 3
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:51
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
constexpr auto rshl
Computes the arithmetic left/right shift operation according to shift sign.
Definition rshl.hpp:83
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of the arithmetic left/right shift operation according to shift sign is returned. This is equivalent to if_else(n>0, shl(x, n), shr(x, -n)) If Nis the size in bits of the element type of x, all elements of n must belong to the interval: ]-N, N[ or the result is undefined.
  2. The operation is performed conditionnaly

Example

// revision 0
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wi0{0, 1, 2, 3, -1, -2, -3, -4};
eve::wide wi1{0, -4, 1, -1, 2, -2, 3, -3};
eve::wide wi2{1024, -4, 1, -1, 2, -2, 3, -3};
std::cout << "<- wi0 = " << wi0 << "\n";
std::cout << "<- wi1 = " << wi1 << "\n";
std::cout << "-> rshl(wi0, wi1) = " << eve::rshl(wi0, wi1) << "\n";
std::cout << "-> rshl[ignore_last(2)](wi0, wi1) = " << eve::rshl[eve::ignore_last(2)](wi0, wi1) << "\n";
std::cout << "-> rshl[wi0 != 0](wi0, wi1) = " << eve::rshl[wi0 != 0](wi0, wi1) << "\n";
std::cout << "-> rshl[wi2 < 32](wi0, wi2) = " << eve::rshl[wi2 < 32](wi0, wi2) << "\n";
}
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Wrapper for SIMD registers.
Definition wide.hpp:86