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

Description

Functions for masked comparing elements of Vec's.

See also
Comparisons

Functions

template<typename T , size_t SIMD_WIDTH>
static bool simd::kcmpeq (const Mask< T, SIMD_WIDTH > &a, const Mask< T, SIMD_WIDTH > &b)
 Tests if all bits of two Mask's are equal.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpeq (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Masked comparison between corresponding elements of two Vec's for equality ( == ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpeq (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Compares corresponding elements of two Vec's for equality ( == ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpge (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Masked comparison between corresponding elements of two Vec's for greater-than-or-equal ( >= ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpge (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Compares corresponding elements of two Vec's for greater-than-or-equal ( >= ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpgt (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Masked comparison between corresponding elements of two Vec's for greater-than ( > ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpgt (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Compares corresponding elements of two Vec's for greater-than ( > ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmple (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Masked comparison between corresponding elements of two Vec's for less-than-or-equal ( <= ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmple (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Compares corresponding elements of two Vec's for less-than-or-equal ( <= ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmplt (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Masked comparison between corresponding elements of two Vec's for less-than ( < ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmplt (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Compares corresponding elements of two Vec's for less-than ( < ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpneq (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Masked comparison between corresponding elements of two Vec's for inequality ( != ).
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpneq (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Compares corresponding elements of two Vec's for inequality ( != ).
 
template<typename Tcond , typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::mask_ifelse (const Mask< Tcond, SIMD_WIDTH > &cond, const Vec< T, SIMD_WIDTH > &trueVal, const Vec< T, SIMD_WIDTH > &falseVal)
 Selects elements from two Vec's based on a condition Mask.
 
template<typename Tcond , typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::mask_ifelsezero (const Mask< Tcond, SIMD_WIDTH > &cond, const Vec< T, SIMD_WIDTH > &trueVal)
 Selects elements from a Vec and zero based on a condition Mask.
 
template<typename T , size_t SIMD_WIDTH>
static bool simd::mask_test_all_ones (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a)
 Tests if all bits of all elements of an Vec are one, while ignoring elements where the corresponding bit in an Mask is zero.
 
template<typename T , size_t SIMD_WIDTH>
static bool simd::mask_test_all_zeros (const Mask< T, SIMD_WIDTH > &k, const Vec< T, SIMD_WIDTH > &a)
 Tests if all elements of an Vec are zero, while ignoring elements where the corresponding bit in an Mask is zero.
 

Function Documentation

◆ kcmpeq()

template<typename T , size_t SIMD_WIDTH>
static bool simd::kcmpeq ( const Mask< T, SIMD_WIDTH > & a,
const Mask< T, SIMD_WIDTH > & b )
inlinestatic

Tests if all bits of two Mask's are equal.

Parameters
afirst Mask
bsecond Mask
Returns
true if all bits of both Mask's are equal, false otherwise

◆ mask_cmpeq() [1/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpeq ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Masked comparison between corresponding elements of two Vec's for equality ( == ).

Bits in the resulting Mask are zeroed out if the corresponding bit in the given Mask is not set.

Parameters
kMask to use for masking the results
afirst Vec
bsecond Vec
Returns
Mask with the masked results of the comparisons
See also
cmpeq(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmpeq() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpeq ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Compares corresponding elements of two Vec's for equality ( == ).

Parameters
afirst Vec
bsecond Vec
Returns
Mask with the results of the comparisons
See also
cmpeq(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmpeq(const Mask<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmpge() [1/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpge ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Masked comparison between corresponding elements of two Vec's for greater-than-or-equal ( >= ).

Bits in the resulting Mask are zeroed out if the corresponding bit in the given Mask is not set.

Parameters
kMask to use for masking the results
afirst Vec
bsecond Vec
Returns
Mask with the masked results of the comparisons
See also
cmpge(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmpgt(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmpge() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpge ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Compares corresponding elements of two Vec's for greater-than-or-equal ( >= ).

Parameters
afirst Vec
bsecond Vec
Returns
Mask with the results of the comparisons
See also
cmpge(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmpge(const Mask<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmpgt() [1/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpgt ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Masked comparison between corresponding elements of two Vec's for greater-than ( > ).

Bits in the resulting Mask are zeroed out if the corresponding bit in the given Mask is not set.

Parameters
kMask to use for masking the results
afirst Vec
bsecond Vec
Returns
Mask with the masked results of the comparisons
See also
cmpgt(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmpge(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmpgt() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpgt ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Compares corresponding elements of two Vec's for greater-than ( > ).

Parameters
afirst Vec
bsecond Vec
Returns
Mask with the results of the comparisons
See also
cmpgt(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmpgt(const Mask<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmple() [1/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmple ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Masked comparison between corresponding elements of two Vec's for less-than-or-equal ( <= ).

Bits in the resulting Mask are zeroed out if the corresponding bit in the given Mask is not set.

Parameters
kMask to use for masking the results
afirst Vec
bsecond Vec
Returns
Mask with the masked results of the comparisons
See also
cmple(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmplt(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmple() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmple ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Compares corresponding elements of two Vec's for less-than-or-equal ( <= ).

Parameters
afirst Vec
bsecond Vec
Returns
Mask with the results of the comparisons
See also
cmple(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmple(const Mask<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmplt() [1/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmplt ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Masked comparison between corresponding elements of two Vec's for less-than ( < ).

Bits in the resulting Mask are zeroed out if the corresponding bit in the given Mask is not set.

Parameters
kMask to use for masking the results
afirst Vec
bsecond Vec
Returns
Mask with the masked results of the comparisons
See also
cmplt(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmple(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmplt() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmplt ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Compares corresponding elements of two Vec's for less-than ( < ).

Parameters
afirst Vec
bsecond Vec
Returns
Mask with the results of the comparisons
See also
cmplt(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmplt(const Mask<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmpneq() [1/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpneq ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Masked comparison between corresponding elements of two Vec's for inequality ( != ).

Bits in the resulting Mask are zeroed out if the corresponding bit in the given Mask is not set.

Parameters
kMask to use for masking the results
afirst Vec
bsecond Vec
Returns
Mask with the masked results of the comparisons
See also
cmpneq(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmpneq(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_cmpneq() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_cmpneq ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Compares corresponding elements of two Vec's for inequality ( != ).

Parameters
afirst Vec
bsecond Vec
Returns
Mask with the results of the comparisons
See also
cmpneq(const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)
mask_cmpneq(const Mask<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &, const Vec<T, SIMD_WIDTH> &)

◆ mask_ifelse()

template<typename Tcond , typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::mask_ifelse ( const Mask< Tcond, SIMD_WIDTH > & cond,
const Vec< T, SIMD_WIDTH > & trueVal,
const Vec< T, SIMD_WIDTH > & falseVal )
inlinestatic

Selects elements from two Vec's based on a condition Mask.

Parameters
condcondition mask
trueValVec to select from if the condition is true
falseValVec to select from if the condition is false
Returns
Vec containing the selected elements

◆ mask_ifelsezero()

template<typename Tcond , typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::mask_ifelsezero ( const Mask< Tcond, SIMD_WIDTH > & cond,
const Vec< T, SIMD_WIDTH > & trueVal )
inlinestatic

Selects elements from a Vec and zero based on a condition Mask.

Parameters
condcondition mask
trueValVec to select from if the condition is true
Returns
Vec containing the selected elements

◆ mask_test_all_ones()

template<typename T , size_t SIMD_WIDTH>
static bool simd::mask_test_all_ones ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a )
inlinestatic

Tests if all bits of all elements of an Vec are one, while ignoring elements where the corresponding bit in an Mask is zero.

Parameters
kMask to use for the test
aVec to test
Returns
true if all bits of all elements (except those ignored by the mask) are one, false otherwise

◆ mask_test_all_zeros()

template<typename T , size_t SIMD_WIDTH>
static bool simd::mask_test_all_zeros ( const Mask< T, SIMD_WIDTH > & k,
const Vec< T, SIMD_WIDTH > & a )
inlinestatic

Tests if all elements of an Vec are zero, while ignoring elements where the corresponding bit in an Mask is zero.

Parameters
kMask to use for the test
aVec to test
Returns
true if all elements (except those ignored by the mask) are zero, false otherwise