simdpp::permute2

From libsimdpp-docs
template<unsigned s0, unsigned s1, unsigned N, class E>
Ret<N,_DETAIL_> permute2( const Vec<N,E>& a );

Permutes pairs of elements within the source vector. The implementation behaves as if the following set of overloads is provided:

Ret Vec
int16 int16
uint16 uint16
uint16 mask_int16
int32 int32
uint32 uint32
uint32 mask_int32
int64 int64
uint64 uint64
uint64 mask_int64
float32 float32
float32 mask_float32
float64 float64
float64 mask_float64

The selectors s0 and s1 must be in range [0..1].

The return type is a vector expression.

Parameters[edit]

a - source vector
s0,s1 - the permutation indices

Return value[edit]

A vector expression evaluating to the permuted vector.

Equivalent operation[edit]

r0 = a[s0]
r1 = a[s1]
r2 = a[s0+2]
r3 = a[s1+2]
...
rM-1 = a[s0+M-1]
rM   = a[s1+M-1]

Here M = N-1.

See also[edit]