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

◆ byte_reverse

auto eve::byte_reverse = functor<byte_reverse_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto byte_reverse(unsigned_value auto x) noexcept; // 1
// Lanes masking
constexpr auto byte_reverse[conditional_expr auto c](unsigned_value auto x) noexcept; // 2
constexpr auto byte_reverse[logical_value auto m](unsigned_value auto x) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition conditional.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 byte_reverse
elementwise_callable object reversing the byte order.
Definition byte_reverse.hpp:78
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The values of the parameter elements are returned with bytes in reversed order.
  2. The operation is performed conditionnaly.
Note
eve::byte_reverse is the functional equivalent to std::byte_swap. However, we decided to name it byte_reverse in order to keep a proper naming scheme aligned with the eve::bit_swap/evebit_reverse functions.

Example

// revision 1
#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_reverse(wu0) = " << eve::byte_reverse(wu0) << "\n";
std::cout << "-> byte_reverse[ignore_last(2)](wu0) = " << eve::byte_reverse[eve::ignore_last(2)](wu0) << "\n";
std::cout << "-> byte_reverse[wu0 != 2u](wu0) = " << eve::byte_reverse[wu0 != 2u](wu0) << "\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