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

◆ bit_shr

auto eve::bit_shr = functor<bit_shr_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

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

Parameters

Return value

  1. The value of the logical right shift is returned.
  2. The operation is performed conditionnaly.
Note
  • The call bit_shr(x, n) is equivalent to x >> n if x is an unsigned_value.
  • 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.

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 << "-> bit_shr(wi0, wi1) = " << eve::bit_shr(wi0, wi1) << "\n";
std::cout << "-> bit_shr[ignore_last(2)](wi0, wi1) = " << eve::bit_shr[eve::ignore_last(2)](wi0, wi1) << "\n";
std::cout << "-> bit_shr[wi2 > 0](wi0, wi2) = " << eve::bit_shr[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:70