E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
byte_swap_pairs
auto eve::byte_swap_pairs =
functor
<byte_swap_pairs_t>
inline
constexpr
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
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition
conditional.hpp:28
eve::integral_value
The concept integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition
value.hpp:51
eve::logical_value
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition
value.hpp:132
eve::byte_swap_pairs
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
EVE Main Namespace.
Definition
abi.hpp:18
Parameters
x
:
argument
.
i0
: first index
i1
: second index
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
Return x byte i0 and i1 swapped in each element of x. Assert if i0 or i1 are out of range.
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"
;
}
eve::ignore_last
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition
conditional.hpp:332
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:86
eve