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

data representation and operations on a vector of 8 signed long long. More...

#include <generic8.h>

Public Member Functions

 svec ()
 Default constructor,. More...
 
 svec (int64_t a, int64_t b, int64_t c, int64_t d, int64_t e, int64_t f, int64_t g, int64_t h)
 Constructor. More...
 
 svec (int64_t a)
 Constructor. More...
 
int64_t & operator[] (int index)
 operator [] to set or get the vector element specified by index. More...
 
const int64_t operator[] (int index) const
 
svec< 8,bool > operator== (svec< 8, int64_t > a)
 Element-wise compare equal, return a bool vector, e.g., "a == b" *. More...
 
svec< 8,bool > operator!= (svec< 8, int64_t > a)
 Element-wise compare not equal, return a bool vector. E.g. "a != b" *. More...
 
svec< 8,bool > operator< (svec< 8, int64_t > a)
 Element-wise compare less than, return a bool vector. E.g. "a < b" *. More...
 
svec< 8,bool > operator<= (svec< 8, int64_t > a)
 Element-wise compare less equal, return a bool vector. E.g. "a <= b" *. More...
 
svec< 8,bool > operator> (svec< 8, int64_t > a)
 Element-wise compare greater than, return a bool vector. E.g. "a > b" *. More...
 
svec< 8,bool > operator>= (svec< 8, int64_t > a)
 Element-wise compare greater equal, return a bool vector. E.g. "a >= b" *. More...
 
svec< 8, int64_t > operator- ()
 get the neg value, return a VTYPE vector. E.g. "-a" More...
 
int64_t reduce_add ()
 Get the sum of all the element values in the vector. return a int64_t scalar. More...
 
int64_t reduce_max ()
 Get the max value of all the element values in the vector. return a int64_t scalar. More...
 
int64_t reduce_min ()
 Get the min value of all the element values in the vector. return a int64_t scalar. More...
 
svec< 8, int64_t > operator+ (svec< 8, int64_t > a)
 Add two vectors. More...
 
svec< 8, int64_t > operator+ (int64_t s)
 Add a vector and a scalar. More...
 
svec< 8, int64_t > operator- (svec< 8, int64_t > a)
 Sub two vectors. More...
 
svec< 8, int64_t > operator- (int64_t s)
 Sub a vector and a scalar. More...
 
svec< 8, int64_t > operator* (svec< 8, int64_t > a)
 Multiply two vectors. More...
 
svec< 8, int64_t > operator* (int64_t s)
 Multiply a vector and a scalar. More...
 
svec< 8, int64_t > operator/ (svec< 8, int64_t > a)
 Divide a vector by a vector. More...
 
svec< 8, int64_t > operator/ (int64_t s)
 Divide a vector by a scalar. More...
 
void store (svec< 8, int64_t > *p)
 Store the vector to address p. More...
 
void masked_store (svec< 8, int64_t > *p, svec< 8, bool > mask)
 Store the vector element's value to pointer p if the mask element is true. More...
 
void scatter (svec< 8, void * > ptrs, svec< 8, 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 (int64_t *b, uint32_t scale, svec< 8, int32_t > offsets, svec< 8, 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 (int64_t *b, uint32_t scale, svec< 8, int64_t > offsets, svec< 8, bool > mask)
 Scatter the vector's elements to the addresses ((char*)b + scale * offsets) if the mask element is true. More...
 
void scatter_stride (int64_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 (int64_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< 8, int64_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< 8, int64_t > rotate (int32_t index)
 Return a new vector by rotate this vector's elements. e.g. newVec[i] = thisVec[i+index]. More...
 
svec< 8, int64_t > shuffle (svec< 8, 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< 8, int64_t > abs ()
 Return a new vector of the vector's abs value. More...
 
svec< 8, int64_t > operator| (svec< 8, int64_t > a)
 Or operator. E.g. "a | b". More...
 
svec< 8, int64_t > operator& (svec< 8, int64_t > a)
 And operator. E.g. "a & b". More...
 
svec< 8, int64_t > operator^ (svec< 8, int64_t > a)
 Xor operator. E.g. "a ^ b". More...
 
svec< 8, int64_t > operator<< (svec< 8, uint64_t > a)
 Left shift operator. E.g. "a << b".The b must be unsigned vector. More...
 
svec< 8, int64_t > operator<< (int32_t s)
 Left shift operator by a scalar. E.g. "a << 5". More...
 
svec< 8, int64_t > operator>> (svec< 8, uint64_t > a)
 Right shift operator. E.g. "a >> b".The b must be unsigned vector. More...
 
svec< 8, int64_t > operator>> (int32_t s)
 Right shift operator by a scalar. E.g. "a >> 5". More...
 
svec< 8, int64_t > operator% (svec< 8, int64_t > a)
 Remainder operator on a vector. E.g. "a % b". More...
 
svec< 8, int64_t > operator% (int64_t s)
 Remainder operator on a scalar. E.g. "a % 5". More...
 

Static Public Member Functions

static svec< 8, int64_t > load (svec< 8, int64_t > *p)
 load the vector from the pointer p More...
 
static svec< 8, int64_t > masked_load (svec< 8, int64_t > *p, svec< 8, bool > mask)
 Return a new vector by only loading the value from the pointer p if the mask element is true. More...
 
static svec< 8, int64_t > load_const (const int64_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< 8, int64_t > load_and_splat (int64_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< 8, int64_t > gather (svec< 8, void * > ptrs, svec< 8, bool > mask)
 Gather the elements pointed by the vector ptrs if the mask element is true, and return a vector. More...
 
static svec< 8, int64_t > gather_base_offsets (int64_t *b, uint32_t scale, svec< 8, int32_t > offsets, svec< 8, 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< 8, int64_t > gather_base_offsets (int64_t *b, uint32_t scale, svec< 8, int64_t > offsets, svec< 8, 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< 8, int64_t > gather_stride (int64_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< 8, int64_t > gather_stride (int64_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

int64_t v [8]
 

Friends

std::ostream & operator<< (std::ostream &out, const svec< 8, int64_t > &v)
 

Detailed Description

template<>
struct generic::svec< 8, int64_t >

data representation and operations on a vector of 8 signed long long.

Constructor & Destructor Documentation

generic::svec< 8, int64_t >::svec ( )

Default constructor,.

Returns
a vector of 8 undefined signed long long.
generic::svec< 8, int64_t >::svec ( int64_t  a,
int64_t  b,
int64_t  c,
int64_t  d,
int64_t  e,
int64_t  f,
int64_t  g,
int64_t  h 
)

Constructor.

Returns
a vector of 8 signed long long: {a,b,c,d,e,f,g,h}.
generic::svec< 8, int64_t >::svec ( int64_t  a)

Constructor.

Parameters
aa signed long long
Returns
a vector of 8 signed long long: {a,a,a,a,a,a,a,a}.

Member Function Documentation

svec< 8, int64_t > generic::svec< 8, int64_t >::abs ( )

Return a new vector of the vector's abs value.

svec< 8, int64_t > generic::svec< 8, int64_t >::broadcast ( int32_t  index)

Return a new vector by setting all the elements of the new vector with this vector's index element.

svec< 8, int64_t > generic::svec< 8, int64_t >::gather ( svec< 8, void * >  ptrs,
svec< 8, bool >  mask 
)
static

Gather the elements pointed by the vector ptrs if the mask element is true, and return a vector.

svec< 8, int64_t > generic::svec< 8, int64_t >::gather_base_offsets ( int64_t *  b,
uint32_t  scale,
svec< 8, int32_t >  offsets,
svec< 8, bool >  mask 
)
static

Gather the elements pointed by calculating the addresses ((char*)b + scale * offsets) if the mask element is true, and return a vector.

svec< 8, int64_t > generic::svec< 8, int64_t >::gather_base_offsets ( int64_t *  b,
uint32_t  scale,
svec< 8, int64_t >  offsets,
svec< 8, bool >  mask 
)
static

Gather the elements pointed by calculating the addresses ((char*)b + scale * offsets) if the mask element is true, and return a vector.

svec< 8, int64_t > generic::svec< 8, int64_t >::gather_stride ( int64_t *  b,
int32_t  off,
int32_t  stride 
)
static

Gather the elements pointed by (b+off, b++off+stride, b+off+2*stride, b+off+3*step).

svec< 8, int64_t > generic::svec< 8, int64_t >::gather_stride ( int64_t *  b,
int64_t  off,
int64_t  stride 
)
static

Gather the elements pointed by (b+off, b++off+stride, b+off+2*stride, b+off+3*step).

svec< 8, int64_t > generic::svec< 8, int64_t >::load ( svec< 8, int64_t > *  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.
svec< 8, int64_t > generic::svec< 8, int64_t >::load_and_splat ( int64_t *  p)
static

Construct a vector by loading a scalar value from pointer p, and splat it to all the elements in the vector.

svec< 8, int64_t > generic::svec< 8, int64_t >::load_const ( const int64_t *  p)
static

Construct a vector by loading a scalar value from pointer p, and splat it to all the elements in the vector.

svec< 8, int64_t > generic::svec< 8, int64_t >::masked_load ( svec< 8, int64_t > *  p,
svec< 8, bool >  mask 
)
static

Return a new vector by only loading the value from the pointer p if the mask element is true.

void generic::svec< 8, int64_t >::masked_store ( svec< 8, int64_t > *  p,
svec< 8, bool >  mask 
)

Store the vector element's value to pointer p if the mask element is true.

svec< 8,bool > generic::svec< 8, int64_t >::operator!= ( svec< 8, int64_t >  a)

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

  • Parameters
    [in]aa vector *
    Returns
    the result of compare not equal as a boolean vector.
svec< 8, int64_t > generic::svec< 8, int64_t >::operator% ( svec< 8, int64_t >  a)

Remainder operator on a vector. E.g. "a % b".

svec< 8, int64_t > generic::svec< 8, int64_t >::operator% ( int64_t  s)

Remainder operator on a scalar. E.g. "a % 5".

svec< 8, int64_t > generic::svec< 8, int64_t >::operator& ( svec< 8, int64_t >  a)

And operator. E.g. "a & b".

svec< 8, int64_t > generic::svec< 8, int64_t >::operator* ( int64_t  s)

Multiply a vector and a scalar.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator* ( svec< 8, int64_t >  a)

Multiply two vectors.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator+ ( svec< 8, int64_t >  a)

Add two vectors.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator+ ( int64_t  s)

Add a vector and a scalar.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator- ( int64_t  s)

Sub a vector and a scalar.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator- ( )

get the neg value, return a VTYPE vector. E.g. "-a"

svec< 8, int64_t > generic::svec< 8, int64_t >::operator- ( svec< 8, int64_t >  a)

Sub two vectors.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator/ ( svec< 8, int64_t >  a)

Divide a vector by a vector.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator/ ( int64_t  s)

Divide a vector by a scalar.

svec< 8,bool > generic::svec< 8, int64_t >::operator< ( svec< 8, int64_t >  a)

Element-wise compare less than, return a bool vector. E.g. "a < b" *.

  • Parameters
    [in]aa vector *
    Returns
    the result of compare less than as a boolean vector.
svec< 8, int64_t > generic::svec< 8, int64_t >::operator<< ( int32_t  s)

Left shift operator by a scalar. E.g. "a << 5".

svec< 8, int64_t > generic::svec< 8, int64_t >::operator<< ( svec< 8, uint64_t >  a)

Left shift operator. E.g. "a << b".The b must be unsigned vector.

svec< 8,bool > generic::svec< 8, int64_t >::operator<= ( svec< 8, int64_t >  a)

Element-wise compare less equal, return a bool vector. E.g. "a <= b" *.

  • Parameters
    [in]aa vector *
    Returns
    the result of compare less equal as a boolean vector.
svec< 8,bool > generic::svec< 8, int64_t >::operator== ( svec< 8, int64_t >  a)

Element-wise compare equal, return a bool vector, e.g., "a == b" *.

  • Parameters
    [in]aa vector *
    Returns
    the result of compare equal as a boolean vector.
svec< 8,bool > generic::svec< 8, int64_t >::operator> ( svec< 8, int64_t >  a)

Element-wise compare greater than, return a bool vector. E.g. "a > b" *.

  • Parameters
    [in]aa vector *
    Returns
    the result of compare greater than as a boolean vector.
svec< 8,bool > generic::svec< 8, int64_t >::operator>= ( svec< 8, int64_t >  a)

Element-wise compare greater equal, return a bool vector. E.g. "a >= b" *.

  • Parameters
    [in]aa vector *
    Returns
    the result of compare greater equal as a boolean vector.
svec< 8, int64_t > generic::svec< 8, int64_t >::operator>> ( svec< 8, uint64_t >  a)

Right shift operator. E.g. "a >> b".The b must be unsigned vector.

svec< 8, int64_t > generic::svec< 8, int64_t >::operator>> ( int32_t  s)

Right shift operator by a scalar. E.g. "a >> 5".

const int64_t generic::svec< 8, int64_t >::operator[] ( int  index) const
int64_t & generic::svec< 8, int64_t >::operator[] ( int  index)

operator [] to set or get the vector element specified by index.

Parameters
indexspecifies the index of the element in the vector.
svec< 8, int64_t > generic::svec< 8, int64_t >::operator^ ( svec< 8, int64_t >  a)

Xor operator. E.g. "a ^ b".

svec< 8, int64_t > generic::svec< 8, int64_t >::operator| ( svec< 8, int64_t >  a)

Or operator. E.g. "a | b".

int64_t generic::svec< 8, int64_t >::reduce_add ( )

Get the sum of all the element values in the vector. return a int64_t scalar.

int64_t generic::svec< 8, int64_t >::reduce_max ( )

Get the max value of all the element values in the vector. return a int64_t scalar.

int64_t generic::svec< 8, int64_t >::reduce_min ( )

Get the min value of all the element values in the vector. return a int64_t scalar.

svec< 8, int64_t > generic::svec< 8, int64_t >::rotate ( int32_t  index)

Return a new vector by rotate this vector's elements. e.g. newVec[i] = thisVec[i+index].

void generic::svec< 8, int64_t >::scatter ( svec< 8, void * >  ptrs,
svec< 8, bool >  mask 
)

Scatter the vector's elements to the locations pointed by the vector ptrs if the mask element is true.

void generic::svec< 8, int64_t >::scatter_base_offsets ( int64_t *  b,
uint32_t  scale,
svec< 8, int32_t >  offsets,
svec< 8, bool >  mask 
)

Scatter the vector's elements to the addresses ((char*)b + scale * offsets) if the mask element is true.

void generic::svec< 8, int64_t >::scatter_base_offsets ( int64_t *  b,
uint32_t  scale,
svec< 8, int64_t >  offsets,
svec< 8, bool >  mask 
)

Scatter the vector's elements to the addresses ((char*)b + scale * offsets) if the mask element is true.

void generic::svec< 8, int64_t >::scatter_stride ( int64_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).

void generic::svec< 8, int64_t >::scatter_stride ( int64_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).

svec< 8, int64_t > generic::svec< 8, int64_t >::shuffle ( svec< 8, int32_t >  index)

Return a new vector by shuffle this vector's elements with index vector e.g. newVec[i] = thisVec[index[i]].

void generic::svec< 8, int64_t >::store ( svec< 8, int64_t > *  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< 8, int64_t > &  v 
)
friend

Member Data Documentation

int64_t generic::svec< 8, int64_t >::v[8]

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