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

◆ bit_shl

auto eve::bit_shl = functor<shl_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto bit_shl(integral_value auto, x integral_value auto n) noexcept; // 1
// Lanes masking
constexpr auto bit_shl[conditional_expr auto c](integral_value auto x, integral_value auto n) noexcept; // 2
constexpr auto bit_shl[logical_value auto m](integral_value auto x, integral_value auto n) noexcept; // 2
}
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 bit_shl
strict_elementwise_callable object computing a logical left shift.
Definition bit_shl.hpp:63
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of the logical left shift is returned.
  2. The operation is performed conditionnaly.
Note
  • The call bit_shl(x, n) is equivalent to x << n if x is an simd value.
  • The types must share the same cardinal or be scalar and if \(N\) is the size in bits of the element type of x, all elements of n must belong to the interval \([0, N[\) or the result is undefined.

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{0, -4, 1, -1, 2, -2, 3, -3};
std::cout << "<- wi0 = " << wi0 << "\n";
std::cout << "<- wi1 = " << wi1 << "\n";
std::cout << "<- wi2 = " << wi2 << "\n";
std::cout << "-> bit_shl(wi0, wi1) = " << eve::bit_shl(wi0, wi1) << "\n";
std::cout << "-> bit_shl[ignore_last(2)](wi0, wi1) = " << eve::bit_shl[eve::ignore_last(2)](wi0, wi1) << "\n";
std::cout << "-> bit_shl[wi2 > 0](wi0, wi2) = " << eve::bit_shl[wi2 > 0](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