Functions for extracting elements or lanes from Vec's.
|
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 >.
|
|
◆ 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
-
INDEX | index of the value to extract |
- Parameters
-
- 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_INDEX | lane to extract, must be less than SIMD_WIDTH / 16 |
- Parameters
-
a | Vec to extract a lane from |
- Returns
- extracted lane as a Vec < T, 16 >