1{{title|Libsimdpp reference}}
2{| class="mainpagetable" cellspacing=0 style="width:100%; white-space:nowrap;"
3|- class="row rowtop"
4| colspan=4 | <span style="font-size: 2em;">Libsimdpp documentation</span>
5|- class="row"
6| colspan=4  |
7<div style="white-space:normal;">
8libsimdpp is a portable header-only zero-overhead C++ wrapper around
9single-instruction multiple-data (SIMD) intrinsics found in many compilers. The
10library presents a single interface over several instruction sets in such a way
11that the same source code may be compiled for different instruction sets. The
12resulting object files then may be hooked into internal dynamic dispatch
13mechanism.
14
15
16The library resolves differences between instruction sets by implementing the
17missing functionality as a combination of several intrinsics. Moreover, the
18library supplies a lot of additional, commonly used functionality, such as
19various variants of matrix transpositions, interleaving loads/stores, optimized
20compile-time shuffling instructions, etc. Each of these are implemented in the
21most efficient manner for the target instruction set. Finally, it's possible
22to fall back to native intrinsics when necessary, without compromising
23maintanability.
24
25
26The library sits somewhere in the middle between programming directly in
27intrinsics and even higher-level SIMD libraries. As much control as possible
28is given to the developer, so that it's possible to exactly predict what code
29the compiler will generate.
30</div>
31|- class="row"
32|
33
34'''Instruction sets'''
35<div class="mainpagediv">
36[[arch/selection|Instruction set selection]]<br/>
37[[arch/dispatch|Dynamic dispatch]]<br/>
38</div>
39
40'''[[depr|Deprecations]]'''
41
42'''[[types|Types]]'''
43<div class="mainpagediv">
44[[types/overview|Overview]]<br/>
45[[types/promotion|Vector type promotion]]<br/>
46</div>
47
48'''[[cap|Capabilities]]'''
49
50'''[[util | Utilities]]'''
51<div class="mainpagediv">
52{{ltt|util#zzz|SIMDPP_ALIGN}}<br/>
53{{ltt|util/aligned_allocator}}<br/>
54[[util#Vector_size_macros|Vector size macros]]<br/>
55[[util#Enabled_instruction_set | Enabled instruction set]]
56</div>
57
58'''[[conv | Conversions]]'''
59<div class="mainpagediv">
60{{ltt|conv/to_int8}}&nbsp;&nbsp;{{ltt|conv/to_uint8}}<br/>
61{{ltt|conv/to_int16}}&nbsp;&nbsp;{{ltt|conv/to_uint16}}<br/>
62{{ltt|conv/to_int32}}&nbsp;&nbsp;{{ltt|conv/to_uint32}}<br/>
63{{ltt|conv/to_int64}}&nbsp;&nbsp;{{ltt|conv/to_uint64}}<br/>
64{{ltt|conv/to_float32}}&nbsp;&nbsp;{{ltt|conv/to_float64}}<br/>
65{{ltt|conv/to_mask}}
66</div>
67
68|
69
70'''[[bitwise | Bitwise operations]]'''
71<div class="mainpagediv">
72{{ltt|bitwise/bit_and}}&nbsp;&nbsp;{{ltt|bitwise/bit_andnot}} <br/>
73{{ltt|bitwise/bit_or}}&nbsp;&nbsp;{{ltt|bitwise/bit_xor}} <br/>
74{{ltt|bitwise/bit_not}} <br/>
75</div>
76
77'''[[fp | Floating-point operations]]'''
78<div class="mainpagediv">
79{{ltt|fp/add}}&nbsp;&nbsp;{{ltt|fp/sub}} <br/>
80{{ltt|fp/mul}}&nbsp;&nbsp;{{ltt|fp/div}} <br/>
81{{ltt|fp/fmadd}}&nbsp;&nbsp;{{ltt|fp/fmsub}} <br/>
82{{ltt|fp/neg}} <br/>
83{{ltt|fp/round}}&nbsp;&nbsp;{{ltt|fp/trunc}} <br/>
84{{ltt|fp/floor}}&nbsp;&nbsp;{{ltt|fp/ceil}} <br/>
85{{ltt|fp/cmp_eq}}&nbsp;&nbsp;{{ltt|fp/cmp_neq}} <br/>
86{{ltt|fp/cmp_lt}}&nbsp;&nbsp;{{ltt|fp/cmp_gt}} <br/>
87{{ltt|fp/cmp_le}}&nbsp;&nbsp;{{ltt|fp/cmp_ge}} <br/>
88{{ltt|fp/abs}}&nbsp;&nbsp;{{ltt|fp/sign}} <br/>
89{{ltt|fp/min}}&nbsp;&nbsp;{{ltt|fp/max}} <br/>
90{{ltt|fp/isnan}}&nbsp;&nbsp;{{ltt|fp/isnan2}} <br/>
91{{ltt|fp/sqrt}} <br/>
92{{ltt|fp/rcp_e}}&nbsp;&nbsp;{{ltt|fp/rcp_rh}} <br/>
93{{ltt|fp/rsqrt_e}}&nbsp;&nbsp;{{ltt|fp/rsqrt_rh}} <br/>
94{{ltt|fp/reduce_add}}&nbsp;&nbsp;{{ltt|fp/reduce_mul}} <br/>
95{{ltt|fp/reduce_min}}&nbsp;&nbsp;{{ltt|fp/reduce_max}} <br/>
96</div>
97
98'''[[operator | Operators]]'''
99<div class="mainpagediv">
100{{tt|+}}&nbsp;&nbsp;{{tt|-}}&nbsp;&nbsp;
101{{tt|*}}&nbsp;&nbsp;{{tt|/}}&nbsp;&nbsp;
102{{tt|&lt;&lt;}}&nbsp;&nbsp;{{tt|&gt;&gt;}}<br/>
103{{tt|&}}&nbsp;&nbsp;{{tt|{{!}}}}&nbsp;&nbsp;
104{{tt|^}}&nbsp;&nbsp;{{tt|~}}<br/>
105{{tt|{{==}}}}&nbsp;&nbsp;{{tt|!{{=}}}}&nbsp;&nbsp;
106{{tt|>}}&nbsp;&nbsp;{{tt|>{{=}}}}&nbsp;&nbsp;
107{{tt|<}}&nbsp;&nbsp;{{tt|<{{=}}}}<br/>
108</div>
109|
110
111'''[[int | Integer operations]]'''
112
113<div class="mainpagediv">
114{{ltt|int/add}}&nbsp;&nbsp;{{ltt|int/sub}} <br/>
115{{ltt|int/add_sat}}&nbsp;&nbsp;{{ltt|int/sub_sat}} <br/>
116{{ltt|int/mul_lo}}&nbsp;&nbsp;{{ltt|int/mul_hi}} <br/>
117{{ltt|int/mull}}&nbsp;&nbsp;{{ltt|int/neg}} <br/>
118{{ltt|int/cmp_eq}}&nbsp;&nbsp;{{ltt|int/cmp_neq}} <br/>
119{{ltt|int/cmp_lt}}&nbsp;&nbsp;{{ltt|int/cmp_gt}} <br/>
120{{ltt|int/cmp_le}}&nbsp;&nbsp;{{ltt|int/cmp_ge}} <br/>
121{{ltt|int/abs}} <br/>
122{{ltt|int/avg}}&nbsp;&nbsp;{{ltt|int/avg_trunc}} <br/>
123{{ltt|int/min}}&nbsp;&nbsp;{{ltt|int/max}} <br/>
124{{ltt|int/shift_l}}&nbsp;&nbsp;{{ltt|int/shift_r}} <br/>
125{{ltt|int/reduce_add}}&nbsp;&nbsp;{{ltt|int/reduce_mul}} <br/>
126{{ltt|int/reduce_min}}&nbsp;&nbsp;{{ltt|int/reduce_max}} <br/>
127{{ltt|int/reduce_and}}&nbsp;&nbsp;{{ltt|int/reduce_or}} <br/>
128</div>
129
130'''[[mem | Memory access]]'''
131<div class="mainpagediv">
132{{ltt|mem/load}}&nbsp;&nbsp;{{ltt|mem/load_u}} <br/>
133{{ltt|mem/load_splat}} <br/>
134{{ltt|mem/load_packed2}}<br/>
135{{ltt|mem/load_packed3}} <br/>
136{{ltt|mem/load_packed4}} <br/>
137{{ltt|mem/store}}&nbsp;&nbsp;{{ltt|mem/stream}} <br/>
138{{ltt|mem/store_first}}&nbsp;&nbsp;{{ltt|mem/store_last}} <br/>
139{{ltt|mem/store_packed2}}<br/>
140{{ltt|mem/store_packed3}} <br/>
141{{ltt|mem/store_packed4}} <br/>
142</div>
143
144|
145
146'''[[shuffle | Shuffle operations]]'''
147<div class="mainpagediv">
148{{ltt|shuffle/blend}}&nbsp;&nbsp;{{ltt|shuffle/splat}} <br/>
149{{ltt|shuffle/combine}}&nbsp;&nbsp;{{ltt|shuffle/split}} <br/>
150{{ltt|shuffle/permute2}}&nbsp;&nbsp;{{ltt|shuffle/permute4}} <br/>
151{{ltt|shuffle/shuffle2x2}}&nbsp;&nbsp;{{ltt|shuffle/shuffle4x2}} <br/>
152{{ltt|shuffle/transpose2}}&nbsp;&nbsp;{{ltt|shuffle/transpose4}} <br/><br/>
153&nbsp;&nbsp;Shuffles operating on 128-bit blocks <br/>
154{{ltt | shuffle/alignX_128 | align16&nbsp;align8&nbsp;align4&nbsp;align2 }} <br/>
155{{ltt | shuffle/splatX_128 | splat16&nbsp;splat8&nbsp;splat4&nbsp;splat2 }} <br/>
156{{ltt | shuffle/moveX_l_128 | move16_l&nbsp;move8_l&nbsp;move4_l&nbsp;move2_l }} <br/>
157{{ltt | shuffle/moveX_r_128 | move16_r&nbsp;move8_r&nbsp;move4_r&nbsp;move2_r }} <br/>
158{{ltt | shuffle/zipX_hi_128 | zip16_hi&nbsp;zip8_hi&nbsp;zip4_hi&nbsp;zip2_hi }} <br/>
159{{ltt | shuffle/zipX_lo_128 | zip16_lo&nbsp;zip8_lo&nbsp;zip4_lo&nbsp;zip2_lo }} <br/>
160{{ltt | shuffle/unzipX_hi_128 | unzip16_hi&nbsp;unzip8_hi<br/>unzip4_hi&nbsp;unzip2_hi }} <br/>
161{{ltt | shuffle/unzipX_lo_128 | unzip16_lo&nbsp;unzip8_lo<br/>unzip4_lo&nbsp;unzip2_lo }} <br/>
162{{ltt | shuffle/make_shuffle_bytes16_mask}}<br/>
163{{ltt | shuffle/shuffle_bytes16}}&nbsp;&nbsp;{{ltt | shuffle/shuffle_zbytes16}}<br/>
164{{ltt | shuffle/permute_bytes16}}&nbsp;&nbsp;{{ltt | shuffle/permute_zbytes16}}<br/>
165</div>
166
167'''[[misc | Miscellaneous operations]]'''
168<div class="mainpagediv">
169{{ltt|misc/make_int}}&nbsp;&nbsp;{{ltt|misc/make_uint}}&nbsp;&nbsp;{{ltt|misc/make_float}} <br/>
170{{ltt|misc/extract}}&nbsp;&nbsp;{{ltt|misc/insert}}&nbsp;&nbsp;{{ltt|misc/splat|splat{{small|(scalar)}}}} <br/>
171{{ltt|misc/for_each}}&nbsp;&nbsp;{{ltt|misc/test_bits_any}}<br/>
172{{ltt|misc/bit_cast}}<br/>
173{{ltt|misc/prefetch_read}}&nbsp;&nbsp;{{ltt|misc/prefetch_write}}
174</div>
175
176|- class="row rowbottom"
177| colspan=4|
178|}
179