The functions within this group are used to assign a value of 0 to different numerical types. Used in templated code where the nature of the type to be used is unknown and might be a vector element instead of a trivial fundamental type.
More...
The functions within this group are used to assign a value of 0 to different numerical types. Used in templated code where the nature of the type to be used is unknown and might be a vector element instead of a trivial fundamental type.
For most of these inlined routines, the code amounts to nothing more than:
While the use of inlines prevents incurring actual function call overhead, the programmer effort involved in typing assignToZero(n) rather than simply n=0 is much greater. The reason for assignToZero()'s existence is for usage within templated routines that might need to deal with non-scalar fundamental types, such as a 4-element vector of integers or a 64-element vector of doubles.
- Note
- Although the use of a reference argument would seem to force the element of interest into main memory, this is compensated for by having forced the routines to always be inlined. In reality, their true utility arises from assigning registers.
◆ assignToZero() [1/6]
void assignToZero |
( |
__m128i & |
n | ) |
|
|
inline |
Assigns 0 to a 128-bit integr vector element.
◆ assignToZero() [2/6]
void assignToZero |
( |
__v4si & |
n | ) |
|
|
inline |
Assigns 0 to a 4-element vector of 32-bit integers.
◆ assignToZero() [3/6]
void assignToZero |
( |
double & |
n | ) |
|
|
inline |
◆ assignToZero() [4/6]
void assignToZero |
( |
float & |
n | ) |
|
|
inline |
◆ assignToZero() [5/6]
void assignToZero |
( |
int32_t & |
n | ) |
|
|
inline |
◆ assignToZero() [6/6]
void assignToZero |
( |
int64_t & |
n | ) |
|
|
inline |
Assigns 0 to an 64-bit integer.