|
Generic SIMD Intrinsic Library API
0.6
|
data representation and operations on a vector of 4 signed chars. More...
#include <generic4.h>
Public Member Functions | |
| svec () | |
| Default constructor. More... | |
| svec (int8_t a, int8_t b, int8_t c, int8_t d) | |
| Constructor. More... | |
| svec (int8_t a) | |
| Constructor. More... | |
| int8_t & | operator[] (int index) |
| operator [] to set or get the vector element specified by index. More... | |
| const int8_t | operator[] (int index) const |
| svec< 4,bool > | operator== (svec< 4, int8_t > a) |
| Element-wise compare equal, return a bool vector, e.g., "a == b" *. More... | |
| svec< 4,bool > | operator!= (svec< 4, int8_t > a) |
| Element-wise compare not equal, return a bool vector. E.g. "a != b" *. More... | |
| svec< 4,bool > | operator< (svec< 4, int8_t > a) |
| Element-wise compare less than, return a bool vector. E.g. "a < b" *. More... | |
| svec< 4,bool > | operator<= (svec< 4, int8_t > a) |
| Element-wise compare less equal, return a bool vector. E.g. "a <= b" *. More... | |
| svec< 4,bool > | operator> (svec< 4, int8_t > a) |
| Element-wise compare greater than, return a bool vector. E.g. "a > b" *. More... | |
| svec< 4,bool > | operator>= (svec< 4, int8_t > a) |
| Element-wise compare greater equal, return a bool vector. E.g. "a >= b" *. More... | |
| svec< 4, int8_t > | operator- () |
| get the neg value, return a VTYPE vector. E.g. "-a" More... | |
| int8_t | reduce_add () |
| Get the sum of all the element values in the vector. return a int8_t scalar. More... | |
| int8_t | reduce_max () |
| Get the max value of all the element values in the vector. return a int8_t scalar. More... | |
| int8_t | reduce_min () |
| Get the min value of all the element values in the vector. return a int8_t scalar. More... | |
| svec< 4, int8_t > | operator+ (svec< 4, int8_t > a) |
| Add two vectors. More... | |
| svec< 4, int8_t > | operator+ (int8_t s) |
| Add a vector and a scalar. More... | |
| svec< 4, int8_t > | operator- (svec< 4, int8_t > a) |
| Sub two vectors. More... | |
| svec< 4, int8_t > | operator- (int8_t s) |
| Sub a vector and a scalar. More... | |
| svec< 4, int8_t > | operator* (svec< 4, int8_t > a) |
| Multiply two vectors. More... | |
| svec< 4, int8_t > | operator* (int8_t s) |
| Multiply a vector and a scalar. More... | |
| svec< 4, int8_t > | operator/ (svec< 4, int8_t > a) |
| Divide a vector by a vector. More... | |
| svec< 4, int8_t > | operator/ (int8_t s) |
| Divide a vector by a scalar. More... | |
| void | store (svec< 4, int8_t > *p) |
| Store the vector to address p. More... | |
| void | masked_store (svec< 4, int8_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 (int8_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 (int8_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 (int8_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 (int8_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, int8_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, int8_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, int8_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, int8_t > | abs () |
| Return a new vector of the vector's abs value. More... | |
| svec< 4, int8_t > | operator| (svec< 4, int8_t > a) |
| Or operator. E.g. "a | b". More... | |
| svec< 4, int8_t > | operator& (svec< 4, int8_t > a) |
| And operator. E.g. "a & b". More... | |
| svec< 4, int8_t > | operator^ (svec< 4, int8_t > a) |
| Xor operator. E.g. "a ^ b". More... | |
| svec< 4, int8_t > | operator<< (svec< 4, uint8_t > a) |
| Left shift operator. E.g. "a << b".The b must be unsigned vector. More... | |
| svec< 4, int8_t > | operator<< (int32_t s) |
| Left shift operator by a scalar. E.g. "a << 5". More... | |
| svec< 4, int8_t > | operator>> (svec< 4, uint8_t > a) |
| Right shift operator. E.g. "a >> b".The b must be unsigned vector. More... | |
| svec< 4, int8_t > | operator>> (int32_t s) |
| Right shift operator by a scalar. E.g. "a >> 5". More... | |
| svec< 4, int8_t > | operator% (svec< 4, int8_t > a) |
| Remainder operator on a vector. E.g. "a % b". More... | |
| svec< 4, int8_t > | operator% (int8_t s) |
| Remainder operator on a scalar. E.g. "a % 5". More... | |
Static Public Member Functions | |
| static svec< 4, int8_t > | load (svec< 4, int8_t > *p) |
| load the vector from the pointer p More... | |
| static svec< 4, int8_t > | masked_load (svec< 4, int8_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, int8_t > | load_const (const int8_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, int8_t > | load_and_splat (int8_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, int8_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, int8_t > | gather_base_offsets (int8_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, int8_t > | gather_base_offsets (int8_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, int8_t > | gather_stride (int8_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, int8_t > | gather_stride (int8_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 | |
| int8_t | v [4] |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const svec< 4, int8_t > &v) |
data representation and operations on a vector of 4 signed chars.
| generic::svec< 4, int8_t >::svec | ( | ) |
Default constructor.
| generic::svec< 4, int8_t >::svec | ( | int8_t | a, |
| int8_t | b, | ||
| int8_t | c, | ||
| int8_t | d | ||
| ) |
Constructor.
| generic::svec< 4, int8_t >::svec | ( | int8_t | a | ) |
Constructor.
| svec< 4, int8_t > generic::svec< 4, int8_t >::abs | ( | ) |
Return a new vector of the vector's abs value.
| svec< 4, int8_t > generic::svec< 4, int8_t >::broadcast | ( | int32_t | index | ) |
Return a new vector by setting all the elements of the new vector with this vector's index element.
|
static |
Gather the elements pointed by the vector ptrs if the mask element is true, and return a vector.
|
static |
Gather the elements pointed by calculating the addresses ((char*)b + scale * offsets) if the mask element is true, and return a vector.
|
static |
Gather the elements pointed by calculating the addresses ((char*)b + scale * offsets) if the mask element is true, and return a vector.
|
static |
Gather the elements pointed by (b+off, b++off+stride, b+off+2*stride, b+off+3*step).
|
static |
Gather the elements pointed by (b+off, b++off+stride, b+off+2*stride, b+off+3*step).
|
static |
load the vector from the pointer p
| [in] | p | load address |
|
static |
Construct a vector by loading a scalar value from pointer p, and splat it to all the elements in the vector.
|
static |
Construct a vector by loading a scalar value from pointer p, and splat it to all the elements in the vector.
|
static |
Return a new vector by only loading the value from the pointer p if the mask element is true.
| void generic::svec< 4, int8_t >::masked_store | ( | svec< 4, int8_t > * | p, |
| svec< 4, bool > | mask | ||
| ) |
Store the vector element's value to pointer p if the mask element is true.
| svec< 4,bool > generic::svec< 4, int8_t >::operator!= | ( | svec< 4, int8_t > | a | ) |
Element-wise compare not equal, return a bool vector. E.g. "a != b" *.
| [in] | a | a vector * |
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator% | ( | svec< 4, int8_t > | a | ) |
Remainder operator on a vector. E.g. "a % b".
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator% | ( | int8_t | s | ) |
Remainder operator on a scalar. E.g. "a % 5".
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator& | ( | svec< 4, int8_t > | a | ) |
And operator. E.g. "a & b".
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator* | ( | int8_t | s | ) |
Multiply a vector and a scalar.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator* | ( | svec< 4, int8_t > | a | ) |
Multiply two vectors.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator+ | ( | svec< 4, int8_t > | a | ) |
Add two vectors.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator+ | ( | int8_t | s | ) |
Add a vector and a scalar.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator- | ( | int8_t | s | ) |
Sub a vector and a scalar.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator- | ( | ) |
get the neg value, return a VTYPE vector. E.g. "-a"
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator- | ( | svec< 4, int8_t > | a | ) |
Sub two vectors.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator/ | ( | svec< 4, int8_t > | a | ) |
Divide a vector by a vector.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator/ | ( | int8_t | s | ) |
Divide a vector by a scalar.
| svec< 4,bool > generic::svec< 4, int8_t >::operator< | ( | svec< 4, int8_t > | a | ) |
Element-wise compare less than, return a bool vector. E.g. "a < b" *.
| [in] | a | a vector * |
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator<< | ( | int32_t | s | ) |
Left shift operator by a scalar. E.g. "a << 5".
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator<< | ( | svec< 4, uint8_t > | a | ) |
Left shift operator. E.g. "a << b".The b must be unsigned vector.
| svec< 4,bool > generic::svec< 4, int8_t >::operator<= | ( | svec< 4, int8_t > | a | ) |
Element-wise compare less equal, return a bool vector. E.g. "a <= b" *.
| [in] | a | a vector * |
| svec< 4,bool > generic::svec< 4, int8_t >::operator== | ( | svec< 4, int8_t > | a | ) |
Element-wise compare equal, return a bool vector, e.g., "a == b" *.
| [in] | a | a vector * |
| svec< 4,bool > generic::svec< 4, int8_t >::operator> | ( | svec< 4, int8_t > | a | ) |
Element-wise compare greater than, return a bool vector. E.g. "a > b" *.
| [in] | a | a vector * |
| svec< 4,bool > generic::svec< 4, int8_t >::operator>= | ( | svec< 4, int8_t > | a | ) |
Element-wise compare greater equal, return a bool vector. E.g. "a >= b" *.
| [in] | a | a vector * |
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator>> | ( | svec< 4, uint8_t > | a | ) |
Right shift operator. E.g. "a >> b".The b must be unsigned vector.
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator>> | ( | int32_t | s | ) |
Right shift operator by a scalar. E.g. "a >> 5".
| const int8_t generic::svec< 4, int8_t >::operator[] | ( | int | index | ) | const |
| int8_t & generic::svec< 4, int8_t >::operator[] | ( | int | index | ) |
operator [] to set or get the vector element specified by index.
| index | specifies the index of the element in the vector. |
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator^ | ( | svec< 4, int8_t > | a | ) |
Xor operator. E.g. "a ^ b".
| svec< 4, int8_t > generic::svec< 4, int8_t >::operator| | ( | svec< 4, int8_t > | a | ) |
Or operator. E.g. "a | b".
| int8_t generic::svec< 4, int8_t >::reduce_add | ( | ) |
Get the sum of all the element values in the vector. return a int8_t scalar.
| int8_t generic::svec< 4, int8_t >::reduce_max | ( | ) |
Get the max value of all the element values in the vector. return a int8_t scalar.
| int8_t generic::svec< 4, int8_t >::reduce_min | ( | ) |
Get the min value of all the element values in the vector. return a int8_t scalar.
| svec< 4, int8_t > generic::svec< 4, int8_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< 4, int8_t >::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.
| void generic::svec< 4, int8_t >::scatter_base_offsets | ( | int8_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.
| void generic::svec< 4, int8_t >::scatter_base_offsets | ( | int8_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.
| void generic::svec< 4, int8_t >::scatter_stride | ( | int8_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< 4, int8_t >::scatter_stride | ( | int8_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< 4, int8_t > generic::svec< 4, int8_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]].
| void generic::svec< 4, int8_t >::store | ( | svec< 4, int8_t > * | p | ) |
Store the vector to address p.
| [in] | p | store address |
|
friend |
| int8_t generic::svec< 4, int8_t >::v[4] |
1.8.5