FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
Set Value of Element to Zero

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...

Functions

void assignToZero (int32_t &n) OME_ALWAYS_INLINE
 Assigns 0 to a 32-bit integer. More...
 
void assignToZero (int64_t &n) OME_ALWAYS_INLINE
 Assigns 0 to an 64-bit integer. More...
 
void assignToZero (float &n) OME_ALWAYS_INLINE
 Assigns 0 to a float. More...
 
void assignToZero (double &n) OME_ALWAYS_INLINE
 Assigns 0 to a double. More...
 
void assignToZero (__v4si &n) OME_ALWAYS_INLINE
 Assigns 0 to a 4-element vector of 32-bit integers. More...
 
void assignToZero (__m128i &n) OME_ALWAYS_INLINE
 Assigns 0 to a 128-bit integr vector element. More...
 

Detailed Description

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:

n = 0;

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.

Function Documentation

◆ 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

Assigns 0 to a double.

◆ assignToZero() [4/6]

void assignToZero ( float &  n)
inline

Assigns 0 to a float.

◆ assignToZero() [5/6]

◆ assignToZero() [6/6]

void assignToZero ( int64_t &  n)
inline

Assigns 0 to an 64-bit integer.

Generated: Fri Jul 31 2020 18:19:16
Support Information