XeTLA v0.3.6
IntelĀ® Xe Templates for Linear Algebra - API Definition Document
 
Loading...
Searching...
No Matches
Bit and mask manipulation APIs

Defines bitwise operations. More...

Collaboration diagram for Bit and mask manipulation APIs:

Functions

template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_shl (xetla_vector< T1, SZ > src0, U src1, Sat sat={})
 Shift left operation (vector version)
 
template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
std::remove_const< T0 >::type gpu::xetla::xetla_shl (T1 src0, T2 src1, Sat sat={})
 Shift left operation (scalar version)
 
template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_shr (xetla_vector< T1, SZ > src0, U src1, Sat sat={})
 Shift right operation (vector version)
 
template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
__XETLA_API std::remove_const< T0 >::type gpu::xetla::xetla_shr (T1 src0, T2 src1, Sat sat={})
 Shift right operation (scalar version)
 
template<typename T0 , typename T1 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_rol (xetla_vector< T1, SZ > src0, xetla_vector< T1, SZ > src1)
 Rotate left operation with two vector inputs.
 
template<typename T0 , typename T1 , int SZ, typename U >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value &&is_xetla_scalar< U >::value, xetla_vector< T0, SZ > > gpu::xetla::xetla_rol (xetla_vector< T1, SZ > src0, U src1)
 Rotate left operation with a vector and a scalar inputs.
 
template<typename T0 , typename T1 , typename T2 >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, remove_const_t< T0 > > gpu::xetla::xetla_rol (T1 src0, T2 src1)
 Rotate left operation with two scalar inputs.
 
template<typename T0 , typename T1 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_ror (xetla_vector< T1, SZ > src0, xetla_vector< T1, SZ > src1)
 Rotate right operation with two vector inputs.
 
template<typename T0 , typename T1 , int SZ, typename U >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value &&is_xetla_scalar< U >::value, xetla_vector< T0, SZ > > gpu::xetla::xetla_ror (xetla_vector< T1, SZ > src0, U src1)
 Rotate right operation with a vector and a scalar inputs.
 
template<typename T0 , typename T1 , typename T2 >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, remove_const_t< T0 > > gpu::xetla::xetla_ror (T1 src0, T2 src1)
 Rotate right operation with two scalar inputs.
 
template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_lsr (xetla_vector< T1, SZ > src0, U src1, Sat sat={})
 Logical Shift Right (vector version)
 
template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
__XETLA_API std::remove_const< T0 >::type gpu::xetla::xetla_lsr (T1 src0, T2 src1, Sat sat={})
 Logical Shift Right (scalar version)
 
template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_asr (xetla_vector< T1, SZ > src0, U src1, Sat sat={})
 Arithmetical Shift Right (vector version)
 
template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
__XETLA_API std::remove_const< T0 >::type gpu::xetla::xetla_asr (T1 src0, T2 src1, Sat sat={})
 Arithmetical Shift Right (scalar version)
 
template<int N>
__XETLA_API uint32_t gpu::xetla::xetla_pack_mask (xetla_mask< N > src0)
 Pack a xetla_mask into a single unsigned 32-bit integer value.
 
template<int N>
__XETLA_API xetla_mask< N > gpu::xetla::xetla_unpack_mask (uint32_t src0)
 Unpack an unsigned 32-bit integer value into a xetla_mask.
 

Detailed Description

Defines bitwise operations.

Function Documentation

◆ xetla_asr() [1/2]

template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
__XETLA_API std::remove_const< T0 >::type gpu::xetla::xetla_asr ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Arithmetical Shift Right (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value src0. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted value.

◆ xetla_asr() [2/2]

template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_asr ( xetla_vector< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Arithmetical Shift Right (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted elements.

◆ xetla_lsr() [1/2]

template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
__XETLA_API std::remove_const< T0 >::type gpu::xetla::xetla_lsr ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Logical Shift Right (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value src0. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted value.

◆ xetla_lsr() [2/2]

template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_lsr ( xetla_vector< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Logical Shift Right (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted elements.

◆ xetla_pack_mask()

template<int N>
__XETLA_API uint32_t gpu::xetla::xetla_pack_mask ( xetla_mask< N >  src0)

Pack a xetla_mask into a single unsigned 32-bit integer value.

i'th bit in the returned value is set to the result of comparison of the i'th element of the input argument to zero. "equals to zero" gives 0, "not equal to zero" gives 1. Remaining (if any) bits if the result are filled with 0.

Template Parameters
NSize of the input mask.
Parameters
src0The input mask.
Returns
The packed mask as an unsigned int 32-bit value.

◆ xetla_rol() [1/3]

template<typename T0 , typename T1 , typename T2 >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, remove_const_t< T0 > > gpu::xetla::xetla_rol ( T1  src0,
T2  src1 
)

Rotate left operation with two scalar inputs.

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be rotated.
Returns
rotated left value.

◆ xetla_rol() [2/3]

template<typename T0 , typename T1 , int SZ, typename U >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value &&is_xetla_scalar< U >::value, xetla_vector< T0, SZ > > gpu::xetla::xetla_rol ( xetla_vector< T1, SZ >  src0,
src1 
)

Rotate left operation with a vector and a scalar inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be rotated.
Returns
vector of rotated elements.

◆ xetla_rol() [3/3]

template<typename T0 , typename T1 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_rol ( xetla_vector< T1, SZ >  src0,
xetla_vector< T1, SZ >  src1 
)

Rotate left operation with two vector inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the vector with number of bit positions by which the elements of the input vector src0 shall be rotated.
Returns
vector of rotated elements.

◆ xetla_ror() [1/3]

template<typename T0 , typename T1 , typename T2 >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, remove_const_t< T0 > > gpu::xetla::xetla_ror ( T1  src0,
T2  src1 
)

Rotate right operation with two scalar inputs.

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be rotated.
Returns
rotated right value.

◆ xetla_ror() [2/3]

template<typename T0 , typename T1 , int SZ, typename U >
__XETLA_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value &&is_xetla_scalar< U >::value, xetla_vector< T0, SZ > > gpu::xetla::xetla_ror ( xetla_vector< T1, SZ >  src0,
src1 
)

Rotate right operation with a vector and a scalar inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be rotated.
Returns
vector of rotated elements.

◆ xetla_ror() [3/3]

template<typename T0 , typename T1 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_ror ( xetla_vector< T1, SZ >  src0,
xetla_vector< T1, SZ >  src1 
)

Rotate right operation with two vector inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the vector with number of bit positions by which the elements of the input vector src0 shall be rotated.
Returns
vector of rotated elements.

◆ xetla_shl() [1/2]

template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
std::remove_const< T0 >::type gpu::xetla::xetla_shl ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Shift left operation (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted left value.

◆ xetla_shl() [2/2]

template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_shl ( xetla_vector< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Shift left operation (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vector.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted left values.

◆ xetla_shr() [1/2]

template<typename T0 , typename T1 , typename T2 , class Sat = xetla_saturation_off_tag>
__XETLA_API std::remove_const< T0 >::type gpu::xetla::xetla_shr ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Shift right operation (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted right value.

◆ xetla_shr() [2/2]

template<typename T0 , typename T1 , int SZ, typename U , class Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_shr ( xetla_vector< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Shift right operation (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vector.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted right values.

◆ xetla_unpack_mask()

template<int N>
__XETLA_API xetla_mask< N > gpu::xetla::xetla_unpack_mask ( uint32_t  src0)

Unpack an unsigned 32-bit integer value into a xetla_mask.

Only N least significant bits are used, where N is the number of elements in the result mask. Each input bit is stored into the corresponding vector element of the output mask.

Template Parameters
NSize of the output mask.
Parameters
src0The input packed mask.
Returns
The unpacked mask as a xetla_mask object.