1/**
2 * This code is released under the
3 * Apache License Version 2.0 http://www.apache.org/licenses/.
4 *
5 * (c) Daniel Lemire, http://fastpforlib.me/en/
6 */
7#pragma once
8#include <cinttypes>
9#include <string>
10
11namespace duckdb_fastpforlib {
12namespace internal {
13
14// Unpacks 8 uint8_t values
15void __fastunpack0(const uint8_t *__restrict in, uint8_t *__restrict out);
16void __fastunpack1(const uint8_t *__restrict in, uint8_t *__restrict out);
17void __fastunpack2(const uint8_t *__restrict in, uint8_t *__restrict out);
18void __fastunpack3(const uint8_t *__restrict in, uint8_t *__restrict out);
19void __fastunpack4(const uint8_t *__restrict in, uint8_t *__restrict out);
20void __fastunpack5(const uint8_t *__restrict in, uint8_t *__restrict out);
21void __fastunpack6(const uint8_t *__restrict in, uint8_t *__restrict out);
22void __fastunpack7(const uint8_t *__restrict in, uint8_t *__restrict out);
23void __fastunpack8(const uint8_t *__restrict in, uint8_t *__restrict out);
24
25// Unpacks 16 uint16_t values
26void __fastunpack0(const uint16_t *__restrict in, uint16_t *__restrict out);
27void __fastunpack1(const uint16_t *__restrict in, uint16_t *__restrict out);
28void __fastunpack2(const uint16_t *__restrict in, uint16_t *__restrict out);
29void __fastunpack3(const uint16_t *__restrict in, uint16_t *__restrict out);
30void __fastunpack4(const uint16_t *__restrict in, uint16_t *__restrict out);
31void __fastunpack5(const uint16_t *__restrict in, uint16_t *__restrict out);
32void __fastunpack6(const uint16_t *__restrict in, uint16_t *__restrict out);
33void __fastunpack7(const uint16_t *__restrict in, uint16_t *__restrict out);
34void __fastunpack8(const uint16_t *__restrict in, uint16_t *__restrict out);
35void __fastunpack9(const uint16_t *__restrict in, uint16_t *__restrict out);
36void __fastunpack10(const uint16_t *__restrict in, uint16_t *__restrict out);
37void __fastunpack11(const uint16_t *__restrict in, uint16_t *__restrict out);
38void __fastunpack12(const uint16_t *__restrict in, uint16_t *__restrict out);
39void __fastunpack13(const uint16_t *__restrict in, uint16_t *__restrict out);
40void __fastunpack14(const uint16_t *__restrict in, uint16_t *__restrict out);
41void __fastunpack15(const uint16_t *__restrict in, uint16_t *__restrict out);
42void __fastunpack16(const uint16_t *__restrict in, uint16_t *__restrict out);
43
44// Unpacks 32 uint32_t values
45void __fastunpack0(const uint32_t *__restrict in, uint32_t *__restrict out);
46void __fastunpack1(const uint32_t *__restrict in, uint32_t *__restrict out);
47void __fastunpack2(const uint32_t *__restrict in, uint32_t *__restrict out);
48void __fastunpack3(const uint32_t *__restrict in, uint32_t *__restrict out);
49void __fastunpack4(const uint32_t *__restrict in, uint32_t *__restrict out);
50void __fastunpack5(const uint32_t *__restrict in, uint32_t *__restrict out);
51void __fastunpack6(const uint32_t *__restrict in, uint32_t *__restrict out);
52void __fastunpack7(const uint32_t *__restrict in, uint32_t *__restrict out);
53void __fastunpack8(const uint32_t *__restrict in, uint32_t *__restrict out);
54void __fastunpack9(const uint32_t *__restrict in, uint32_t *__restrict out);
55void __fastunpack10(const uint32_t *__restrict in, uint32_t *__restrict out);
56void __fastunpack11(const uint32_t *__restrict in, uint32_t *__restrict out);
57void __fastunpack12(const uint32_t *__restrict in, uint32_t *__restrict out);
58void __fastunpack13(const uint32_t *__restrict in, uint32_t *__restrict out);
59void __fastunpack14(const uint32_t *__restrict in, uint32_t *__restrict out);
60void __fastunpack15(const uint32_t *__restrict in, uint32_t *__restrict out);
61void __fastunpack16(const uint32_t *__restrict in, uint32_t *__restrict out);
62void __fastunpack17(const uint32_t *__restrict in, uint32_t *__restrict out);
63void __fastunpack18(const uint32_t *__restrict in, uint32_t *__restrict out);
64void __fastunpack19(const uint32_t *__restrict in, uint32_t *__restrict out);
65void __fastunpack20(const uint32_t *__restrict in, uint32_t *__restrict out);
66void __fastunpack21(const uint32_t *__restrict in, uint32_t *__restrict out);
67void __fastunpack22(const uint32_t *__restrict in, uint32_t *__restrict out);
68void __fastunpack23(const uint32_t *__restrict in, uint32_t *__restrict out);
69void __fastunpack24(const uint32_t *__restrict in, uint32_t *__restrict out);
70void __fastunpack25(const uint32_t *__restrict in, uint32_t *__restrict out);
71void __fastunpack26(const uint32_t *__restrict in, uint32_t *__restrict out);
72void __fastunpack27(const uint32_t *__restrict in, uint32_t *__restrict out);
73void __fastunpack28(const uint32_t *__restrict in, uint32_t *__restrict out);
74void __fastunpack29(const uint32_t *__restrict in, uint32_t *__restrict out);
75void __fastunpack30(const uint32_t *__restrict in, uint32_t *__restrict out);
76void __fastunpack31(const uint32_t *__restrict in, uint32_t *__restrict out);
77void __fastunpack32(const uint32_t *__restrict in, uint32_t *__restrict out);
78
79// Unpacks 32 uint64_t values
80void __fastunpack0(const uint32_t *__restrict in, uint64_t *__restrict out);
81void __fastunpack1(const uint32_t *__restrict in, uint64_t *__restrict out);
82void __fastunpack2(const uint32_t *__restrict in, uint64_t *__restrict out);
83void __fastunpack3(const uint32_t *__restrict in, uint64_t *__restrict out);
84void __fastunpack4(const uint32_t *__restrict in, uint64_t *__restrict out);
85void __fastunpack5(const uint32_t *__restrict in, uint64_t *__restrict out);
86void __fastunpack6(const uint32_t *__restrict in, uint64_t *__restrict out);
87void __fastunpack7(const uint32_t *__restrict in, uint64_t *__restrict out);
88void __fastunpack8(const uint32_t *__restrict in, uint64_t *__restrict out);
89void __fastunpack9(const uint32_t *__restrict in, uint64_t *__restrict out);
90void __fastunpack10(const uint32_t *__restrict in, uint64_t *__restrict out);
91void __fastunpack11(const uint32_t *__restrict in, uint64_t *__restrict out);
92void __fastunpack12(const uint32_t *__restrict in, uint64_t *__restrict out);
93void __fastunpack13(const uint32_t *__restrict in, uint64_t *__restrict out);
94void __fastunpack14(const uint32_t *__restrict in, uint64_t *__restrict out);
95void __fastunpack15(const uint32_t *__restrict in, uint64_t *__restrict out);
96void __fastunpack16(const uint32_t *__restrict in, uint64_t *__restrict out);
97void __fastunpack17(const uint32_t *__restrict in, uint64_t *__restrict out);
98void __fastunpack18(const uint32_t *__restrict in, uint64_t *__restrict out);
99void __fastunpack19(const uint32_t *__restrict in, uint64_t *__restrict out);
100void __fastunpack20(const uint32_t *__restrict in, uint64_t *__restrict out);
101void __fastunpack21(const uint32_t *__restrict in, uint64_t *__restrict out);
102void __fastunpack22(const uint32_t *__restrict in, uint64_t *__restrict out);
103void __fastunpack23(const uint32_t *__restrict in, uint64_t *__restrict out);
104void __fastunpack24(const uint32_t *__restrict in, uint64_t *__restrict out);
105void __fastunpack25(const uint32_t *__restrict in, uint64_t *__restrict out);
106void __fastunpack26(const uint32_t *__restrict in, uint64_t *__restrict out);
107void __fastunpack27(const uint32_t *__restrict in, uint64_t *__restrict out);
108void __fastunpack28(const uint32_t *__restrict in, uint64_t *__restrict out);
109void __fastunpack29(const uint32_t *__restrict in, uint64_t *__restrict out);
110void __fastunpack30(const uint32_t *__restrict in, uint64_t *__restrict out);
111void __fastunpack31(const uint32_t *__restrict in, uint64_t *__restrict out);
112void __fastunpack32(const uint32_t *__restrict in, uint64_t *__restrict out);
113void __fastunpack33(const uint32_t *__restrict in, uint64_t *__restrict out);
114void __fastunpack34(const uint32_t *__restrict in, uint64_t *__restrict out);
115void __fastunpack35(const uint32_t *__restrict in, uint64_t *__restrict out);
116void __fastunpack36(const uint32_t *__restrict in, uint64_t *__restrict out);
117void __fastunpack37(const uint32_t *__restrict in, uint64_t *__restrict out);
118void __fastunpack38(const uint32_t *__restrict in, uint64_t *__restrict out);
119void __fastunpack39(const uint32_t *__restrict in, uint64_t *__restrict out);
120void __fastunpack40(const uint32_t *__restrict in, uint64_t *__restrict out);
121void __fastunpack41(const uint32_t *__restrict in, uint64_t *__restrict out);
122void __fastunpack42(const uint32_t *__restrict in, uint64_t *__restrict out);
123void __fastunpack43(const uint32_t *__restrict in, uint64_t *__restrict out);
124void __fastunpack44(const uint32_t *__restrict in, uint64_t *__restrict out);
125void __fastunpack45(const uint32_t *__restrict in, uint64_t *__restrict out);
126void __fastunpack46(const uint32_t *__restrict in, uint64_t *__restrict out);
127void __fastunpack47(const uint32_t *__restrict in, uint64_t *__restrict out);
128void __fastunpack48(const uint32_t *__restrict in, uint64_t *__restrict out);
129void __fastunpack49(const uint32_t *__restrict in, uint64_t *__restrict out);
130void __fastunpack50(const uint32_t *__restrict in, uint64_t *__restrict out);
131void __fastunpack51(const uint32_t *__restrict in, uint64_t *__restrict out);
132void __fastunpack52(const uint32_t *__restrict in, uint64_t *__restrict out);
133void __fastunpack53(const uint32_t *__restrict in, uint64_t *__restrict out);
134void __fastunpack54(const uint32_t *__restrict in, uint64_t *__restrict out);
135void __fastunpack55(const uint32_t *__restrict in, uint64_t *__restrict out);
136void __fastunpack56(const uint32_t *__restrict in, uint64_t *__restrict out);
137void __fastunpack57(const uint32_t *__restrict in, uint64_t *__restrict out);
138void __fastunpack58(const uint32_t *__restrict in, uint64_t *__restrict out);
139void __fastunpack59(const uint32_t *__restrict in, uint64_t *__restrict out);
140void __fastunpack60(const uint32_t *__restrict in, uint64_t *__restrict out);
141void __fastunpack61(const uint32_t *__restrict in, uint64_t *__restrict out);
142void __fastunpack62(const uint32_t *__restrict in, uint64_t *__restrict out);
143void __fastunpack63(const uint32_t *__restrict in, uint64_t *__restrict out);
144void __fastunpack64(const uint32_t *__restrict in, uint64_t *__restrict out);
145
146// Packs 8 int8_t values
147void __fastpack0(const uint8_t *__restrict in, uint8_t *__restrict out);
148void __fastpack1(const uint8_t *__restrict in, uint8_t *__restrict out);
149void __fastpack2(const uint8_t *__restrict in, uint8_t *__restrict out);
150void __fastpack3(const uint8_t *__restrict in, uint8_t *__restrict out);
151void __fastpack4(const uint8_t *__restrict in, uint8_t *__restrict out);
152void __fastpack5(const uint8_t *__restrict in, uint8_t *__restrict out);
153void __fastpack6(const uint8_t *__restrict in, uint8_t *__restrict out);
154void __fastpack7(const uint8_t *__restrict in, uint8_t *__restrict out);
155void __fastpack8(const uint8_t *__restrict in, uint8_t *__restrict out);
156
157// Packs 16 int16_t values
158void __fastpack0(const uint16_t *__restrict in, uint16_t *__restrict out);
159void __fastpack1(const uint16_t *__restrict in, uint16_t *__restrict out);
160void __fastpack2(const uint16_t *__restrict in, uint16_t *__restrict out);
161void __fastpack3(const uint16_t *__restrict in, uint16_t *__restrict out);
162void __fastpack4(const uint16_t *__restrict in, uint16_t *__restrict out);
163void __fastpack5(const uint16_t *__restrict in, uint16_t *__restrict out);
164void __fastpack6(const uint16_t *__restrict in, uint16_t *__restrict out);
165void __fastpack7(const uint16_t *__restrict in, uint16_t *__restrict out);
166void __fastpack8(const uint16_t *__restrict in, uint16_t *__restrict out);
167void __fastpack9(const uint16_t *__restrict in, uint16_t *__restrict out);
168void __fastpack10(const uint16_t *__restrict in, uint16_t *__restrict out);
169void __fastpack11(const uint16_t *__restrict in, uint16_t *__restrict out);
170void __fastpack12(const uint16_t *__restrict in, uint16_t *__restrict out);
171void __fastpack13(const uint16_t *__restrict in, uint16_t *__restrict out);
172void __fastpack14(const uint16_t *__restrict in, uint16_t *__restrict out);
173void __fastpack15(const uint16_t *__restrict in, uint16_t *__restrict out);
174void __fastpack16(const uint16_t *__restrict in, uint16_t *__restrict out);
175
176// Packs 32 int32_t values
177void __fastpack0(const uint32_t *__restrict in, uint32_t *__restrict out);
178void __fastpack1(const uint32_t *__restrict in, uint32_t *__restrict out);
179void __fastpack2(const uint32_t *__restrict in, uint32_t *__restrict out);
180void __fastpack3(const uint32_t *__restrict in, uint32_t *__restrict out);
181void __fastpack4(const uint32_t *__restrict in, uint32_t *__restrict out);
182void __fastpack5(const uint32_t *__restrict in, uint32_t *__restrict out);
183void __fastpack6(const uint32_t *__restrict in, uint32_t *__restrict out);
184void __fastpack7(const uint32_t *__restrict in, uint32_t *__restrict out);
185void __fastpack8(const uint32_t *__restrict in, uint32_t *__restrict out);
186void __fastpack9(const uint32_t *__restrict in, uint32_t *__restrict out);
187void __fastpack10(const uint32_t *__restrict in, uint32_t *__restrict out);
188void __fastpack11(const uint32_t *__restrict in, uint32_t *__restrict out);
189void __fastpack12(const uint32_t *__restrict in, uint32_t *__restrict out);
190void __fastpack13(const uint32_t *__restrict in, uint32_t *__restrict out);
191void __fastpack14(const uint32_t *__restrict in, uint32_t *__restrict out);
192void __fastpack15(const uint32_t *__restrict in, uint32_t *__restrict out);
193void __fastpack16(const uint32_t *__restrict in, uint32_t *__restrict out);
194void __fastpack17(const uint32_t *__restrict in, uint32_t *__restrict out);
195void __fastpack18(const uint32_t *__restrict in, uint32_t *__restrict out);
196void __fastpack19(const uint32_t *__restrict in, uint32_t *__restrict out);
197void __fastpack20(const uint32_t *__restrict in, uint32_t *__restrict out);
198void __fastpack21(const uint32_t *__restrict in, uint32_t *__restrict out);
199void __fastpack22(const uint32_t *__restrict in, uint32_t *__restrict out);
200void __fastpack23(const uint32_t *__restrict in, uint32_t *__restrict out);
201void __fastpack24(const uint32_t *__restrict in, uint32_t *__restrict out);
202void __fastpack25(const uint32_t *__restrict in, uint32_t *__restrict out);
203void __fastpack26(const uint32_t *__restrict in, uint32_t *__restrict out);
204void __fastpack27(const uint32_t *__restrict in, uint32_t *__restrict out);
205void __fastpack28(const uint32_t *__restrict in, uint32_t *__restrict out);
206void __fastpack29(const uint32_t *__restrict in, uint32_t *__restrict out);
207void __fastpack30(const uint32_t *__restrict in, uint32_t *__restrict out);
208void __fastpack31(const uint32_t *__restrict in, uint32_t *__restrict out);
209void __fastpack32(const uint32_t *__restrict in, uint32_t *__restrict out);
210
211// Packs 32 int64_t values
212void __fastpack0(const uint64_t *__restrict in, uint32_t *__restrict out);
213void __fastpack1(const uint64_t *__restrict in, uint32_t *__restrict out);
214void __fastpack2(const uint64_t *__restrict in, uint32_t *__restrict out);
215void __fastpack3(const uint64_t *__restrict in, uint32_t *__restrict out);
216void __fastpack4(const uint64_t *__restrict in, uint32_t *__restrict out);
217void __fastpack5(const uint64_t *__restrict in, uint32_t *__restrict out);
218void __fastpack6(const uint64_t *__restrict in, uint32_t *__restrict out);
219void __fastpack7(const uint64_t *__restrict in, uint32_t *__restrict out);
220void __fastpack8(const uint64_t *__restrict in, uint32_t *__restrict out);
221void __fastpack9(const uint64_t *__restrict in, uint32_t *__restrict out);
222void __fastpack10(const uint64_t *__restrict in, uint32_t *__restrict out);
223void __fastpack11(const uint64_t *__restrict in, uint32_t *__restrict out);
224void __fastpack12(const uint64_t *__restrict in, uint32_t *__restrict out);
225void __fastpack13(const uint64_t *__restrict in, uint32_t *__restrict out);
226void __fastpack14(const uint64_t *__restrict in, uint32_t *__restrict out);
227void __fastpack15(const uint64_t *__restrict in, uint32_t *__restrict out);
228void __fastpack16(const uint64_t *__restrict in, uint32_t *__restrict out);
229void __fastpack17(const uint64_t *__restrict in, uint32_t *__restrict out);
230void __fastpack18(const uint64_t *__restrict in, uint32_t *__restrict out);
231void __fastpack19(const uint64_t *__restrict in, uint32_t *__restrict out);
232void __fastpack20(const uint64_t *__restrict in, uint32_t *__restrict out);
233void __fastpack21(const uint64_t *__restrict in, uint32_t *__restrict out);
234void __fastpack22(const uint64_t *__restrict in, uint32_t *__restrict out);
235void __fastpack23(const uint64_t *__restrict in, uint32_t *__restrict out);
236void __fastpack24(const uint64_t *__restrict in, uint32_t *__restrict out);
237void __fastpack25(const uint64_t *__restrict in, uint32_t *__restrict out);
238void __fastpack26(const uint64_t *__restrict in, uint32_t *__restrict out);
239void __fastpack27(const uint64_t *__restrict in, uint32_t *__restrict out);
240void __fastpack28(const uint64_t *__restrict in, uint32_t *__restrict out);
241void __fastpack29(const uint64_t *__restrict in, uint32_t *__restrict out);
242void __fastpack30(const uint64_t *__restrict in, uint32_t *__restrict out);
243void __fastpack31(const uint64_t *__restrict in, uint32_t *__restrict out);
244void __fastpack32(const uint64_t *__restrict in, uint32_t *__restrict out);
245void __fastpack33(const uint64_t *__restrict in, uint32_t *__restrict out);
246void __fastpack34(const uint64_t *__restrict in, uint32_t *__restrict out);
247void __fastpack35(const uint64_t *__restrict in, uint32_t *__restrict out);
248void __fastpack36(const uint64_t *__restrict in, uint32_t *__restrict out);
249void __fastpack37(const uint64_t *__restrict in, uint32_t *__restrict out);
250void __fastpack38(const uint64_t *__restrict in, uint32_t *__restrict out);
251void __fastpack39(const uint64_t *__restrict in, uint32_t *__restrict out);
252void __fastpack40(const uint64_t *__restrict in, uint32_t *__restrict out);
253void __fastpack41(const uint64_t *__restrict in, uint32_t *__restrict out);
254void __fastpack42(const uint64_t *__restrict in, uint32_t *__restrict out);
255void __fastpack43(const uint64_t *__restrict in, uint32_t *__restrict out);
256void __fastpack44(const uint64_t *__restrict in, uint32_t *__restrict out);
257void __fastpack45(const uint64_t *__restrict in, uint32_t *__restrict out);
258void __fastpack46(const uint64_t *__restrict in, uint32_t *__restrict out);
259void __fastpack47(const uint64_t *__restrict in, uint32_t *__restrict out);
260void __fastpack48(const uint64_t *__restrict in, uint32_t *__restrict out);
261void __fastpack49(const uint64_t *__restrict in, uint32_t *__restrict out);
262void __fastpack50(const uint64_t *__restrict in, uint32_t *__restrict out);
263void __fastpack51(const uint64_t *__restrict in, uint32_t *__restrict out);
264void __fastpack52(const uint64_t *__restrict in, uint32_t *__restrict out);
265void __fastpack53(const uint64_t *__restrict in, uint32_t *__restrict out);
266void __fastpack54(const uint64_t *__restrict in, uint32_t *__restrict out);
267void __fastpack55(const uint64_t *__restrict in, uint32_t *__restrict out);
268void __fastpack56(const uint64_t *__restrict in, uint32_t *__restrict out);
269void __fastpack57(const uint64_t *__restrict in, uint32_t *__restrict out);
270void __fastpack58(const uint64_t *__restrict in, uint32_t *__restrict out);
271void __fastpack59(const uint64_t *__restrict in, uint32_t *__restrict out);
272void __fastpack60(const uint64_t *__restrict in, uint32_t *__restrict out);
273void __fastpack61(const uint64_t *__restrict in, uint32_t *__restrict out);
274void __fastpack62(const uint64_t *__restrict in, uint32_t *__restrict out);
275void __fastpack63(const uint64_t *__restrict in, uint32_t *__restrict out);
276void __fastpack64(const uint64_t *__restrict in, uint32_t *__restrict out);
277} // namespace internal
278} // namespace duckdb_fastpforlib
279