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

◆ bit_swap_adjacent

auto eve::bit_swap_adjacent = functor<bit_swap_adjacent_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto bit_swap_adjacent(unsigned_value auto x, integral_scalar_value auto n) noexcept; // 1
// Lanes masking
constexpr auto bit_swap_adjacent[conditional_expr auto c](unsigned_value auto x, integral_scalar_value auto n) noexcept; // 2
constexpr auto bit_swap_adjacent[logical_value auto m](unsigned_value auto x, integral_scalar_value auto n) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
Specify that a type represents an integral scalar value. The concept integral_scalar_value<T> is sati...
Definition vectorizable.hpp:28
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 bit_swap_adjacent
strict_elementwise_callable object swapping adjacent groups of n bits.
Definition bit_swap_adjacent.hpp:72
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. Return x with pairs of contiguous groups of N bits swapped in each element.
    • If n is greater or equal to sizeof(x)*8 0 is returned.
    • If n is equal to 0 x is returned.
  2. The operation is performed conditionnaly.

Example

// revision 2
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wu0{0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
std::cout << "-> bit_swap_adjacent(wu0, 2) = " << eve::bit_swap_adjacent(wu0, 2) << "\n";
std::cout << "-> bit_swap_adjacent[ignore_last(2)](wu0, 2) = " << eve::bit_swap_adjacent[eve::ignore_last(2)](wu0, 2) << "\n";
std::cout << "-> bit_swap_adjacent[wu0 != 2u](wu0, 2) = " << eve::bit_swap_adjacent[wu0 != 2u](wu0, 2) << "\n";
std::cout << "-> bit_swap_adjacent(wu0, 2) = " << eve::bit_swap_adjacent(wu0, 2) << "\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

Semantic Modifiers