simdpp::int16<N,void>
template< unsigned N >
class int16<N,void> : public any_int16<N, int16<N,void> >; |
||
Defines a integer type with N
elements each having 16 bits.
This is a template specialization for the parameter Expr
being void
. It corresponds to a physical vector data as opposed to a vector expression. See this page for documentation of operations available on vector expressions.
If N
corresponds to a register size supported on current instruction set then the type wraps a native register and provides APIs to access underlying type provided by compiler SIMD intrinsics.
Contents
Template parameters[edit]
N | - | the number of elements in the vector |
Member types[edit]
Member type | Definition |
element_type | int16_t
|
expr_type | void
|
native_type | Instruction-set and compiler specific type corresponding to a single register. (Provided only if the vector type wraps native register) |
Member functions[edit]
(constructor) |
constructor (public member function) |
operator= |
assigns data to vector (public member function) |
vec |
returns a base vector corresponding to native register (public member function) |
eval |
evaluates vector expression. Simply returns *this (public member function) |
native |
returns wrapped SIMD type (Provided only if the vector type wraps native register) (public member function) |
operator native_type |
returns wrapped SIMD type (deprecated since v2.1) (public member function) |
simdpp::int16::int16
int16<N>( ) = default;
|
(1) | |
int16<N>( const int16<N>& other ) = default;
|
(2) | |
template< class E >
int16<N>( const int16<N,E>& other ); |
(3) | |
template< class V >
explicit int16<N>( const any_vec<N*2,V> other ); |
(4) | |
template< class E >
int16<N>( const expr_vec_construct<E>& e ); |
(5) | |
int16<N>( const native_type& n );
|
(6) | (Provided only if the vector type wraps native register) |
Constructs the vector object.
- (1) Default constructor is default.
- (2) Copy constructor is default.
- (3) The vector can be constructed from a vector expression evaluating it.
- (4) The vector can be constructed from any other vector of the same size. This constructor is
explicit
- implicit conversions between vectors are not allowed.
- (5) The vector can be constructed from a type returned by splat, make_int, make_uint, make_float functions.
- (6) The vector can be constructed from a native SIMD type if it corresponds to one.
Parameters
other | - | another vector to construct from |
e | - | a value returned by either of splat, make_int, make_uint, make_float functions |
n | - | native SIMD type to construct from |
simdpp::int16::operator=
int16<N>& operator=( const int16<N>& other ) = default;
|
(1) | |
template< class V >
int16<N>& operator=( const any_vec<N*2,V>& other ); |
(2) | |
template< class E >
int16<N>& operator=( const expr_vec_construct<E>& e ); |
(3) | |
int16<N>& operator=( const native_type& n );
|
(4) | (Provided only if the vector type wraps native register) |
Assigns data to vector object.
- (1) Copy assignment operator is default.
- (2) The vector can be constructed from any other vector of the same size. Implicit conversions are allowed. Since the corresponding constructor is explicit, implicit conversions using direct initialization are not allowed: user needs to write {{{1}}} instead of {{{1}}} when
a
andb
are of different vector types.
- (3) The vector can be assigned a value returned by splat, make_int, make_uint, make_float functions.
Parameters
other | - | another vector to assign data from |
e | - | a value returned by either of splat, make_int, make_uint, make_float functions |
n | - | native SIMD type to assign data from from |
Return value
*this
simdpp::int16::vec
const int16<W>& vec( unsigned index ) const;
|
||
int16<W>& vec( unsigned index );
|
||
Returns a base vector corresponding to a native register of width W
. W
might be less than N
or equal to it. For example, on AVX int32<8>
corresponds to two native __m128i
values; vec(0) will return the lower half, whereas vec(1) will return the higher.
If int16<N> itself corresponds to native register, returns *this regardless of index
.
Parameters
index | - | the index of the subvector to return |
Return value
A base vector corresponding to a native register.
simdpp::int16::eval
int16<N> eval() const;
|
||
Evaluates vector expression. Types with Expr
parameter being void corresponds to physical data already, thus evaluation is a nop and returns *this.
Parameters
(none)
Return value
*this
simdpp::int16::native
native_type native() const;
|
(Provided only if the vector type wraps native register) | |
Returns the wrapped native SIMD type.
Parameters
(none)
Return value
Wrapped SIMD type.
simdpp::int16::operator native_type(deprecated since v2.1)
native_type operator native_type() const;
|
(Provided only if the vector type wraps native register) | |
Returns the wrapped native SIMD type.
The API will not be provided if SIMDPP_DISABLE_DEPRECATED_CONVERSION_OPERATOR_TO_NATIVE_TYPES is defined to nonzero value before inclusion. See here for more information.
Parameters
(none)
Return value
Wrapped SIMD type.
{{types/any_{{{kind}}}16/inherit}}
Inherited from simdpp::any_vec16<N,V>
Member constants
Member constant | Value |
size_tag
|
SIMDPP_TAG_SIZE16
|
Inherited from simdpp::any_vec<B,V>
Member types
Member type | Definition |
type
|
V
|
Member constants
Member constant | Value |
length_bytes
|
B
|
Member functions
wrapped |
returns the wrapped type (public member function) |
simdpp::any_vec::wrapped
V& wrapped();
|
||
const V& wrapped() const;
|
||
Returns the wrapped type. Effectively the same as static_cast<V&>(*this) or static_cast<const V&>(*this) respectively.