JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
JPL::simd_mask Struct Reference

#include <JPLSpatial/Math/SIMD.h>

Public Types

using Type = std::array< uint32, 4 >
 

Public Member Functions

 simd_mask () noexcept=default
 
 simd_mask (const simd_mask &) noexcept=default
 
simd_maskoperator= (const simd_mask &) noexcept=default
 
JPL_INLINE simd_mask (Type value) noexcept
 
JPL_INLINE simd_mask (uint32 value) noexcept
 
JPL_INLINE simd_mask (uint32 v0, uint32 v1, uint32 v2, uint32 v3) noexcept
 
JPL_INLINE simd_mask (const uint32 *mem)
 
JPL_INLINE void load (const uint32 *mem)
 Load values from memory into simd, 'mem' should point to memory with at least size() number of uint32.
 
JPL_INLINE void store (uint32 *mem) const
 Store values from simd to provided memory location.
 
template<uint32 LaneIndex>
requires (LaneIndex < 4)
JPL_INLINE uint32 get_lane () const noexcept
 Get float component by index known at compile-time.
 
JPL_INLINE bool all_of () const noexcept
 Test if all of the components are true.
 
JPL_INLINE bool any_of () const noexcept
 Test if any of the components are true.
 
JPL_INLINE bool none_of () const noexcept
 Test if none of the components are true.
 
JPL_INLINE int reduce_count () const noexcept
 Count the number of components that are true.
 
JPL_INLINE int reduce_min_index () const noexcept
 Get index of the first component that is true.
 
JPL_INLINE int reduce_max_index () const noexcept
 Get index of the last component that is true.
 
JPL_INLINE int GetTrues () const noexcept
 Store if [0] is true in bit 0, [1] in bit 1, [2] in bit 2 and [3] in bit 3.
 
JPL_INLINE simd_mask operator* (const simd_mask &other) const noexcept
 Component-wise multiplies each of the 4 integer components with an integer (discards any overflow)
 
JPL_INLINE simd_maskoperator*= (const simd_mask &other) noexcept
 Component-wise multiplies each of the 4 integer components with an integer (discards any overflow)
 
JPL_INLINE simd_mask operator+ (const simd_mask &other) const noexcept
 Component-wise add an integer value to all integer components (discards any overflow)
 
JPL_INLINE simd_maskoperator+= (const simd_mask &other) noexcept
 Component-wise add two integer vectors (component wise)
 
JPL_INLINE simd_mask operator- (const simd_mask &other) const noexcept
 Component-wise subtract two simd_mask vectors.
 
JPL_INLINE simd_maskoperator-= (const simd_mask &other) noexcept
 Component-wise subtract two simd_mask vectors.
 
JPL_INLINE simd_mask operator~ () const noexcept
 Component-wise logical NOT.
 
JPL_INLINE void operator|= (const simd_mask &other) noexcept
 Component-wise logical OR.
 
JPL_INLINE void operator^= (const simd_mask &other) noexcept
 Component-wise logical XOR.
 
JPL_INLINE void operator&= (const simd_mask &other) noexcept
 Component-wise logical AND.
 
JPL_INLINE simd_mask operator>> (const uint32 count) const noexcept
 
JPL_INLINE simd_mask operator<< (const uint32 count) const noexcept
 
template<uint Count>
requires (Count <= 31)
JPL_INLINE simd_mask shr () const noexcept
 
template<uint Count>
requires (Count <= 31)
JPL_INLINE simd_mask shl () const noexcept
 
template<uint Count>
requires (Count <= 31)
JPL_INLINE simd_mask ashr () const noexcept
 
JPL_INLINE simd_mask adds (const simd_mask &other) const noexcept
 
JPL_INLINE simd_mask subs (const simd_mask &other) const noexcept
 
JPL_INLINE operator Type () const noexcept
 
JPL_INLINE simd to_simd () const noexcept
 Convert each component from an int to a float.
 
JPL_INLINE simd as_simd () const noexcept
 Reinterpret simd_mask as a simd (doesn't change the bits)
 

Static Public Member Functions

static JPL_INLINE simd_mask replicate (int value) noexcept
 
static JPL_INLINE simd_mask replicate (uint32 value) noexcept
 
static JPL_INLINE simd_mask zero () noexcept
 
static constexpr std::size_t size () noexcept
 Get number of element of the vector.
 

Public Attributes

Type mNative
 

Static Public Attributes

static constexpr uint32 cTrueValue = 0xffffffffu
 Component set to this value is true.
 

Friends

std::ostream & operator<< (std::ostream &inStream, const simd_mask &vec)
 

Member Typedef Documentation

◆ Type

Constructor & Destructor Documentation

◆ simd_mask() [1/6]

JPL::simd_mask::simd_mask ( )
defaultnoexcept

◆ simd_mask() [2/6]

JPL::simd_mask::simd_mask ( const simd_mask )
defaultnoexcept

◆ simd_mask() [3/6]

JPL_INLINE JPL::simd_mask::simd_mask ( Type  value)
inlinenoexcept

◆ simd_mask() [4/6]

JPL_INLINE JPL::simd_mask::simd_mask ( uint32  value)
noexcept

◆ simd_mask() [5/6]

JPL_INLINE JPL::simd_mask::simd_mask ( uint32  v0,
uint32  v1,
uint32  v2,
uint32  v3 
)
noexcept

◆ simd_mask() [6/6]

JPL_INLINE JPL::simd_mask::simd_mask ( const uint32 mem)

Member Function Documentation

◆ adds()

JPL_INLINE simd_mask JPL::simd_mask::adds ( const simd_mask other) const
noexcept

◆ all_of()

JPL_INLINE bool JPL::simd_mask::all_of ( ) const
noexcept

Test if all of the components are true.

◆ any_of()

JPL_INLINE bool JPL::simd_mask::any_of ( ) const
noexcept

Test if any of the components are true.

◆ as_simd()

JPL_INLINE simd JPL::simd_mask::as_simd ( ) const
noexcept

Reinterpret simd_mask as a simd (doesn't change the bits)

◆ ashr()

template<uint Count>
requires (Count <= 31)
JPL_INLINE simd_mask JPL::simd_mask::ashr ( ) const
noexcept

◆ get_lane()

template<uint32 LaneIndex>
requires (LaneIndex < 4)
JPL_INLINE uint32 JPL::simd_mask::get_lane ( ) const
noexcept

Get float component by index known at compile-time.

◆ GetTrues()

JPL_INLINE int JPL::simd_mask::GetTrues ( ) const
noexcept

Store if [0] is true in bit 0, [1] in bit 1, [2] in bit 2 and [3] in bit 3.

◆ load()

JPL_INLINE void JPL::simd_mask::load ( const uint32 mem)

Load values from memory into simd, 'mem' should point to memory with at least size() number of uint32.

◆ none_of()

JPL_INLINE bool JPL::simd_mask::none_of ( ) const
noexcept

Test if none of the components are true.

◆ operator Type()

JPL_INLINE JPL::simd_mask::operator Type ( ) const
inlinenoexcept

◆ operator&=()

JPL_INLINE void JPL::simd_mask::operator&= ( const simd_mask other)
noexcept

Component-wise logical AND.

◆ operator*()

JPL_INLINE simd_mask JPL::simd_mask::operator* ( const simd_mask other) const
noexcept

Component-wise multiplies each of the 4 integer components with an integer (discards any overflow)

◆ operator*=()

JPL_INLINE simd_mask & JPL::simd_mask::operator*= ( const simd_mask other)
noexcept

Component-wise multiplies each of the 4 integer components with an integer (discards any overflow)

◆ operator+()

JPL_INLINE simd_mask JPL::simd_mask::operator+ ( const simd_mask other) const
noexcept

Component-wise add an integer value to all integer components (discards any overflow)

◆ operator+=()

JPL_INLINE simd_mask & JPL::simd_mask::operator+= ( const simd_mask other)
noexcept

Component-wise add two integer vectors (component wise)

◆ operator-()

JPL_INLINE simd_mask JPL::simd_mask::operator- ( const simd_mask other) const
noexcept

Component-wise subtract two simd_mask vectors.

◆ operator-=()

JPL_INLINE simd_mask & JPL::simd_mask::operator-= ( const simd_mask other)
noexcept

Component-wise subtract two simd_mask vectors.

◆ operator<<()

JPL_INLINE simd_mask JPL::simd_mask::operator<< ( const uint32  count) const
noexcept

◆ operator=()

simd_mask & JPL::simd_mask::operator= ( const simd_mask )
defaultnoexcept

◆ operator>>()

JPL_INLINE simd_mask JPL::simd_mask::operator>> ( const uint32  count) const
noexcept

◆ operator^=()

JPL_INLINE void JPL::simd_mask::operator^= ( const simd_mask other)
noexcept

Component-wise logical XOR.

◆ operator|=()

JPL_INLINE void JPL::simd_mask::operator|= ( const simd_mask other)
noexcept

Component-wise logical OR.

◆ operator~()

JPL_INLINE simd_mask JPL::simd_mask::operator~ ( ) const
noexcept

Component-wise logical NOT.

◆ reduce_count()

JPL_INLINE int JPL::simd_mask::reduce_count ( ) const
noexcept

Count the number of components that are true.

◆ reduce_max_index()

JPL_INLINE int JPL::simd_mask::reduce_max_index ( ) const
noexcept

Get index of the last component that is true.

◆ reduce_min_index()

JPL_INLINE int JPL::simd_mask::reduce_min_index ( ) const
noexcept

Get index of the first component that is true.

◆ replicate() [1/2]

JPL_INLINE simd_mask JPL::simd_mask::replicate ( int  value)
staticnoexcept

◆ replicate() [2/2]

JPL_INLINE simd_mask JPL::simd_mask::replicate ( uint32  value)
staticnoexcept

◆ shl()

template<uint Count>
requires (Count <= 31)
JPL_INLINE simd_mask JPL::simd_mask::shl ( ) const
noexcept

◆ shr()

template<uint Count>
requires (Count <= 31)
JPL_INLINE simd_mask JPL::simd_mask::shr ( ) const
noexcept

◆ size()

static constexpr std::size_t JPL::simd_mask::size ( )
inlinestaticconstexprnoexcept

Get number of element of the vector.

◆ store()

JPL_INLINE void JPL::simd_mask::store ( uint32 mem) const

Store values from simd to provided memory location.

◆ subs()

JPL_INLINE simd_mask JPL::simd_mask::subs ( const simd_mask other) const
noexcept

◆ to_simd()

JPL_INLINE simd JPL::simd_mask::to_simd ( ) const
noexcept

Convert each component from an int to a float.

◆ zero()

JPL_INLINE simd_mask JPL::simd_mask::zero ( )
staticnoexcept

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  inStream,
const simd_mask vec 
)
friend

Member Data Documentation

◆ cTrueValue

constexpr uint32 JPL::simd_mask::cTrueValue = 0xffffffffu
inlinestaticconstexpr

Component set to this value is true.

◆ mNative

Type JPL::simd_mask::mNative

The documentation for this struct was generated from the following file: