|
template<typename Tout , typename Tin , size_t SIMD_WIDTH> |
static void | simd::convert (const Vec< Tin, SIMD_WIDTH > inVecs[numInVecs< Tout, Tin >()], Vec< Tout, SIMD_WIDTH > outVecs[numOutVecs< Tout, Tin >()]) |
| Converts (potentially multiple) Vec's between different types.
|
|
template<typename Tout , typename Tin , size_t SIMD_WIDTH> |
static Vec< Tout, SIMD_WIDTH > | simd::cvts (const Vec< Tin, SIMD_WIDTH > &a) |
| Converts the elements of a Vec between integer and floating point types of the same size.
|
|
template<typename Tout , typename Tin , size_t SIMD_WIDTH> |
static void | simd::extend (const Vec< Tin, SIMD_WIDTH > &vIn, Vec< Tout, SIMD_WIDTH > vOut[sizeof(Tout)/sizeof(Tin)]) |
| Extends the elements of a Vec to a larger or equally sized type.
|
|
template<typename Tout , typename Tin > |
static constexpr size_t | simd::numInVecs () |
| Number of input vectors for functions that potentially change the size of the elements but not the number of elements.
|
|
template<typename Tout , typename Tin > |
static constexpr size_t | simd::numOutVecs () |
| Number of output vectors for functions that potentially change the size of the elements but not the number of elements.
|
|
template<typename Tout , typename Tin , size_t SIMD_WIDTH> |
static constexpr size_t | simd::numSIMDVecsElements () |
| Number of elements in all input vectors for functions that potentially change the size of the elements but not the number of elements.
|
|
template<typename Tout , typename Tin , size_t SIMD_WIDTH> |
static Vec< Tout, SIMD_WIDTH > | simd::packs (const Vec< Tin, SIMD_WIDTH > &a, const Vec< Tin, SIMD_WIDTH > &b) |
| Packs two Vec's into one by converting the elements into the next smaller type with saturation.
|
|
template<typename Tout , typename Tin , size_t SIMD_WIDTH> |
static Vec< Tout, SIMD_WIDTH > | simd::packs (const Vec< Tin, SIMD_WIDTH > a[sizeof(Tin)/sizeof(Tout)]) |
| Packs multiple Vec's into a single Vec by converting the elements into smaller or equally sized types.
|
|
template<typename Tout , typename Tin , size_t SIMD_WIDTH> |
static Vec< Tout, SIMD_WIDTH > | simd::reinterpret (const Vec< Tin, SIMD_WIDTH > &a) |
| Reinterprets a given Vec as a Vec with a different element type.
|
|
template<typename Tout , typename Tin , size_t SIMD_WIDTH>
static void simd::convert |
( |
const Vec< Tin, SIMD_WIDTH > | inVecs[numInVecs< Tout, Tin >()], |
|
|
Vec< Tout, SIMD_WIDTH > | outVecs[numOutVecs< Tout, Tin >()] ) |
|
inlinestatic |
Converts (potentially multiple) Vec's between different types.
Combines extend() and packs().
TODO: allowed types
If the input and output types are of the same size, both the input and output are just one Vec. If the types are of different sizes, the input or output consists of multiple Vec's, such that the number of input elements is equal to the number of output elements.
- See also
- extend()
-
packs()
- Template Parameters
-
Tout | element type of the output Vec's |
Tin | element type of the input Vec's |
- Parameters
-
[in] | inVecs | input Vec's |
[out] | outVecs | output Vec's |
template<typename Tout , typename Tin , size_t SIMD_WIDTH>
static void simd::extend |
( |
const Vec< Tin, SIMD_WIDTH > & | vIn, |
|
|
Vec< Tout, SIMD_WIDTH > | vOut[sizeof(Tout)/sizeof(Tin)] ) |
|
inlinestatic |
Extends the elements of a Vec to a larger or equally sized type.
The values are zero-extended or sign-extended, depending on the type.
When converting from a signed to an unsigned type, negative values are saturated to zero.
Multiple output Vec's are produced, where the amount of output Vec's is sizeof(Tout) / sizeof(Tin)
.
- See also
- packs()
- Template Parameters
-
Tout | type to extend to |
Tin | type to extend from |
- Parameters
-
| vIn | input Vec |
[out] | vOut | output Vec's |
template<typename Tout , typename Tin , size_t SIMD_WIDTH>
static Vec< Tout, SIMD_WIDTH > simd::packs |
( |
const Vec< Tin, SIMD_WIDTH > & | a, |
|
|
const Vec< Tin, SIMD_WIDTH > & | b ) |
|
inlinestatic |
Packs two Vec's into one by converting the elements into the next smaller type with saturation.
Float is converted to an integer type, as there is no 16-bit floating point type.
- See also
- extend()
- Template Parameters
-
Tout | type of the resulting Vec, must be the next smaller type of the elements of the input Vec's |
Tin | type of the input Vec's |
- Parameters
-
- Returns
- Vec with the elements of a and b packed into one
template<typename Tout , typename Tin , size_t SIMD_WIDTH>
static Vec< Tout, SIMD_WIDTH > simd::packs |
( |
const Vec< Tin, SIMD_WIDTH > | a[sizeof(Tin)/sizeof(Tout)] | ) |
|
|
inlinestatic |