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

◆ reverse

eve::reverse = detail::named_shuffle_1<reverse_t> {}
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

As any named shuffle, allows to pass a group size, to treat multiple elements as one. Group size has to be 0 < G <= T::size()

template <simd_value T, std::ptrdiff_t G>
template <simd_value T>
T reverse(T x); // (2)
constexpr auto reverse
a named shuffle for reversing a register.
Definition reverse.hpp:134
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107

Parameters

  • x - simd_value to shuffle
  • G - (optional) - number of elements to treat as one.

(2) calls (1) with G == 1; (1) reverses positions of adjacent groups of elements of size G

Return value

Return x where groups of contiguous G elements are reversed.

Example

#include <eve/module/core.hpp>
#include <tts/tts.hpp>
int main()
{
w_t x {0, 1, 2, 3};
TTS_EXPECT( eve::all( w_t{3, 2, 1, 0} == eve::reverse(x)) );
// lane<0> is not OK
}
constexpr auto all
Computes a bool value which is true if and only if every elements of x evaluates to true.
Definition all.hpp:95