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