Intel xvec
Experimental C++ simd class library
Loading...
Searching...
No Matches
Funnel shifts

Shift concatenated pairs of elements and return one element-width result. More...

Functions

template<vec_unsigned_integer _Up, vec_integral _Sp>
requires (sizeof(typename _Up::value_type) == sizeof(typename _Sp::value_type))
constexpr _Up xvec::simd::funnel_shift_right (const _Up &high, const _Up &low, const _Sp &s)
 Funnel shift corresponding element pairs right. Conceptually concatenate each high element with its corresponding low element, shift right, and return the low N bits, where N is the element bit width.
template<vec_unsigned_integer _Up, std::integral _Sp>
constexpr _Up xvec::simd::funnel_shift_right (const _Up &high, const _Up &low, _Sp s)
 Funnel shift every element pair right using a shared shift count.
template<vec_unsigned_integer _Up, vec_integral _Sp>
requires (sizeof(typename _Up::value_type) == sizeof(typename _Sp::value_type))
constexpr _Up xvec::simd::funnel_shift_left (const _Up &high, const _Up &low, const _Sp &s)
 Funnel shift corresponding element pairs left. Conceptually concatenate each high element with its corresponding low element, shift left, and return the high N bits, where N is the element bit width.
template<vec_unsigned_integer _Up, std::integral _Sp>
constexpr _Up xvec::simd::funnel_shift_left (const _Up &high, const _Up &low, _Sp s)
 Funnel shift every element pair left using a shared shift count.

Detailed Description

Shift concatenated pairs of elements and return one element-width result.

Proposed in P4010.

See also
https://wg21.link/P4010

Function Documentation

◆ funnel_shift_left() [1/2]

template<vec_unsigned_integer _Up, std::integral _Sp>
_Up xvec::simd::funnel_shift_left ( const _Up & high,
const _Up & low,
_Sp s )
constexpr

Funnel shift every element pair left using a shared shift count.

Parameters
highThe upper elements of the concatenation.
lowThe lower elements of the concatenation.
sThe shared shift count.
Precondition
0 <= s < N, where N is the element bit width.
Returns
A vector containing the funnel-shift results.

◆ funnel_shift_left() [2/2]

template<vec_unsigned_integer _Up, vec_integral _Sp>
requires (sizeof(typename _Up::value_type) == sizeof(typename _Sp::value_type))
_Up xvec::simd::funnel_shift_left ( const _Up & high,
const _Up & low,
const _Sp & s )
constexpr

Funnel shift corresponding element pairs left. Conceptually concatenate each high element with its corresponding low element, shift left, and return the high N bits, where N is the element bit width.

Template Parameters
_UpThe unsigned vector type.
_SpThe integral shift-count vector type.
Parameters
highThe upper elements of the concatenation.
lowThe lower elements of the concatenation.
sThe element-wise shift counts.
Precondition
For every element i, 0 <= s[i] < N.
Returns
A vector containing the funnel-shift results.

◆ funnel_shift_right() [1/2]

template<vec_unsigned_integer _Up, std::integral _Sp>
_Up xvec::simd::funnel_shift_right ( const _Up & high,
const _Up & low,
_Sp s )
constexpr

Funnel shift every element pair right using a shared shift count.

Parameters
highThe upper elements of the concatenation.
lowThe lower elements of the concatenation.
sThe shared shift count.
Precondition
0 <= s < N, where N is the element bit width.
Returns
A vector containing the funnel-shift results.

◆ funnel_shift_right() [2/2]

template<vec_unsigned_integer _Up, vec_integral _Sp>
requires (sizeof(typename _Up::value_type) == sizeof(typename _Sp::value_type))
_Up xvec::simd::funnel_shift_right ( const _Up & high,
const _Up & low,
const _Sp & s )
constexpr

Funnel shift corresponding element pairs right. Conceptually concatenate each high element with its corresponding low element, shift right, and return the low N bits, where N is the element bit width.

Template Parameters
_UpThe unsigned vector type.
_SpThe integral shift-count vector type.
Parameters
highThe upper elements of the concatenation.
lowThe lower elements of the concatenation.
sThe element-wise shift counts.
Precondition
For every element i, 0 <= s[i] < N.
Returns
A vector containing the funnel-shift results.