T-SIMD v31.1.0
A C++ template SIMD library
Loading...
Searching...
No Matches
Pure Mask Functions

Description

Functions that operate on masks themselves.

Functions

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kadd (const Mask< T, SIMD_WIDTH > &a, const Mask< T, SIMD_WIDTH > &b)
 Adds two Mask's together as if they were integers.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kand (const Mask< T, SIMD_WIDTH > &a, const Mask< T, SIMD_WIDTH > &b)
 Computes the bitwise AND of two Mask's.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kandn (const Mask< T, SIMD_WIDTH > &a, const Mask< T, SIMD_WIDTH > &b)
 Computes bitwise ANDNOT of two Mask's.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::knot (const Mask< T, SIMD_WIDTH > &a)
 Computes the bitwise NOT of a Mask.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kor (const Mask< T, SIMD_WIDTH > &a, const Mask< T, SIMD_WIDTH > &b)
 Computes the bitwise OR of two Mask's.
 
template<size_t COUNT, typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftli (const Mask< T, SIMD_WIDTH > &a)
 Shifts the bits of a Mask to the left by a constant number of bits.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftli (const Mask< T, SIMD_WIDTH > &a, const uint64_t count)
 Shifts the bits of a Mask to the left by a variable number of bits.
 
template<size_t COUNT, typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftri (const Mask< T, SIMD_WIDTH > &a)
 Shifts the bits of a Mask to the right by a constant number of bits.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftri (const Mask< T, SIMD_WIDTH > &a, const uint64_t count)
 Shifts the bits of a Mask to the right by a variable number of bits.
 
template<typename T , size_t SIMD_WIDTH>
static bool simd::ktest_all_ones (const Mask< T, SIMD_WIDTH > &a)
 Tests if all bits of a Mask are set to true.
 
template<typename T , size_t SIMD_WIDTH>
static bool simd::ktest_all_zeros (const Mask< T, SIMD_WIDTH > &a)
 Tests if all bits of a Mask are set to false.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kxnor (const Mask< T, SIMD_WIDTH > &a, const Mask< T, SIMD_WIDTH > &b)
 Computes the bitwise XNOR of two Mask's.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kxor (const Mask< T, SIMD_WIDTH > &a, const Mask< T, SIMD_WIDTH > &b)
 Computes the bitwise XOR of two Mask's.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_all_ones ()
 Creates a Mask with all elements set to true.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_false_high (const size_t x)
 Sets the upper x bits of a Mask to false.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_false_low (const size_t x)
 Sets the lower x bits of a Mask to false.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_true_high (const size_t x)
 Sets the upper x bits of a Mask to true.
 
template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_true_low (const size_t x)
 Sets the lower x bits of a Mask to true.
 
template<typename Tout , typename Tin , size_t SIMD_WIDTH>
static Mask< Tout, SIMD_WIDTH > simd::reinterpret_mask (const Mask< Tin, SIMD_WIDTH > &a)
 Reinterprets a Mask of one type as a Mask of another type.
 

Function Documentation

◆ kadd()

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

Adds two Mask's together as if they were integers.

Parameters
afirst Mask
bsecond Mask
Returns
sum of the two Mask's

◆ kand()

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

Computes the bitwise AND of two Mask's.

Parameters
afirst Mask
bsecond Mask
Returns
bitwise AND of the two Mask's

◆ kandn()

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

Computes bitwise ANDNOT of two Mask's.

The result is computed as (not a) and b.

Parameters
afirst Mask
bsecond Mask
Returns
bitwise ANDNOT of the two Mask's

◆ knot()

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

Computes the bitwise NOT of a Mask.

Parameters
aMask
Returns
bitwise NOT of the Mask

◆ kor()

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

Computes the bitwise OR of two Mask's.

Parameters
afirst Mask
bsecond Mask
Returns
bitwise OR of the two Mask's

◆ kshiftli() [1/2]

template<size_t COUNT, typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftli ( const Mask< T, SIMD_WIDTH > & a)
inlinestatic

Shifts the bits of a Mask to the left by a constant number of bits.

Parameters
aMask
Template Parameters
COUNTnumber of bits to shift
Returns
shifted Mask

◆ kshiftli() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftli ( const Mask< T, SIMD_WIDTH > & a,
const uint64_t count )
inlinestatic

Shifts the bits of a Mask to the left by a variable number of bits.

Parameters
aMask
countnumber of bits to shift
Returns
shifted Mask

◆ kshiftri() [1/2]

template<size_t COUNT, typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftri ( const Mask< T, SIMD_WIDTH > & a)
inlinestatic

Shifts the bits of a Mask to the right by a constant number of bits.

Parameters
aMask
Template Parameters
COUNTnumber of bits to shift
Returns
shifted Mask

◆ kshiftri() [2/2]

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::kshiftri ( const Mask< T, SIMD_WIDTH > & a,
const uint64_t count )
inlinestatic

Shifts the bits of a Mask to the right by a variable number of bits.

Parameters
aMask
countnumber of bits to shift
Returns
shifted Mask

◆ ktest_all_ones()

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

Tests if all bits of a Mask are set to true.

Parameters
aMask to test
Returns
true if all bits are set to true, false otherwise

◆ ktest_all_zeros()

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

Tests if all bits of a Mask are set to false.

Parameters
aMask to test
Returns
true if all bits are set to false, false otherwise

◆ kxnor()

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

Computes the bitwise XNOR of two Mask's.

Parameters
afirst Mask
bsecond Mask
Returns
bitwise XNOR of the two Mask's

◆ kxor()

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

Computes the bitwise XOR of two Mask's.

Parameters
afirst Mask
bsecond Mask
Returns
bitwise XOR of the two Mask's

◆ mask_all_ones()

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_all_ones ( )
inlinestatic

Creates a Mask with all elements set to true.

Returns
Mask with all elements set to true

◆ mask_set_false_high()

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_false_high ( const size_t x)
inlinestatic

Sets the upper x bits of a Mask to false.

The remaining bits are set to true.

Parameters
xnumber of bits to set to false
Returns
Mask with the upper x bits set to false

◆ mask_set_false_low()

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_false_low ( const size_t x)
inlinestatic

Sets the lower x bits of a Mask to false.

The remaining bits are set to true.

Parameters
xnumber of bits to set to false
Returns
Mask with the lower x bits set to false

◆ mask_set_true_high()

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_true_high ( const size_t x)
inlinestatic

Sets the upper x bits of a Mask to true.

The remaining bits are set to false.

Parameters
xnumber of bits to set to true
Returns
Mask with the upper x bits set to true

◆ mask_set_true_low()

template<typename T , size_t SIMD_WIDTH>
static Mask< T, SIMD_WIDTH > simd::mask_set_true_low ( const size_t x)
inlinestatic

Sets the lower x bits of a Mask to true.

The remaining bits are set to false.

Parameters
xnumber of bits to set to true
Returns
Mask with the lower x bits set to true

◆ reinterpret_mask()

template<typename Tout , typename Tin , size_t SIMD_WIDTH>
static Mask< Tout, SIMD_WIDTH > simd::reinterpret_mask ( const Mask< Tin, SIMD_WIDTH > & a)
inlinestatic

Reinterprets a Mask of one type as a Mask of another type.

The size of the element type of the Mask must be the same.

Template Parameters
Toutelement type of the reinterpreted Mask
Tinelement type of the Mask to reinterpret
Parameters
aMask to reinterpret
Returns
reinterpreted Mask