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

◆ byte_swap_pairs

auto eve::byte_swap_pairs = functor<byte_swap_pairs_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto byte_swap_pairs(integral_value auto x,
index_t<I0> auto i0, index_t<I1> auto i1) noexcept; // 1
// Lanes masking
constexpr auto byte_swap_pairs[conditional_expr auto c](integral_value auto x,
index_t<I0> auto i0, index_t<I1> auto i1) noexcept; // 2
constexpr auto byte_swap_pairs[logical_value auto m](integral_value auto x,
index_t<I0> auto i0, index_t<I1> auto i1) 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 byte_swap_pairs
strict_elementwise_callable object swapping chosen pairs of bytes in each vector element.
Definition byte_swap_pairs.hpp:69
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. Return x byte i0 and i1 swapped in each element of x. Assert if i0 or i1 are out of range.
  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 << "<- wu0 = " << wu0 << "\n";
std::cout << "-> byte_swap_pairs(wu0, index_t<0>(), index_t<1>()) = " << eve::byte_swap_pairs(wu0, eve::index_t<0>(), eve::index_t<1>()) << "\n";
std::cout << "-> byte_swap_pairs[ignore_last(2)](wu0, index_t<0>(), index_t<1>()) = " << eve::byte_swap_pairs[eve::ignore_last(2)](wu0, eve::index_t<0>(), eve::index_t<1>()) << "\n";
std::cout << "-> byte_swap_pairs[wu0 != 0](wu0, index_t<0>(), index_t<1>()) = " << eve::byte_swap_pairs[wu0 != 0](wu0, eve::index_t<0>(), eve::index_t<1>()) << "\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