Generic SIMD Intrinsic Library API  0.6
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
sse::svec< 4, bool > Struct Template Reference

Data representation and operations on a vector of 4 boolean values. This is used in predicated vector operations. Specifically the ith value of svec<4,bool> indicates whether the ith lane of a predicated vector operation is enabled or not. More...

#include <sse4.h>

Classes

struct  Helper
 A special helper class to support customized subscript[] operations. More...
 

Public Member Functions

 svec ()
 Default constructor. More...
 
 svec (__m128 vv)
 For internal use only. More...
 
 svec (__m128i vv)
 For internal use only. More...
 
 svec (uint32_t a, uint32_t b, uint32_t c, uint32_t d)
 Constructor. More...
 
 svec (uint32_t a)
 Constructor. More...
 
Helper operator[] (int index)
 
const uint32_t operator[] (int index) const
 
svec< 4,bool > operator== (svec< 4, bool > a)
 Element-wise compare equal. E.g., "a == b". More...
 
svec< 4,bool > operator!= (svec< 4, bool > a)
 Element-wise compare not equal, return a bool vector. E.g. "a != b". More...
 
void store (svec< 4, bool > *p)
 Store the vector to address p. More...
 
bool any_true ()
 Check if any element in the mask vector is true. More...
 
bool all_true ()
 Check if all the elements in the mask vector is true. More...
 
bool none_true ()
 Check all the elements in the mask vector is false. More...
 
svec< 4,bool > operator| (svec< 4, bool >)
 Element-wise bit-wise OR operator. E.g., "a | b". More...
 
svec< 4,bool > operator& (svec< 4, bool > a)
 Element-wise bit-wise AND operator. E.g., "a & b". More...
 
svec< 4,bool > operator^ (svec< 4, bool > a)
 Element-wise bit-wise XOR operator. E.g., "a ^ b". More...
 
svec< 4,bool > operator~ ()
 Element-wise bit-wise compliment operator. E.g., "~a". More...
 
svec< 4,bool > operator! ()
 Element-wise bit-wise not operator. E.g., "!a". More...
 
svec< 4,bool > operator&& (svec< 4, bool > a)
 Element-wise boolean AND operator. E.g., "a && b". More...
 
svec< 4,bool > operator|| (svec< 4, bool > a)
 Element-wise boolean OR operator. E.g., "a || b". More...
 

Static Public Member Functions

static svec< 4,bool > load (svec< 4, bool > *p)
 load the vector from the pointer p More...
 

Public Attributes

__m128 v
 

Friends

std::ostream & operator<< (std::ostream &out, const svec< 4, bool > &v)
 

Detailed Description

template<>
struct sse::svec< 4, bool >

Data representation and operations on a vector of 4 boolean values. This is used in predicated vector operations. Specifically the ith value of svec<4,bool> indicates whether the ith lane of a predicated vector operation is enabled or not.

See also gather, scatter, load, store, and compare operations.

Constructor & Destructor Documentation

sse::svec< 4, bool >::svec ( )

Default constructor.

Returns
a vector of 4 undefined values.
sse::svec< 4, bool >::svec ( __m128  vv)

For internal use only.

Parameters
[in]vva __m128 valye.
Returns
a mask vector whose value is from the vv.
sse::svec< 4, bool >::svec ( __m128i  vv)

For internal use only.

Parameters
[in]vva __m128i valye.
Returns
a mask vector whose value is from the vv.
sse::svec< 4, bool >::svec ( uint32_t  a,
uint32_t  b,
uint32_t  c,
uint32_t  d 
)

Constructor.

Parameters
[in]a,b,c,dboolean values
Note
a,b,c,d must be either 0 or -1
Returns
a vector of 4 mask/booleans: {a,b,c,d}.
sse::svec< 4, bool >::svec ( uint32_t  a)

Constructor.

Parameters
[in]aa boolean value
Note
a must be either 0 or -1
Returns
a vector of 4 mask/booleans: {a,a,a,a}.

Member Function Documentation

bool sse::svec< 4, bool >::all_true ( )

Check if all the elements in the mask vector is true.

Note
This is a reduction operation that returns a scalar value.
Returns
true if all the elements in the mask vector are true, otherwise false.
bool sse::svec< 4, bool >::any_true ( )

Check if any element in the mask vector is true.

Note
This is a reduction operation that returns a scalar value.
Returns
true if at least one element in the mask vector is true, otherwise false
svec< 4, bool > sse::svec< 4, bool >::load ( svec< 4, bool > *  p)
static

load the vector from the pointer p

Parameters
[in]pload address
Note
p does not have to be aligned
Returns
no return value. This vector is updated with value loaded from p.
bool sse::svec< 4, bool >::none_true ( )

Check all the elements in the mask vector is false.

Note
This is a reduction operation that returns a scalar value.
Returns
true if all the elements in the mask vector are false, otherwise false.
svec< 4, bool > sse::svec< 4, bool >::operator! ( )

Element-wise bit-wise not operator. E.g., "!a".

Returns
the result of bit-wise compliment as a boolean vector.
svec< 4, bool > sse::svec< 4, bool >::operator!= ( svec< 4, bool >  a)

Element-wise compare not equal, return a bool vector. E.g. "a != b".

Parameters
[in]aa boolean vector
Returns
the result of compare-not-equal as a boolean vector
svec< 4, bool > sse::svec< 4, bool >::operator& ( svec< 4, bool >  a)

Element-wise bit-wise AND operator. E.g., "a & b".

Parameters
[in]aa boolean vector
Returns
the result of bit-wise AND as a boolean vector.
svec< 4, bool > sse::svec< 4, bool >::operator&& ( svec< 4, bool >  a)

Element-wise boolean AND operator. E.g., "a && b".

Parameters
[in]aa boolean vector
Returns
the result of boolean AND as a boolean vector.
svec< 4, bool > sse::svec< 4, bool >::operator== ( svec< 4, bool >  a)

Element-wise compare equal. E.g., "a == b".

Parameters
[in]aa boolean vector
Returns
the result of compare-equal as a boolean vector
Helper sse::svec< 4, bool >::operator[] ( int  index)
const uint32_t sse::svec< 4, bool >::operator[] ( int  index) const
svec< 4, bool > sse::svec< 4, bool >::operator^ ( svec< 4, bool >  a)

Element-wise bit-wise XOR operator. E.g., "a ^ b".

Parameters
[in]aa boolean vector
Returns
the result of bit-wise XOR as a boolean vector.
svec< 4, bool > sse::svec< 4, bool >::operator| ( svec< 4, bool >  a)

Element-wise bit-wise OR operator. E.g., "a | b".

Parameters
[in]aa boolean vector
Returns
the result of bit-wise OR as a boolean vector.
svec< 4, bool > sse::svec< 4, bool >::operator|| ( svec< 4, bool >  a)

Element-wise boolean OR operator. E.g., "a || b".

Parameters
[in]aa boolean vector
Returns
the result of boolean OR as a boolean vector.
svec< 4, bool > sse::svec< 4, bool >::operator~ ( )

Element-wise bit-wise compliment operator. E.g., "~a".

Returns
the result of bit-wise compliment as a boolean vector.
void sse::svec< 4, bool >::store ( svec< 4, bool > *  p)

Store the vector to address p.

Parameters
[in]pstore address
Note
p does not have to be aligned

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const svec< 4, bool > &  v 
)
friend

Member Data Documentation

__m128 sse::svec< 4, bool >::v

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