T-SIMD v31.1.0
A C++ template SIMD library
Loading...
Searching...
No Matches
Extraction

Description

Functions for extracting elements or lanes from Vec's.

Functions

template<size_t INDEX, typename T , size_t SIMD_WIDTH>
static T simd::extract (const Vec< T, SIMD_WIDTH > &a)
 Extracts a single value from a Vec.
 
template<size_t LANE_INDEX, typename T , size_t SIMD_WIDTH>
static Vec< T, 16 > simd::extractLane (const Vec< T, SIMD_WIDTH > &a)
 Extracts a 16-byte lane from a Vec as a Vec < T, 16 >.
 

Function Documentation

◆ extract()

template<size_t INDEX, typename T , size_t SIMD_WIDTH>
static T simd::extract ( const Vec< T, SIMD_WIDTH > & a)
inlinestatic

Extracts a single value from a Vec.

Returns 0 if INDEX is out of range.

Template Parameters
INDEXindex of the value to extract
Parameters
aVec to extract from
Returns
extracted value

◆ extractLane()

template<size_t LANE_INDEX, typename T , size_t SIMD_WIDTH>
static Vec< T, 16 > simd::extractLane ( const Vec< T, SIMD_WIDTH > & a)
inlinestatic

Extracts a 16-byte lane from a Vec as a Vec < T, 16 >.

Template Parameters
LANE_INDEXlane to extract, must be less than SIMD_WIDTH / 16
Parameters
aVec to extract a lane from
Returns
extracted lane as a Vec < T, 16 >