1{{simdpp/title | {{{1}}}{{small|<N,void>}} }}
2{{types/navbar}}
3{{dcl begin}}
4{{dcl | 1=
5template< unsigned N >
6class {{{1}}}<N,void> : public {{{2}}}<N, {{{1}}}<N,void> >;
7}}
8{{dcl end}}
9
10Defines a {{{kind_text}}} type with {{tt|N}} elements each having {{{bits}}} bits.
11
12This is a template specialization for the parameter {{tt|Expr}} being {{tt|void}}. It corresponds to a physical vector data as opposed to a vector expression. See [[types#expr|this page]] for documentation of operations available on vector expressions.
13
14If {{tt|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.
15
16===Template parameters===
17{{par begin}}
18{{par | N | the number of elements in the vector}}
19{{par end}}
20
21===Member types===
22{{dsc begin}}
23{{dsc hitem | Member type | Definition}}
24{{dsc | element_type | {{tt|{{{element}}}}} }}
25{{dsc | expr_type | {{tt|void}} }}
26{{dsc | native_type | Instruction-set and compiler specific type corresponding to a single register.<br/>{{mark|Provided only if the vector type wraps native register}}}}
27{{dsc end}}
28
29===Member functions===
30{{dsc begin}}
31{{dsc mem ctor | constructor | nolink=true | constructs the vector object }}
32{{dsc mem fun | operator{{=}} | nolink=true | assigns data to vector }}
33{{dsc mem fun | vec | nolink=true | returns a base vector corresponding to native register }}
34{{dsc mem fun | eval | nolink=true | evaluates vector expression. Simply returns {{c|*this}} }}
35{{dsc mem fun | native | nolink=true | returns wrapped SIMD type<br/>{{mark|Provided only if the vector type wraps native register}}}}
36{{dsc mem fun | operator native_type | nolink=true | returns wrapped SIMD type<br/>{{mark deprecated|2.1}}}}
37{{dsc end}}
38
39{{member | {{small|simdpp::{{{1}}}::}}{{{1}}} | 2=
40{{dcl begin}}
41{{dcl | num=1 | 1=
42{{{1}}}<N>( ) = default;
43}}
44{{dcl | num=2 | 1=
45{{{1}}}<N>( const {{{1}}}<N>& other ) = default;
46}}
47{{dcl | num=3 | 1=
48template< class E >
49{{{1}}}<N>( const {{{1}}}<N,E>& other );
50}}
51{{dcl | num=4 |
52template< class V >
53explicit {{{1}}}<N>( const any_vec<N*{{{bytes}}},V> other );
54}}
55{{dcl | num=5 |
56template< class E >
57{{{1}}}<N>( const expr_vec_construct<E>& e );
58}}
59{{dcl | num=6 | notes={{mark|Provided only if the vector type wraps native register}} |1=
60{{{1}}}<N>( const native_type& n );
61}}
62{{dcl end}}
63
64Constructs the vector object.
65
66:(1) Default constructor is default.
67
68:(2) Copy constructor is default.
69
70:(3) The vector can be constructed from a [[types#expr|vector expression]] evaluating it.
71
72:(4) The vector can be constructed from any other vector of the same size. This constructor is {{tt|explicit}} - implicit conversions between vectors are not allowed.
73
74:(5) The vector can be constructed from a type returned by {{ltt|misc/splat}}, {{ltt|misc/make_int}}, {{ltt|misc/make_uint}}, {{ltt|misc/make_float}} functions.
75
76:(6) The vector can be constructed from a native SIMD type if it corresponds to one.
77
78===Parameters===
79{{par begin}}
80{{par | other | another vector to construct from }}
81{{par | e | a value returned by either of {{ltt|misc/splat}}, {{ltt|misc/make_int}}, {{ltt|misc/make_uint}}, {{ltt|misc/make_float}} functions}}
82{{par | n | native SIMD type to construct from }}
83{{par end}}
84
85}}
86
87{{member | {{small|simdpp::{{{1}}}::}}operator{{=}} | 2=
88{{dcl begin}}
89{{dcl | num=1 | 1=
90{{{1}}}<N>& operator=( const {{{1}}}<N>& other ) = default;
91}}
92{{dcl | num=2 | 1=
93template< class V >
94{{{1}}}<N>& operator=( const any_vec<N*{{{bytes}}},V>& other );
95}}
96{{dcl | num=3 | 1=
97template< class E >
98{{{1}}}<N>& operator=( const expr_vec_construct<E>& e );
99}}
100{{dcl | num=4 | notes={{mark|Provided only if the vector type wraps native register}} | 1=
101{{{1}}}<N>& operator=( const native_type& n );
102}}
103{{dcl end}}
104
105Assigns data to vector object.
106
107:(1) Copy assignment operator is default.
108
109:(2) The vector can be constructed from any other vector of the same size. Implicit conversions are allowed. Since the corresponding constructor is {{c|explicit}}, implicit conversions using direct initialization are not allowed: user needs to write {{c|int32<4> b; b = a;}} instead of {{c|int32<4> b = a;}} when {{tt|a}} and {{tt|b}} are of different vector types.
110
111:(3) The vector can be assigned a value returned by {{ltt|misc/splat}}, {{ltt|misc/make_int}}, {{ltt|misc/make_uint}}, {{ltt|misc/make_float}} functions.
112
113===Parameters===
114{{par begin}}
115{{par | other | another vector to assign data from }}
116{{par | e | a value returned by either of {{ltt|misc/splat}}, {{ltt|misc/make_int}}, {{ltt|misc/make_uint}}, {{ltt|misc/make_float}} functions}}
117{{par | n | native SIMD type to assign data from from }}
118{{par end}}
119
120
121===Return value===
122{{c|*this}}
123
124}}
125
126{{member | {{small|simdpp::{{{1}}}::}}vec | 2=
127{{dcl begin}}
128{{dcl | 1=
129const {{{1}}}<W>& vec( unsigned index ) const;
130}}
131{{dcl | 1=
132{{{1}}}<W>& vec( unsigned index );
133}}
134{{dcl end}}
135
136Returns a base vector corresponding to a native register of width {{tt|W}}. {{tt|W}} might be less than {{tt|N}} or equal to it. For example, on AVX {{tt|int32<8>}} corresponds to two native {{tt|__m128i}} values; {{c|vec(0)}} will return the lower half, whereas {{c|vec(1)}} will return the higher.
137
138If {{{1}}}<N> itself corresponds to native register, returns {{c|*this}} regardless of {{tt|index}}.
139
140===Parameters===
141{{par begin}}
142{{par | index | the index of the subvector to return}}
143{{par end}}
144
145===Return value===
146A base vector corresponding to a native register.
147
148}}
149
150{{member | {{small|simdpp::{{{1}}}::}}eval | 2=
151{{dcl begin}}
152{{dcl | 1=
153{{{1}}}<N> eval() const;
154}}
155{{dcl end}}
156
157Evaluates vector expression. Types with {{tt|Expr}} parameter being {{c|void}} corresponds to physical data already, thus evaluation is a nop and returns {{c|*this}}.
158
159===Parameters===
160(none)
161
162===Return value===
163{{c|*this}}
164}}
165
166{{member | {{small|simdpp::{{{1}}}::}}native | 2=
167{{dcl begin}}
168{{dcl | notes={{mark|Provided only if the vector type wraps native register}} | 1=
169native_type native() const;
170}}
171{{dcl end}}
172
173Returns the wrapped native SIMD type.
174
175===Parameters===
176(none)
177
178===Return value===
179Wrapped SIMD type.
180}}
181
182{{member | {{small|simdpp::{{{1}}}::}}operator native_type{{small|{{mark deprecated|2.1}}}} | 2=
183{{dcl begin}}
184{{dcl | notes={{mark|Provided only if the vector type wraps native register}} | 1=
185native_type operator native_type() const;
186}}
187{{dcl end}}
188
189Returns the wrapped native SIMD type.
190
191The API will not be provided if {{c|SIMDPP_DISABLE_DEPRECATED_CONVERSION_OPERATOR_TO_NATIVE_TYPES}} is defined to nonzero value before inclusion. See [[depr/SIMDPP_DISABLE_DEPRECATED_CONVERSION_OPERATOR_TO_NATIVE_TYPES | here for more information]].
192
193===Parameters===
194(none)
195
196===Return value===
197Wrapped SIMD type.
198}}
199
200{{types/any_{{{kind}}}{{{bits}}}/inherit}}
201{{types/any_vec{{{bits}}}/inherit}}
202{{types/any_vec/inherit}}
203