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

◆ rotl

auto eve::rotl = functor<rotl_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overloads
constexpr auto rotl(unsigned_value auto x, integral_value auto n) noexcept; // 1
// Lanes masking
constexpr auto rotl[conditional_expr auto c](unsigned_value auto x, integral_value auto n) noexcept; // 3
constexpr auto rotl[logical_value auto m](unsigned_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
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 rotl
Bitwise rotation to the left.
Definition rotl.hpp:81
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. Bitwise rotation of each lane of x by n bits to the left. The types must share the same cardinal or be scalar and if N is the size in bits of the element type of T, all elements of n must belong to the interval: [0, 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 wu0{0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
wu0 = ~wu0;
eve::wide wu1{0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
std::cout << "<- wu0 = " << wu0 << "\n";
std::cout << "<- wu1 = " << wu1 << "\n";
std::cout << "-> rotl(wu0, wu1) = " << eve::rotl(wu0, wu1) << "\n";
std::cout << "-> rotl[ignore_last(2)](wu0, wu1) = " << eve::rotl[eve::ignore_last(2)](wu0, wu1) << "\n";
std::cout << "-> rotl[wu0 != 0](wu0, wu1) = " << eve::rotl[wu0 != 0](wu0, wu1) << "\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