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

data representation and operations on a vector of 4 pointers. This is only used in gather and scatter. More...

#include <sse4.h>

Inheritance diagram for sse::svec< 4, void * >:
sse::svec< 4, uint32_t >

Public Member Functions

 svec (void *p0, void *p1, void *p2, void *p3)
 Constructor. More...
 
- Public Member Functions inherited from sse::svec< 4, uint32_t >
 svec ()
 Default constructor. 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...
 
 operator __m128 () const
 transform svec<4,int32_t> into _m128 float vector More...
 
uint32_t & operator[] (int index)
 operator [] to set or get the vector element specified by index. More...
 
const uint32_t operator[] (int index) const
 
svec< 4,bool > operator== (svec< 4, uint32_t > a)
 Element-wise compare equal, return a bool vector, e.g., "a == b" *. More...
 
svec< 4,bool > operator!= (svec< 4, uint32_t > a)
 Element-wise compare not equal, return a bool vector. E.g. "a != b" *. More...
 
svec< 4,bool > operator< (svec< 4, uint32_t > a)
 Element-wise compare less than, return a bool vector. E.g. "a < b" *. More...
 
svec< 4,bool > operator<= (svec< 4, uint32_t > a)
 Element-wise compare less equal, return a bool vector. E.g. "a <= b" *. More...
 
svec< 4,bool > operator> (svec< 4, uint32_t > a)
 Element-wise compare greater than, return a bool vector. E.g. "a > b" *. More...
 
svec< 4,bool > operator>= (svec< 4, uint32_t > a)
 Element-wise compare greater equal, return a bool vector. E.g. "a >= b" *. More...
 
svec< 4, uint32_t > operator- ()
 get the neg value, return a VTYPE vector. E.g. "-a" More...
 
uint32_t reduce_add ()
 Get the sum of all the element values in the vector. return a uint32_t scalar. More...
 
uint32_t reduce_max ()
 Get the max value of all the element values in the vector. return a uint32_t scalar. More...
 
uint32_t reduce_min ()
 Get the min value of all the element values in the vector. return a uint32_t scalar. More...
 
svec< 4, uint32_t > operator+ (svec< 4, uint32_t > a)
 Add two vectors. More...
 
svec< 4, uint32_t > operator+ (uint32_t s)
 Add a vector and a scalar. More...
 
svec< 4, uint32_t > operator- (svec< 4, uint32_t > a)
 Sub two vectors. More...
 
svec< 4, uint32_t > operator- (uint32_t s)
 Sub a vector and a scalar. More...
 
svec< 4, uint32_t > operator* (svec< 4, uint32_t > a)
 Multiply two vectors. More...
 
svec< 4, uint32_t > operator* (uint32_t s)
 Multiply a vector and a scalar. More...
 
svec< 4, uint32_t > operator/ (svec< 4, uint32_t > a)
 Divide a vector by a vector. More...
 
svec< 4, uint32_t > operator/ (uint32_t s)
 Divide a vector by a scalar. More...
 
void store (svec< 4, uint32_t > *p)
 Store the vector to address p. More...
 
void masked_store (svec< 4, uint32_t > *p, svec< 4, bool > mask)
 Store the vector element's value to pointer p if the mask element is true. More...
 
void scatter (svec< 4, void * > ptrs, svec< 4, bool > mask)
 Scatter the vector's elements to the locations pointed by the vector ptrs if the mask element is true. More...
 
void scatter_base_offsets (uint32_t *b, uint32_t scale, svec< 4, int32_t > offsets, svec< 4, bool > mask)
 Scatter the vector's elements to the addresses ((char*)b + scale * offsets) if the mask element is true. More...
 
void scatter_base_offsets (uint32_t *b, uint32_t scale, svec< 4, int64_t > offsets, svec< 4, bool > mask)
 Scatter the vector's elements to the addresses ((char*)b + scale * offsets) if the mask element is true. More...
 
void scatter_stride (uint32_t *b, int32_t off, int32_t stride)
 Scatter the vector's elements to the addresses (b+off, b++off+stride, b+off+2*stride, b+off+3*step). More...
 
void scatter_stride (uint32_t *b, int64_t off, int64_t stride)
 Scatter the vector's elements to the addresses (b+off, b++off+stride, b+off+2*stride, b+off+3*step). More...
 
svec< 4, uint32_t > broadcast (int32_t index)
 Return a new vector by setting all the elements of the new vector with this vector's index element. More...
 
svec< 4, uint32_t > rotate (int32_t index)
 Return a new vector by rotate this vector's elements. e.g. newVec[i] = thisVec[i+index]. More...
 
svec< 4, uint32_t > shuffle (svec< 4, int32_t > index)
 Return a new vector by shuffle this vector's elements with index vector e.g. newVec[i] = thisVec[index[i]]. More...
 
svec< 4, uint32_t > abs ()
 Return a new vector of the vector's abs value. More...
 
svec< 4, uint32_t > operator| (svec< 4, uint32_t > a)
 Or operator. E.g. "a | b". More...
 
svec< 4, uint32_t > operator& (svec< 4, uint32_t > a)
 And operator. E.g. "a & b". More...
 
svec< 4, uint32_t > operator^ (svec< 4, uint32_t > a)
 Xor operator. E.g. "a ^ b". More...
 
svec< 4, uint32_t > operator<< (svec< 4, uint32_t > a)
 Left shift operator. E.g. "a << b".The b must be unsigned vector. More...
 
svec< 4, uint32_t > operator<< (int32_t s)
 Left shift operator by a scalar. E.g. "a << 5". More...
 
svec< 4, uint32_t > operator>> (svec< 4, uint32_t > a)
 Right shift operator. E.g. "a >> b".The b must be unsigned vector. More...
 
svec< 4, uint32_t > operator>> (int32_t s)
 Right shift operator by a scalar. E.g. "a >> 5". More...
 
svec< 4, uint32_t > operator% (svec< 4, uint32_t > a)
 Remainder operator on a vector. E.g. "a % b". More...
 
svec< 4, uint32_t > operator% (uint32_t s)
 Remainder operator on a scalar. E.g. "a % 5". More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sse::svec< 4, uint32_t >
static svec< 4, uint32_t > load (svec< 4, uint32_t > *p)
 load the vector from the pointer p More...
 
static svec< 4, uint32_t > masked_load (svec< 4, uint32_t > *p, svec< 4, bool > mask)
 Return a new vector by only loading the value from the pointer p if the mask element is true. More...
 
static svec< 4, uint32_t > load_const (const uint32_t *p)
 Construct a vector by loading a scalar value from pointer p, and splat it to all the elements in the vector. More...
 
static svec< 4, uint32_t > load_and_splat (uint32_t *p)
 Construct a vector by loading a scalar value from pointer p, and splat it to all the elements in the vector. More...
 
static svec< 4, uint32_t > gather (svec< 4, void * > ptrs, svec< 4, bool > mask)
 Gather the elements pointed by the vector ptrs if the mask element is true, and return a vector. More...
 
static svec< 4, uint32_t > gather_base_offsets (uint32_t *b, uint32_t scale, svec< 4, int32_t > offsets, svec< 4, bool > mask)
 Gather the elements pointed by calculating the addresses ((char*)b + scale * offsets) if the mask element is true, and return a vector. More...
 
static svec< 4, uint32_t > gather_base_offsets (uint32_t *b, uint32_t scale, svec< 4, int64_t > offsets, svec< 4, bool > mask)
 Gather the elements pointed by calculating the addresses ((char*)b + scale * offsets) if the mask element is true, and return a vector. More...
 
static svec< 4, uint32_t > gather_stride (uint32_t *b, int32_t off, int32_t stride)
 Gather the elements pointed by (b+off, b++off+stride, b+off+2*stride, b+off+3*step). More...
 
static svec< 4, uint32_t > gather_stride (uint32_t *b, int64_t off, int64_t stride)
 Gather the elements pointed by (b+off, b++off+stride, b+off+2*stride, b+off+3*step). More...
 
- Public Attributes inherited from sse::svec< 4, uint32_t >
__m128i v
 

Detailed Description

template<>
struct sse::svec< 4, void * >

data representation and operations on a vector of 4 pointers. This is only used in gather and scatter.

including gather general/gather base offsets, scatter general, scatter base offsets

Here, we will define a special compile time dependent type for ptrs vector

Note
In 32bit platform, svec<4,void*> extends svec<4,uint32_t>, while in 64bit platform, svec<4,void*> extends svec<4,uint64_t>.
See Also
gather and scatter

Constructor & Destructor Documentation

sse::svec< 4, void * >::svec ( void *  p0,
void *  p1,
void *  p2,
void *  p3 
)

Constructor.

Returns
a vector of 4 pointers: {p0, p1, p2, p3}.

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