1/* Copyright (C) 2015 Povilas Kanapickas <povilas@radix.lt>
2
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt)
6*/
7
8
9// This file is generated automatically. See tools/gen_dispatcher_collect_macros.py
10
11#ifndef LIBSIMDPP_DISPATCH_COLLECT_MACROS_GENERATED_H
12#define LIBSIMDPP_DISPATCH_COLLECT_MACROS_GENERATED_H
13
14#ifndef LIBSIMDPP_SIMD_H
15 #error "This file must be included through simd.h"
16#endif
17
18// We rely on setup_arch.h being included before this file to undefine
19// all SIMDPP_ARCH_* macros
20#include <simdpp/setup_arch.h>
21
22#if SIMDPP_EMIT_DISPATCHER
23#include <simdpp/detail/preprocessor/punctuation/remove_parens.hpp>
24
25#define SIMDPP_DISPATCH_MAX_ARCHS 15
26
27
28#ifdef SIMDPP_DISPATCH_ARCH1
29 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH1
30 #include <simdpp/detail/preprocess_single_arch.h>
31
32 // Use the results of preprocess_single_arch.h to define
33 // SIMDPP_DISPATCH_1_NAMESPACE
34
35 #if SIMDPP_ARCH_PP_NS_USE_NULL
36 #define SIMDPP_DISPATCH_1_NS_ID_NULL SIMDPP_INSN_ID_NULL
37 #else
38 #define SIMDPP_DISPATCH_1_NS_ID_NULL
39 #endif
40 #if SIMDPP_ARCH_PP_NS_USE_SSE2
41 #define SIMDPP_DISPATCH_1_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
42 #else
43 #define SIMDPP_DISPATCH_1_NS_ID_SSE2
44 #endif
45 #if SIMDPP_ARCH_PP_NS_USE_SSE3
46 #define SIMDPP_DISPATCH_1_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
47 #else
48 #define SIMDPP_DISPATCH_1_NS_ID_SSE3
49 #endif
50 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
51 #define SIMDPP_DISPATCH_1_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
52 #else
53 #define SIMDPP_DISPATCH_1_NS_ID_SSSE3
54 #endif
55 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
56 #define SIMDPP_DISPATCH_1_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
57 #else
58 #define SIMDPP_DISPATCH_1_NS_ID_SSE4_1
59 #endif
60 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
61 #define SIMDPP_DISPATCH_1_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
62 #else
63 #define SIMDPP_DISPATCH_1_NS_ID_POPCNT_INSN
64 #endif
65 #if SIMDPP_ARCH_PP_NS_USE_AVX
66 #define SIMDPP_DISPATCH_1_NS_ID_AVX SIMDPP_INSN_ID_AVX
67 #else
68 #define SIMDPP_DISPATCH_1_NS_ID_AVX
69 #endif
70 #if SIMDPP_ARCH_PP_NS_USE_AVX2
71 #define SIMDPP_DISPATCH_1_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
72 #else
73 #define SIMDPP_DISPATCH_1_NS_ID_AVX2
74 #endif
75 #if SIMDPP_ARCH_PP_NS_USE_FMA3
76 #define SIMDPP_DISPATCH_1_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
77 #else
78 #define SIMDPP_DISPATCH_1_NS_ID_FMA3
79 #endif
80 #if SIMDPP_ARCH_PP_NS_USE_FMA4
81 #define SIMDPP_DISPATCH_1_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
82 #else
83 #define SIMDPP_DISPATCH_1_NS_ID_FMA4
84 #endif
85 #if SIMDPP_ARCH_PP_NS_USE_XOP
86 #define SIMDPP_DISPATCH_1_NS_ID_XOP SIMDPP_INSN_ID_XOP
87 #else
88 #define SIMDPP_DISPATCH_1_NS_ID_XOP
89 #endif
90 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
91 #define SIMDPP_DISPATCH_1_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
92 #else
93 #define SIMDPP_DISPATCH_1_NS_ID_AVX512F
94 #endif
95 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
96 #define SIMDPP_DISPATCH_1_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
97 #else
98 #define SIMDPP_DISPATCH_1_NS_ID_AVX512BW
99 #endif
100 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
101 #define SIMDPP_DISPATCH_1_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
102 #else
103 #define SIMDPP_DISPATCH_1_NS_ID_AVX512DQ
104 #endif
105 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
106 #define SIMDPP_DISPATCH_1_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
107 #else
108 #define SIMDPP_DISPATCH_1_NS_ID_AVX512VL
109 #endif
110 #if SIMDPP_ARCH_PP_NS_USE_NEON
111 #define SIMDPP_DISPATCH_1_NS_ID_NEON SIMDPP_INSN_ID_NEON
112 #else
113 #define SIMDPP_DISPATCH_1_NS_ID_NEON
114 #endif
115 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
116 #define SIMDPP_DISPATCH_1_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
117 #else
118 #define SIMDPP_DISPATCH_1_NS_ID_NEON_FLT_SP
119 #endif
120 #if SIMDPP_ARCH_PP_NS_USE_MSA
121 #define SIMDPP_DISPATCH_1_NS_ID_MSA SIMDPP_INSN_ID_MSA
122 #else
123 #define SIMDPP_DISPATCH_1_NS_ID_MSA
124 #endif
125 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
126 #define SIMDPP_DISPATCH_1_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
127 #else
128 #define SIMDPP_DISPATCH_1_NS_ID_ALTIVEC
129 #endif
130 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
131 #define SIMDPP_DISPATCH_1_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
132 #else
133 #define SIMDPP_DISPATCH_1_NS_ID_VSX_206
134 #endif
135 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
136 #define SIMDPP_DISPATCH_1_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
137 #else
138 #define SIMDPP_DISPATCH_1_NS_ID_VSX_207
139 #endif
140
141 #define SIMDPP_DISPATCH_1_NAMESPACE SIMDPP_PP_PASTE22(arch, \
142 SIMDPP_DISPATCH_1_NS_ID_NULL, \
143 SIMDPP_DISPATCH_1_NS_ID_SSE2, \
144 SIMDPP_DISPATCH_1_NS_ID_SSE3, \
145 SIMDPP_DISPATCH_1_NS_ID_SSSE3, \
146 SIMDPP_DISPATCH_1_NS_ID_SSE4_1, \
147 SIMDPP_DISPATCH_1_NS_ID_POPCNT_INSN, \
148 SIMDPP_DISPATCH_1_NS_ID_AVX, \
149 SIMDPP_DISPATCH_1_NS_ID_AVX2, \
150 SIMDPP_DISPATCH_1_NS_ID_AVX512F, \
151 SIMDPP_DISPATCH_1_NS_ID_AVX512BW, \
152 SIMDPP_DISPATCH_1_NS_ID_AVX512DQ, \
153 SIMDPP_DISPATCH_1_NS_ID_AVX512VL, \
154 SIMDPP_DISPATCH_1_NS_ID_FMA3, \
155 SIMDPP_DISPATCH_1_NS_ID_FMA4, \
156 SIMDPP_DISPATCH_1_NS_ID_XOP, \
157 SIMDPP_DISPATCH_1_NS_ID_NEON, \
158 SIMDPP_DISPATCH_1_NS_ID_NEON_FLT_SP, \
159 SIMDPP_DISPATCH_1_NS_ID_MSA, \
160 SIMDPP_DISPATCH_1_NS_ID_ALTIVEC, \
161 SIMDPP_DISPATCH_1_NS_ID_VSX_206, \
162 SIMDPP_DISPATCH_1_NS_ID_VSX_207)
163
164 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_1_NAMESPACE
165 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
166 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
167 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
168 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
169
170 #define SIMDPP_DISPATCH_1_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
171 { /* the following will fail if the overload is not available */ \
172 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_1_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
173 ARRAY[1-1] = ::simdpp::SIMDPP_DISPATCH_1_NAMESPACE::detail::create_fn_version(fun_ptr);\
174 }
175
176 #define SIMDPP_DISPATCH_1_FN_DECLARE(SIGNATURE) \
177 namespace SIMDPP_DISPATCH_1_NAMESPACE { \
178 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
179 }
180 #undef SIMDPP_ARCH_PP_LIST
181#else
182 #define SIMDPP_DISPATCH_1_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
183 #define SIMDPP_DISPATCH_1_FN_DECLARE(SIGNATURE)
184#endif
185
186#ifdef SIMDPP_DISPATCH_ARCH2
187 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH2
188 #include <simdpp/detail/preprocess_single_arch.h>
189
190 // Use the results of preprocess_single_arch.h to define
191 // SIMDPP_DISPATCH_2_NAMESPACE
192
193 #if SIMDPP_ARCH_PP_NS_USE_NULL
194 #define SIMDPP_DISPATCH_2_NS_ID_NULL SIMDPP_INSN_ID_NULL
195 #else
196 #define SIMDPP_DISPATCH_2_NS_ID_NULL
197 #endif
198 #if SIMDPP_ARCH_PP_NS_USE_SSE2
199 #define SIMDPP_DISPATCH_2_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
200 #else
201 #define SIMDPP_DISPATCH_2_NS_ID_SSE2
202 #endif
203 #if SIMDPP_ARCH_PP_NS_USE_SSE3
204 #define SIMDPP_DISPATCH_2_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
205 #else
206 #define SIMDPP_DISPATCH_2_NS_ID_SSE3
207 #endif
208 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
209 #define SIMDPP_DISPATCH_2_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
210 #else
211 #define SIMDPP_DISPATCH_2_NS_ID_SSSE3
212 #endif
213 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
214 #define SIMDPP_DISPATCH_2_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
215 #else
216 #define SIMDPP_DISPATCH_2_NS_ID_SSE4_1
217 #endif
218 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
219 #define SIMDPP_DISPATCH_2_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
220 #else
221 #define SIMDPP_DISPATCH_2_NS_ID_POPCNT_INSN
222 #endif
223 #if SIMDPP_ARCH_PP_NS_USE_AVX
224 #define SIMDPP_DISPATCH_2_NS_ID_AVX SIMDPP_INSN_ID_AVX
225 #else
226 #define SIMDPP_DISPATCH_2_NS_ID_AVX
227 #endif
228 #if SIMDPP_ARCH_PP_NS_USE_AVX2
229 #define SIMDPP_DISPATCH_2_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
230 #else
231 #define SIMDPP_DISPATCH_2_NS_ID_AVX2
232 #endif
233 #if SIMDPP_ARCH_PP_NS_USE_FMA3
234 #define SIMDPP_DISPATCH_2_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
235 #else
236 #define SIMDPP_DISPATCH_2_NS_ID_FMA3
237 #endif
238 #if SIMDPP_ARCH_PP_NS_USE_FMA4
239 #define SIMDPP_DISPATCH_2_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
240 #else
241 #define SIMDPP_DISPATCH_2_NS_ID_FMA4
242 #endif
243 #if SIMDPP_ARCH_PP_NS_USE_XOP
244 #define SIMDPP_DISPATCH_2_NS_ID_XOP SIMDPP_INSN_ID_XOP
245 #else
246 #define SIMDPP_DISPATCH_2_NS_ID_XOP
247 #endif
248 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
249 #define SIMDPP_DISPATCH_2_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
250 #else
251 #define SIMDPP_DISPATCH_2_NS_ID_AVX512F
252 #endif
253 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
254 #define SIMDPP_DISPATCH_2_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
255 #else
256 #define SIMDPP_DISPATCH_2_NS_ID_AVX512BW
257 #endif
258 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
259 #define SIMDPP_DISPATCH_2_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
260 #else
261 #define SIMDPP_DISPATCH_2_NS_ID_AVX512DQ
262 #endif
263 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
264 #define SIMDPP_DISPATCH_2_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
265 #else
266 #define SIMDPP_DISPATCH_2_NS_ID_AVX512VL
267 #endif
268 #if SIMDPP_ARCH_PP_NS_USE_NEON
269 #define SIMDPP_DISPATCH_2_NS_ID_NEON SIMDPP_INSN_ID_NEON
270 #else
271 #define SIMDPP_DISPATCH_2_NS_ID_NEON
272 #endif
273 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
274 #define SIMDPP_DISPATCH_2_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
275 #else
276 #define SIMDPP_DISPATCH_2_NS_ID_NEON_FLT_SP
277 #endif
278 #if SIMDPP_ARCH_PP_NS_USE_MSA
279 #define SIMDPP_DISPATCH_2_NS_ID_MSA SIMDPP_INSN_ID_MSA
280 #else
281 #define SIMDPP_DISPATCH_2_NS_ID_MSA
282 #endif
283 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
284 #define SIMDPP_DISPATCH_2_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
285 #else
286 #define SIMDPP_DISPATCH_2_NS_ID_ALTIVEC
287 #endif
288 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
289 #define SIMDPP_DISPATCH_2_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
290 #else
291 #define SIMDPP_DISPATCH_2_NS_ID_VSX_206
292 #endif
293 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
294 #define SIMDPP_DISPATCH_2_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
295 #else
296 #define SIMDPP_DISPATCH_2_NS_ID_VSX_207
297 #endif
298
299 #define SIMDPP_DISPATCH_2_NAMESPACE SIMDPP_PP_PASTE22(arch, \
300 SIMDPP_DISPATCH_2_NS_ID_NULL, \
301 SIMDPP_DISPATCH_2_NS_ID_SSE2, \
302 SIMDPP_DISPATCH_2_NS_ID_SSE3, \
303 SIMDPP_DISPATCH_2_NS_ID_SSSE3, \
304 SIMDPP_DISPATCH_2_NS_ID_SSE4_1, \
305 SIMDPP_DISPATCH_2_NS_ID_POPCNT_INSN, \
306 SIMDPP_DISPATCH_2_NS_ID_AVX, \
307 SIMDPP_DISPATCH_2_NS_ID_AVX2, \
308 SIMDPP_DISPATCH_2_NS_ID_AVX512F, \
309 SIMDPP_DISPATCH_2_NS_ID_AVX512BW, \
310 SIMDPP_DISPATCH_2_NS_ID_AVX512DQ, \
311 SIMDPP_DISPATCH_2_NS_ID_AVX512VL, \
312 SIMDPP_DISPATCH_2_NS_ID_FMA3, \
313 SIMDPP_DISPATCH_2_NS_ID_FMA4, \
314 SIMDPP_DISPATCH_2_NS_ID_XOP, \
315 SIMDPP_DISPATCH_2_NS_ID_NEON, \
316 SIMDPP_DISPATCH_2_NS_ID_NEON_FLT_SP, \
317 SIMDPP_DISPATCH_2_NS_ID_MSA, \
318 SIMDPP_DISPATCH_2_NS_ID_ALTIVEC, \
319 SIMDPP_DISPATCH_2_NS_ID_VSX_206, \
320 SIMDPP_DISPATCH_2_NS_ID_VSX_207)
321
322 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_2_NAMESPACE
323 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
324 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
325 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
326 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
327
328 #define SIMDPP_DISPATCH_2_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
329 { /* the following will fail if the overload is not available */ \
330 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_2_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
331 ARRAY[2-1] = ::simdpp::SIMDPP_DISPATCH_2_NAMESPACE::detail::create_fn_version(fun_ptr);\
332 }
333
334 #define SIMDPP_DISPATCH_2_FN_DECLARE(SIGNATURE) \
335 namespace SIMDPP_DISPATCH_2_NAMESPACE { \
336 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
337 }
338 #undef SIMDPP_ARCH_PP_LIST
339#else
340 #define SIMDPP_DISPATCH_2_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
341 #define SIMDPP_DISPATCH_2_FN_DECLARE(SIGNATURE)
342#endif
343
344#ifdef SIMDPP_DISPATCH_ARCH3
345 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH3
346 #include <simdpp/detail/preprocess_single_arch.h>
347
348 // Use the results of preprocess_single_arch.h to define
349 // SIMDPP_DISPATCH_3_NAMESPACE
350
351 #if SIMDPP_ARCH_PP_NS_USE_NULL
352 #define SIMDPP_DISPATCH_3_NS_ID_NULL SIMDPP_INSN_ID_NULL
353 #else
354 #define SIMDPP_DISPATCH_3_NS_ID_NULL
355 #endif
356 #if SIMDPP_ARCH_PP_NS_USE_SSE2
357 #define SIMDPP_DISPATCH_3_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
358 #else
359 #define SIMDPP_DISPATCH_3_NS_ID_SSE2
360 #endif
361 #if SIMDPP_ARCH_PP_NS_USE_SSE3
362 #define SIMDPP_DISPATCH_3_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
363 #else
364 #define SIMDPP_DISPATCH_3_NS_ID_SSE3
365 #endif
366 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
367 #define SIMDPP_DISPATCH_3_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
368 #else
369 #define SIMDPP_DISPATCH_3_NS_ID_SSSE3
370 #endif
371 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
372 #define SIMDPP_DISPATCH_3_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
373 #else
374 #define SIMDPP_DISPATCH_3_NS_ID_SSE4_1
375 #endif
376 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
377 #define SIMDPP_DISPATCH_3_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
378 #else
379 #define SIMDPP_DISPATCH_3_NS_ID_POPCNT_INSN
380 #endif
381 #if SIMDPP_ARCH_PP_NS_USE_AVX
382 #define SIMDPP_DISPATCH_3_NS_ID_AVX SIMDPP_INSN_ID_AVX
383 #else
384 #define SIMDPP_DISPATCH_3_NS_ID_AVX
385 #endif
386 #if SIMDPP_ARCH_PP_NS_USE_AVX2
387 #define SIMDPP_DISPATCH_3_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
388 #else
389 #define SIMDPP_DISPATCH_3_NS_ID_AVX2
390 #endif
391 #if SIMDPP_ARCH_PP_NS_USE_FMA3
392 #define SIMDPP_DISPATCH_3_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
393 #else
394 #define SIMDPP_DISPATCH_3_NS_ID_FMA3
395 #endif
396 #if SIMDPP_ARCH_PP_NS_USE_FMA4
397 #define SIMDPP_DISPATCH_3_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
398 #else
399 #define SIMDPP_DISPATCH_3_NS_ID_FMA4
400 #endif
401 #if SIMDPP_ARCH_PP_NS_USE_XOP
402 #define SIMDPP_DISPATCH_3_NS_ID_XOP SIMDPP_INSN_ID_XOP
403 #else
404 #define SIMDPP_DISPATCH_3_NS_ID_XOP
405 #endif
406 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
407 #define SIMDPP_DISPATCH_3_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
408 #else
409 #define SIMDPP_DISPATCH_3_NS_ID_AVX512F
410 #endif
411 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
412 #define SIMDPP_DISPATCH_3_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
413 #else
414 #define SIMDPP_DISPATCH_3_NS_ID_AVX512BW
415 #endif
416 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
417 #define SIMDPP_DISPATCH_3_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
418 #else
419 #define SIMDPP_DISPATCH_3_NS_ID_AVX512DQ
420 #endif
421 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
422 #define SIMDPP_DISPATCH_3_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
423 #else
424 #define SIMDPP_DISPATCH_3_NS_ID_AVX512VL
425 #endif
426 #if SIMDPP_ARCH_PP_NS_USE_NEON
427 #define SIMDPP_DISPATCH_3_NS_ID_NEON SIMDPP_INSN_ID_NEON
428 #else
429 #define SIMDPP_DISPATCH_3_NS_ID_NEON
430 #endif
431 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
432 #define SIMDPP_DISPATCH_3_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
433 #else
434 #define SIMDPP_DISPATCH_3_NS_ID_NEON_FLT_SP
435 #endif
436 #if SIMDPP_ARCH_PP_NS_USE_MSA
437 #define SIMDPP_DISPATCH_3_NS_ID_MSA SIMDPP_INSN_ID_MSA
438 #else
439 #define SIMDPP_DISPATCH_3_NS_ID_MSA
440 #endif
441 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
442 #define SIMDPP_DISPATCH_3_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
443 #else
444 #define SIMDPP_DISPATCH_3_NS_ID_ALTIVEC
445 #endif
446 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
447 #define SIMDPP_DISPATCH_3_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
448 #else
449 #define SIMDPP_DISPATCH_3_NS_ID_VSX_206
450 #endif
451 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
452 #define SIMDPP_DISPATCH_3_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
453 #else
454 #define SIMDPP_DISPATCH_3_NS_ID_VSX_207
455 #endif
456
457 #define SIMDPP_DISPATCH_3_NAMESPACE SIMDPP_PP_PASTE22(arch, \
458 SIMDPP_DISPATCH_3_NS_ID_NULL, \
459 SIMDPP_DISPATCH_3_NS_ID_SSE2, \
460 SIMDPP_DISPATCH_3_NS_ID_SSE3, \
461 SIMDPP_DISPATCH_3_NS_ID_SSSE3, \
462 SIMDPP_DISPATCH_3_NS_ID_SSE4_1, \
463 SIMDPP_DISPATCH_3_NS_ID_POPCNT_INSN, \
464 SIMDPP_DISPATCH_3_NS_ID_AVX, \
465 SIMDPP_DISPATCH_3_NS_ID_AVX2, \
466 SIMDPP_DISPATCH_3_NS_ID_AVX512F, \
467 SIMDPP_DISPATCH_3_NS_ID_AVX512BW, \
468 SIMDPP_DISPATCH_3_NS_ID_AVX512DQ, \
469 SIMDPP_DISPATCH_3_NS_ID_AVX512VL, \
470 SIMDPP_DISPATCH_3_NS_ID_FMA3, \
471 SIMDPP_DISPATCH_3_NS_ID_FMA4, \
472 SIMDPP_DISPATCH_3_NS_ID_XOP, \
473 SIMDPP_DISPATCH_3_NS_ID_NEON, \
474 SIMDPP_DISPATCH_3_NS_ID_NEON_FLT_SP, \
475 SIMDPP_DISPATCH_3_NS_ID_MSA, \
476 SIMDPP_DISPATCH_3_NS_ID_ALTIVEC, \
477 SIMDPP_DISPATCH_3_NS_ID_VSX_206, \
478 SIMDPP_DISPATCH_3_NS_ID_VSX_207)
479
480 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_3_NAMESPACE
481 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
482 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
483 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
484 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
485
486 #define SIMDPP_DISPATCH_3_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
487 { /* the following will fail if the overload is not available */ \
488 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_3_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
489 ARRAY[3-1] = ::simdpp::SIMDPP_DISPATCH_3_NAMESPACE::detail::create_fn_version(fun_ptr);\
490 }
491
492 #define SIMDPP_DISPATCH_3_FN_DECLARE(SIGNATURE) \
493 namespace SIMDPP_DISPATCH_3_NAMESPACE { \
494 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
495 }
496 #undef SIMDPP_ARCH_PP_LIST
497#else
498 #define SIMDPP_DISPATCH_3_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
499 #define SIMDPP_DISPATCH_3_FN_DECLARE(SIGNATURE)
500#endif
501
502#ifdef SIMDPP_DISPATCH_ARCH4
503 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH4
504 #include <simdpp/detail/preprocess_single_arch.h>
505
506 // Use the results of preprocess_single_arch.h to define
507 // SIMDPP_DISPATCH_4_NAMESPACE
508
509 #if SIMDPP_ARCH_PP_NS_USE_NULL
510 #define SIMDPP_DISPATCH_4_NS_ID_NULL SIMDPP_INSN_ID_NULL
511 #else
512 #define SIMDPP_DISPATCH_4_NS_ID_NULL
513 #endif
514 #if SIMDPP_ARCH_PP_NS_USE_SSE2
515 #define SIMDPP_DISPATCH_4_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
516 #else
517 #define SIMDPP_DISPATCH_4_NS_ID_SSE2
518 #endif
519 #if SIMDPP_ARCH_PP_NS_USE_SSE3
520 #define SIMDPP_DISPATCH_4_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
521 #else
522 #define SIMDPP_DISPATCH_4_NS_ID_SSE3
523 #endif
524 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
525 #define SIMDPP_DISPATCH_4_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
526 #else
527 #define SIMDPP_DISPATCH_4_NS_ID_SSSE3
528 #endif
529 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
530 #define SIMDPP_DISPATCH_4_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
531 #else
532 #define SIMDPP_DISPATCH_4_NS_ID_SSE4_1
533 #endif
534 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
535 #define SIMDPP_DISPATCH_4_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
536 #else
537 #define SIMDPP_DISPATCH_4_NS_ID_POPCNT_INSN
538 #endif
539 #if SIMDPP_ARCH_PP_NS_USE_AVX
540 #define SIMDPP_DISPATCH_4_NS_ID_AVX SIMDPP_INSN_ID_AVX
541 #else
542 #define SIMDPP_DISPATCH_4_NS_ID_AVX
543 #endif
544 #if SIMDPP_ARCH_PP_NS_USE_AVX2
545 #define SIMDPP_DISPATCH_4_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
546 #else
547 #define SIMDPP_DISPATCH_4_NS_ID_AVX2
548 #endif
549 #if SIMDPP_ARCH_PP_NS_USE_FMA3
550 #define SIMDPP_DISPATCH_4_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
551 #else
552 #define SIMDPP_DISPATCH_4_NS_ID_FMA3
553 #endif
554 #if SIMDPP_ARCH_PP_NS_USE_FMA4
555 #define SIMDPP_DISPATCH_4_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
556 #else
557 #define SIMDPP_DISPATCH_4_NS_ID_FMA4
558 #endif
559 #if SIMDPP_ARCH_PP_NS_USE_XOP
560 #define SIMDPP_DISPATCH_4_NS_ID_XOP SIMDPP_INSN_ID_XOP
561 #else
562 #define SIMDPP_DISPATCH_4_NS_ID_XOP
563 #endif
564 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
565 #define SIMDPP_DISPATCH_4_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
566 #else
567 #define SIMDPP_DISPATCH_4_NS_ID_AVX512F
568 #endif
569 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
570 #define SIMDPP_DISPATCH_4_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
571 #else
572 #define SIMDPP_DISPATCH_4_NS_ID_AVX512BW
573 #endif
574 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
575 #define SIMDPP_DISPATCH_4_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
576 #else
577 #define SIMDPP_DISPATCH_4_NS_ID_AVX512DQ
578 #endif
579 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
580 #define SIMDPP_DISPATCH_4_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
581 #else
582 #define SIMDPP_DISPATCH_4_NS_ID_AVX512VL
583 #endif
584 #if SIMDPP_ARCH_PP_NS_USE_NEON
585 #define SIMDPP_DISPATCH_4_NS_ID_NEON SIMDPP_INSN_ID_NEON
586 #else
587 #define SIMDPP_DISPATCH_4_NS_ID_NEON
588 #endif
589 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
590 #define SIMDPP_DISPATCH_4_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
591 #else
592 #define SIMDPP_DISPATCH_4_NS_ID_NEON_FLT_SP
593 #endif
594 #if SIMDPP_ARCH_PP_NS_USE_MSA
595 #define SIMDPP_DISPATCH_4_NS_ID_MSA SIMDPP_INSN_ID_MSA
596 #else
597 #define SIMDPP_DISPATCH_4_NS_ID_MSA
598 #endif
599 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
600 #define SIMDPP_DISPATCH_4_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
601 #else
602 #define SIMDPP_DISPATCH_4_NS_ID_ALTIVEC
603 #endif
604 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
605 #define SIMDPP_DISPATCH_4_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
606 #else
607 #define SIMDPP_DISPATCH_4_NS_ID_VSX_206
608 #endif
609 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
610 #define SIMDPP_DISPATCH_4_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
611 #else
612 #define SIMDPP_DISPATCH_4_NS_ID_VSX_207
613 #endif
614
615 #define SIMDPP_DISPATCH_4_NAMESPACE SIMDPP_PP_PASTE22(arch, \
616 SIMDPP_DISPATCH_4_NS_ID_NULL, \
617 SIMDPP_DISPATCH_4_NS_ID_SSE2, \
618 SIMDPP_DISPATCH_4_NS_ID_SSE3, \
619 SIMDPP_DISPATCH_4_NS_ID_SSSE3, \
620 SIMDPP_DISPATCH_4_NS_ID_SSE4_1, \
621 SIMDPP_DISPATCH_4_NS_ID_POPCNT_INSN, \
622 SIMDPP_DISPATCH_4_NS_ID_AVX, \
623 SIMDPP_DISPATCH_4_NS_ID_AVX2, \
624 SIMDPP_DISPATCH_4_NS_ID_AVX512F, \
625 SIMDPP_DISPATCH_4_NS_ID_AVX512BW, \
626 SIMDPP_DISPATCH_4_NS_ID_AVX512DQ, \
627 SIMDPP_DISPATCH_4_NS_ID_AVX512VL, \
628 SIMDPP_DISPATCH_4_NS_ID_FMA3, \
629 SIMDPP_DISPATCH_4_NS_ID_FMA4, \
630 SIMDPP_DISPATCH_4_NS_ID_XOP, \
631 SIMDPP_DISPATCH_4_NS_ID_NEON, \
632 SIMDPP_DISPATCH_4_NS_ID_NEON_FLT_SP, \
633 SIMDPP_DISPATCH_4_NS_ID_MSA, \
634 SIMDPP_DISPATCH_4_NS_ID_ALTIVEC, \
635 SIMDPP_DISPATCH_4_NS_ID_VSX_206, \
636 SIMDPP_DISPATCH_4_NS_ID_VSX_207)
637
638 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_4_NAMESPACE
639 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
640 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
641 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
642 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
643
644 #define SIMDPP_DISPATCH_4_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
645 { /* the following will fail if the overload is not available */ \
646 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_4_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
647 ARRAY[4-1] = ::simdpp::SIMDPP_DISPATCH_4_NAMESPACE::detail::create_fn_version(fun_ptr);\
648 }
649
650 #define SIMDPP_DISPATCH_4_FN_DECLARE(SIGNATURE) \
651 namespace SIMDPP_DISPATCH_4_NAMESPACE { \
652 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
653 }
654 #undef SIMDPP_ARCH_PP_LIST
655#else
656 #define SIMDPP_DISPATCH_4_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
657 #define SIMDPP_DISPATCH_4_FN_DECLARE(SIGNATURE)
658#endif
659
660#ifdef SIMDPP_DISPATCH_ARCH5
661 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH5
662 #include <simdpp/detail/preprocess_single_arch.h>
663
664 // Use the results of preprocess_single_arch.h to define
665 // SIMDPP_DISPATCH_5_NAMESPACE
666
667 #if SIMDPP_ARCH_PP_NS_USE_NULL
668 #define SIMDPP_DISPATCH_5_NS_ID_NULL SIMDPP_INSN_ID_NULL
669 #else
670 #define SIMDPP_DISPATCH_5_NS_ID_NULL
671 #endif
672 #if SIMDPP_ARCH_PP_NS_USE_SSE2
673 #define SIMDPP_DISPATCH_5_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
674 #else
675 #define SIMDPP_DISPATCH_5_NS_ID_SSE2
676 #endif
677 #if SIMDPP_ARCH_PP_NS_USE_SSE3
678 #define SIMDPP_DISPATCH_5_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
679 #else
680 #define SIMDPP_DISPATCH_5_NS_ID_SSE3
681 #endif
682 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
683 #define SIMDPP_DISPATCH_5_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
684 #else
685 #define SIMDPP_DISPATCH_5_NS_ID_SSSE3
686 #endif
687 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
688 #define SIMDPP_DISPATCH_5_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
689 #else
690 #define SIMDPP_DISPATCH_5_NS_ID_SSE4_1
691 #endif
692 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
693 #define SIMDPP_DISPATCH_5_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
694 #else
695 #define SIMDPP_DISPATCH_5_NS_ID_POPCNT_INSN
696 #endif
697 #if SIMDPP_ARCH_PP_NS_USE_AVX
698 #define SIMDPP_DISPATCH_5_NS_ID_AVX SIMDPP_INSN_ID_AVX
699 #else
700 #define SIMDPP_DISPATCH_5_NS_ID_AVX
701 #endif
702 #if SIMDPP_ARCH_PP_NS_USE_AVX2
703 #define SIMDPP_DISPATCH_5_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
704 #else
705 #define SIMDPP_DISPATCH_5_NS_ID_AVX2
706 #endif
707 #if SIMDPP_ARCH_PP_NS_USE_FMA3
708 #define SIMDPP_DISPATCH_5_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
709 #else
710 #define SIMDPP_DISPATCH_5_NS_ID_FMA3
711 #endif
712 #if SIMDPP_ARCH_PP_NS_USE_FMA4
713 #define SIMDPP_DISPATCH_5_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
714 #else
715 #define SIMDPP_DISPATCH_5_NS_ID_FMA4
716 #endif
717 #if SIMDPP_ARCH_PP_NS_USE_XOP
718 #define SIMDPP_DISPATCH_5_NS_ID_XOP SIMDPP_INSN_ID_XOP
719 #else
720 #define SIMDPP_DISPATCH_5_NS_ID_XOP
721 #endif
722 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
723 #define SIMDPP_DISPATCH_5_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
724 #else
725 #define SIMDPP_DISPATCH_5_NS_ID_AVX512F
726 #endif
727 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
728 #define SIMDPP_DISPATCH_5_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
729 #else
730 #define SIMDPP_DISPATCH_5_NS_ID_AVX512BW
731 #endif
732 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
733 #define SIMDPP_DISPATCH_5_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
734 #else
735 #define SIMDPP_DISPATCH_5_NS_ID_AVX512DQ
736 #endif
737 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
738 #define SIMDPP_DISPATCH_5_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
739 #else
740 #define SIMDPP_DISPATCH_5_NS_ID_AVX512VL
741 #endif
742 #if SIMDPP_ARCH_PP_NS_USE_NEON
743 #define SIMDPP_DISPATCH_5_NS_ID_NEON SIMDPP_INSN_ID_NEON
744 #else
745 #define SIMDPP_DISPATCH_5_NS_ID_NEON
746 #endif
747 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
748 #define SIMDPP_DISPATCH_5_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
749 #else
750 #define SIMDPP_DISPATCH_5_NS_ID_NEON_FLT_SP
751 #endif
752 #if SIMDPP_ARCH_PP_NS_USE_MSA
753 #define SIMDPP_DISPATCH_5_NS_ID_MSA SIMDPP_INSN_ID_MSA
754 #else
755 #define SIMDPP_DISPATCH_5_NS_ID_MSA
756 #endif
757 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
758 #define SIMDPP_DISPATCH_5_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
759 #else
760 #define SIMDPP_DISPATCH_5_NS_ID_ALTIVEC
761 #endif
762 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
763 #define SIMDPP_DISPATCH_5_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
764 #else
765 #define SIMDPP_DISPATCH_5_NS_ID_VSX_206
766 #endif
767 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
768 #define SIMDPP_DISPATCH_5_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
769 #else
770 #define SIMDPP_DISPATCH_5_NS_ID_VSX_207
771 #endif
772
773 #define SIMDPP_DISPATCH_5_NAMESPACE SIMDPP_PP_PASTE22(arch, \
774 SIMDPP_DISPATCH_5_NS_ID_NULL, \
775 SIMDPP_DISPATCH_5_NS_ID_SSE2, \
776 SIMDPP_DISPATCH_5_NS_ID_SSE3, \
777 SIMDPP_DISPATCH_5_NS_ID_SSSE3, \
778 SIMDPP_DISPATCH_5_NS_ID_SSE4_1, \
779 SIMDPP_DISPATCH_5_NS_ID_POPCNT_INSN, \
780 SIMDPP_DISPATCH_5_NS_ID_AVX, \
781 SIMDPP_DISPATCH_5_NS_ID_AVX2, \
782 SIMDPP_DISPATCH_5_NS_ID_AVX512F, \
783 SIMDPP_DISPATCH_5_NS_ID_AVX512BW, \
784 SIMDPP_DISPATCH_5_NS_ID_AVX512DQ, \
785 SIMDPP_DISPATCH_5_NS_ID_AVX512VL, \
786 SIMDPP_DISPATCH_5_NS_ID_FMA3, \
787 SIMDPP_DISPATCH_5_NS_ID_FMA4, \
788 SIMDPP_DISPATCH_5_NS_ID_XOP, \
789 SIMDPP_DISPATCH_5_NS_ID_NEON, \
790 SIMDPP_DISPATCH_5_NS_ID_NEON_FLT_SP, \
791 SIMDPP_DISPATCH_5_NS_ID_MSA, \
792 SIMDPP_DISPATCH_5_NS_ID_ALTIVEC, \
793 SIMDPP_DISPATCH_5_NS_ID_VSX_206, \
794 SIMDPP_DISPATCH_5_NS_ID_VSX_207)
795
796 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_5_NAMESPACE
797 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
798 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
799 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
800 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
801
802 #define SIMDPP_DISPATCH_5_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
803 { /* the following will fail if the overload is not available */ \
804 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_5_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
805 ARRAY[5-1] = ::simdpp::SIMDPP_DISPATCH_5_NAMESPACE::detail::create_fn_version(fun_ptr);\
806 }
807
808 #define SIMDPP_DISPATCH_5_FN_DECLARE(SIGNATURE) \
809 namespace SIMDPP_DISPATCH_5_NAMESPACE { \
810 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
811 }
812 #undef SIMDPP_ARCH_PP_LIST
813#else
814 #define SIMDPP_DISPATCH_5_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
815 #define SIMDPP_DISPATCH_5_FN_DECLARE(SIGNATURE)
816#endif
817
818#ifdef SIMDPP_DISPATCH_ARCH6
819 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH6
820 #include <simdpp/detail/preprocess_single_arch.h>
821
822 // Use the results of preprocess_single_arch.h to define
823 // SIMDPP_DISPATCH_6_NAMESPACE
824
825 #if SIMDPP_ARCH_PP_NS_USE_NULL
826 #define SIMDPP_DISPATCH_6_NS_ID_NULL SIMDPP_INSN_ID_NULL
827 #else
828 #define SIMDPP_DISPATCH_6_NS_ID_NULL
829 #endif
830 #if SIMDPP_ARCH_PP_NS_USE_SSE2
831 #define SIMDPP_DISPATCH_6_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
832 #else
833 #define SIMDPP_DISPATCH_6_NS_ID_SSE2
834 #endif
835 #if SIMDPP_ARCH_PP_NS_USE_SSE3
836 #define SIMDPP_DISPATCH_6_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
837 #else
838 #define SIMDPP_DISPATCH_6_NS_ID_SSE3
839 #endif
840 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
841 #define SIMDPP_DISPATCH_6_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
842 #else
843 #define SIMDPP_DISPATCH_6_NS_ID_SSSE3
844 #endif
845 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
846 #define SIMDPP_DISPATCH_6_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
847 #else
848 #define SIMDPP_DISPATCH_6_NS_ID_SSE4_1
849 #endif
850 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
851 #define SIMDPP_DISPATCH_6_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
852 #else
853 #define SIMDPP_DISPATCH_6_NS_ID_POPCNT_INSN
854 #endif
855 #if SIMDPP_ARCH_PP_NS_USE_AVX
856 #define SIMDPP_DISPATCH_6_NS_ID_AVX SIMDPP_INSN_ID_AVX
857 #else
858 #define SIMDPP_DISPATCH_6_NS_ID_AVX
859 #endif
860 #if SIMDPP_ARCH_PP_NS_USE_AVX2
861 #define SIMDPP_DISPATCH_6_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
862 #else
863 #define SIMDPP_DISPATCH_6_NS_ID_AVX2
864 #endif
865 #if SIMDPP_ARCH_PP_NS_USE_FMA3
866 #define SIMDPP_DISPATCH_6_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
867 #else
868 #define SIMDPP_DISPATCH_6_NS_ID_FMA3
869 #endif
870 #if SIMDPP_ARCH_PP_NS_USE_FMA4
871 #define SIMDPP_DISPATCH_6_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
872 #else
873 #define SIMDPP_DISPATCH_6_NS_ID_FMA4
874 #endif
875 #if SIMDPP_ARCH_PP_NS_USE_XOP
876 #define SIMDPP_DISPATCH_6_NS_ID_XOP SIMDPP_INSN_ID_XOP
877 #else
878 #define SIMDPP_DISPATCH_6_NS_ID_XOP
879 #endif
880 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
881 #define SIMDPP_DISPATCH_6_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
882 #else
883 #define SIMDPP_DISPATCH_6_NS_ID_AVX512F
884 #endif
885 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
886 #define SIMDPP_DISPATCH_6_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
887 #else
888 #define SIMDPP_DISPATCH_6_NS_ID_AVX512BW
889 #endif
890 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
891 #define SIMDPP_DISPATCH_6_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
892 #else
893 #define SIMDPP_DISPATCH_6_NS_ID_AVX512DQ
894 #endif
895 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
896 #define SIMDPP_DISPATCH_6_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
897 #else
898 #define SIMDPP_DISPATCH_6_NS_ID_AVX512VL
899 #endif
900 #if SIMDPP_ARCH_PP_NS_USE_NEON
901 #define SIMDPP_DISPATCH_6_NS_ID_NEON SIMDPP_INSN_ID_NEON
902 #else
903 #define SIMDPP_DISPATCH_6_NS_ID_NEON
904 #endif
905 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
906 #define SIMDPP_DISPATCH_6_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
907 #else
908 #define SIMDPP_DISPATCH_6_NS_ID_NEON_FLT_SP
909 #endif
910 #if SIMDPP_ARCH_PP_NS_USE_MSA
911 #define SIMDPP_DISPATCH_6_NS_ID_MSA SIMDPP_INSN_ID_MSA
912 #else
913 #define SIMDPP_DISPATCH_6_NS_ID_MSA
914 #endif
915 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
916 #define SIMDPP_DISPATCH_6_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
917 #else
918 #define SIMDPP_DISPATCH_6_NS_ID_ALTIVEC
919 #endif
920 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
921 #define SIMDPP_DISPATCH_6_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
922 #else
923 #define SIMDPP_DISPATCH_6_NS_ID_VSX_206
924 #endif
925 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
926 #define SIMDPP_DISPATCH_6_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
927 #else
928 #define SIMDPP_DISPATCH_6_NS_ID_VSX_207
929 #endif
930
931 #define SIMDPP_DISPATCH_6_NAMESPACE SIMDPP_PP_PASTE22(arch, \
932 SIMDPP_DISPATCH_6_NS_ID_NULL, \
933 SIMDPP_DISPATCH_6_NS_ID_SSE2, \
934 SIMDPP_DISPATCH_6_NS_ID_SSE3, \
935 SIMDPP_DISPATCH_6_NS_ID_SSSE3, \
936 SIMDPP_DISPATCH_6_NS_ID_SSE4_1, \
937 SIMDPP_DISPATCH_6_NS_ID_POPCNT_INSN, \
938 SIMDPP_DISPATCH_6_NS_ID_AVX, \
939 SIMDPP_DISPATCH_6_NS_ID_AVX2, \
940 SIMDPP_DISPATCH_6_NS_ID_AVX512F, \
941 SIMDPP_DISPATCH_6_NS_ID_AVX512BW, \
942 SIMDPP_DISPATCH_6_NS_ID_AVX512DQ, \
943 SIMDPP_DISPATCH_6_NS_ID_AVX512VL, \
944 SIMDPP_DISPATCH_6_NS_ID_FMA3, \
945 SIMDPP_DISPATCH_6_NS_ID_FMA4, \
946 SIMDPP_DISPATCH_6_NS_ID_XOP, \
947 SIMDPP_DISPATCH_6_NS_ID_NEON, \
948 SIMDPP_DISPATCH_6_NS_ID_NEON_FLT_SP, \
949 SIMDPP_DISPATCH_6_NS_ID_MSA, \
950 SIMDPP_DISPATCH_6_NS_ID_ALTIVEC, \
951 SIMDPP_DISPATCH_6_NS_ID_VSX_206, \
952 SIMDPP_DISPATCH_6_NS_ID_VSX_207)
953
954 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_6_NAMESPACE
955 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
956 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
957 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
958 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
959
960 #define SIMDPP_DISPATCH_6_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
961 { /* the following will fail if the overload is not available */ \
962 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_6_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
963 ARRAY[6-1] = ::simdpp::SIMDPP_DISPATCH_6_NAMESPACE::detail::create_fn_version(fun_ptr);\
964 }
965
966 #define SIMDPP_DISPATCH_6_FN_DECLARE(SIGNATURE) \
967 namespace SIMDPP_DISPATCH_6_NAMESPACE { \
968 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
969 }
970 #undef SIMDPP_ARCH_PP_LIST
971#else
972 #define SIMDPP_DISPATCH_6_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
973 #define SIMDPP_DISPATCH_6_FN_DECLARE(SIGNATURE)
974#endif
975
976#ifdef SIMDPP_DISPATCH_ARCH7
977 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH7
978 #include <simdpp/detail/preprocess_single_arch.h>
979
980 // Use the results of preprocess_single_arch.h to define
981 // SIMDPP_DISPATCH_7_NAMESPACE
982
983 #if SIMDPP_ARCH_PP_NS_USE_NULL
984 #define SIMDPP_DISPATCH_7_NS_ID_NULL SIMDPP_INSN_ID_NULL
985 #else
986 #define SIMDPP_DISPATCH_7_NS_ID_NULL
987 #endif
988 #if SIMDPP_ARCH_PP_NS_USE_SSE2
989 #define SIMDPP_DISPATCH_7_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
990 #else
991 #define SIMDPP_DISPATCH_7_NS_ID_SSE2
992 #endif
993 #if SIMDPP_ARCH_PP_NS_USE_SSE3
994 #define SIMDPP_DISPATCH_7_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
995 #else
996 #define SIMDPP_DISPATCH_7_NS_ID_SSE3
997 #endif
998 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
999 #define SIMDPP_DISPATCH_7_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
1000 #else
1001 #define SIMDPP_DISPATCH_7_NS_ID_SSSE3
1002 #endif
1003 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
1004 #define SIMDPP_DISPATCH_7_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
1005 #else
1006 #define SIMDPP_DISPATCH_7_NS_ID_SSE4_1
1007 #endif
1008 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
1009 #define SIMDPP_DISPATCH_7_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
1010 #else
1011 #define SIMDPP_DISPATCH_7_NS_ID_POPCNT_INSN
1012 #endif
1013 #if SIMDPP_ARCH_PP_NS_USE_AVX
1014 #define SIMDPP_DISPATCH_7_NS_ID_AVX SIMDPP_INSN_ID_AVX
1015 #else
1016 #define SIMDPP_DISPATCH_7_NS_ID_AVX
1017 #endif
1018 #if SIMDPP_ARCH_PP_NS_USE_AVX2
1019 #define SIMDPP_DISPATCH_7_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
1020 #else
1021 #define SIMDPP_DISPATCH_7_NS_ID_AVX2
1022 #endif
1023 #if SIMDPP_ARCH_PP_NS_USE_FMA3
1024 #define SIMDPP_DISPATCH_7_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
1025 #else
1026 #define SIMDPP_DISPATCH_7_NS_ID_FMA3
1027 #endif
1028 #if SIMDPP_ARCH_PP_NS_USE_FMA4
1029 #define SIMDPP_DISPATCH_7_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
1030 #else
1031 #define SIMDPP_DISPATCH_7_NS_ID_FMA4
1032 #endif
1033 #if SIMDPP_ARCH_PP_NS_USE_XOP
1034 #define SIMDPP_DISPATCH_7_NS_ID_XOP SIMDPP_INSN_ID_XOP
1035 #else
1036 #define SIMDPP_DISPATCH_7_NS_ID_XOP
1037 #endif
1038 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
1039 #define SIMDPP_DISPATCH_7_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
1040 #else
1041 #define SIMDPP_DISPATCH_7_NS_ID_AVX512F
1042 #endif
1043 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
1044 #define SIMDPP_DISPATCH_7_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
1045 #else
1046 #define SIMDPP_DISPATCH_7_NS_ID_AVX512BW
1047 #endif
1048 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
1049 #define SIMDPP_DISPATCH_7_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
1050 #else
1051 #define SIMDPP_DISPATCH_7_NS_ID_AVX512DQ
1052 #endif
1053 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
1054 #define SIMDPP_DISPATCH_7_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
1055 #else
1056 #define SIMDPP_DISPATCH_7_NS_ID_AVX512VL
1057 #endif
1058 #if SIMDPP_ARCH_PP_NS_USE_NEON
1059 #define SIMDPP_DISPATCH_7_NS_ID_NEON SIMDPP_INSN_ID_NEON
1060 #else
1061 #define SIMDPP_DISPATCH_7_NS_ID_NEON
1062 #endif
1063 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
1064 #define SIMDPP_DISPATCH_7_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
1065 #else
1066 #define SIMDPP_DISPATCH_7_NS_ID_NEON_FLT_SP
1067 #endif
1068 #if SIMDPP_ARCH_PP_NS_USE_MSA
1069 #define SIMDPP_DISPATCH_7_NS_ID_MSA SIMDPP_INSN_ID_MSA
1070 #else
1071 #define SIMDPP_DISPATCH_7_NS_ID_MSA
1072 #endif
1073 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
1074 #define SIMDPP_DISPATCH_7_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
1075 #else
1076 #define SIMDPP_DISPATCH_7_NS_ID_ALTIVEC
1077 #endif
1078 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
1079 #define SIMDPP_DISPATCH_7_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
1080 #else
1081 #define SIMDPP_DISPATCH_7_NS_ID_VSX_206
1082 #endif
1083 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
1084 #define SIMDPP_DISPATCH_7_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
1085 #else
1086 #define SIMDPP_DISPATCH_7_NS_ID_VSX_207
1087 #endif
1088
1089 #define SIMDPP_DISPATCH_7_NAMESPACE SIMDPP_PP_PASTE22(arch, \
1090 SIMDPP_DISPATCH_7_NS_ID_NULL, \
1091 SIMDPP_DISPATCH_7_NS_ID_SSE2, \
1092 SIMDPP_DISPATCH_7_NS_ID_SSE3, \
1093 SIMDPP_DISPATCH_7_NS_ID_SSSE3, \
1094 SIMDPP_DISPATCH_7_NS_ID_SSE4_1, \
1095 SIMDPP_DISPATCH_7_NS_ID_POPCNT_INSN, \
1096 SIMDPP_DISPATCH_7_NS_ID_AVX, \
1097 SIMDPP_DISPATCH_7_NS_ID_AVX2, \
1098 SIMDPP_DISPATCH_7_NS_ID_AVX512F, \
1099 SIMDPP_DISPATCH_7_NS_ID_AVX512BW, \
1100 SIMDPP_DISPATCH_7_NS_ID_AVX512DQ, \
1101 SIMDPP_DISPATCH_7_NS_ID_AVX512VL, \
1102 SIMDPP_DISPATCH_7_NS_ID_FMA3, \
1103 SIMDPP_DISPATCH_7_NS_ID_FMA4, \
1104 SIMDPP_DISPATCH_7_NS_ID_XOP, \
1105 SIMDPP_DISPATCH_7_NS_ID_NEON, \
1106 SIMDPP_DISPATCH_7_NS_ID_NEON_FLT_SP, \
1107 SIMDPP_DISPATCH_7_NS_ID_MSA, \
1108 SIMDPP_DISPATCH_7_NS_ID_ALTIVEC, \
1109 SIMDPP_DISPATCH_7_NS_ID_VSX_206, \
1110 SIMDPP_DISPATCH_7_NS_ID_VSX_207)
1111
1112 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_7_NAMESPACE
1113 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
1114 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
1115 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
1116 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
1117
1118 #define SIMDPP_DISPATCH_7_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
1119 { /* the following will fail if the overload is not available */ \
1120 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_7_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
1121 ARRAY[7-1] = ::simdpp::SIMDPP_DISPATCH_7_NAMESPACE::detail::create_fn_version(fun_ptr);\
1122 }
1123
1124 #define SIMDPP_DISPATCH_7_FN_DECLARE(SIGNATURE) \
1125 namespace SIMDPP_DISPATCH_7_NAMESPACE { \
1126 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
1127 }
1128 #undef SIMDPP_ARCH_PP_LIST
1129#else
1130 #define SIMDPP_DISPATCH_7_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
1131 #define SIMDPP_DISPATCH_7_FN_DECLARE(SIGNATURE)
1132#endif
1133
1134#ifdef SIMDPP_DISPATCH_ARCH8
1135 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH8
1136 #include <simdpp/detail/preprocess_single_arch.h>
1137
1138 // Use the results of preprocess_single_arch.h to define
1139 // SIMDPP_DISPATCH_8_NAMESPACE
1140
1141 #if SIMDPP_ARCH_PP_NS_USE_NULL
1142 #define SIMDPP_DISPATCH_8_NS_ID_NULL SIMDPP_INSN_ID_NULL
1143 #else
1144 #define SIMDPP_DISPATCH_8_NS_ID_NULL
1145 #endif
1146 #if SIMDPP_ARCH_PP_NS_USE_SSE2
1147 #define SIMDPP_DISPATCH_8_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
1148 #else
1149 #define SIMDPP_DISPATCH_8_NS_ID_SSE2
1150 #endif
1151 #if SIMDPP_ARCH_PP_NS_USE_SSE3
1152 #define SIMDPP_DISPATCH_8_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
1153 #else
1154 #define SIMDPP_DISPATCH_8_NS_ID_SSE3
1155 #endif
1156 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
1157 #define SIMDPP_DISPATCH_8_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
1158 #else
1159 #define SIMDPP_DISPATCH_8_NS_ID_SSSE3
1160 #endif
1161 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
1162 #define SIMDPP_DISPATCH_8_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
1163 #else
1164 #define SIMDPP_DISPATCH_8_NS_ID_SSE4_1
1165 #endif
1166 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
1167 #define SIMDPP_DISPATCH_8_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
1168 #else
1169 #define SIMDPP_DISPATCH_8_NS_ID_POPCNT_INSN
1170 #endif
1171 #if SIMDPP_ARCH_PP_NS_USE_AVX
1172 #define SIMDPP_DISPATCH_8_NS_ID_AVX SIMDPP_INSN_ID_AVX
1173 #else
1174 #define SIMDPP_DISPATCH_8_NS_ID_AVX
1175 #endif
1176 #if SIMDPP_ARCH_PP_NS_USE_AVX2
1177 #define SIMDPP_DISPATCH_8_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
1178 #else
1179 #define SIMDPP_DISPATCH_8_NS_ID_AVX2
1180 #endif
1181 #if SIMDPP_ARCH_PP_NS_USE_FMA3
1182 #define SIMDPP_DISPATCH_8_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
1183 #else
1184 #define SIMDPP_DISPATCH_8_NS_ID_FMA3
1185 #endif
1186 #if SIMDPP_ARCH_PP_NS_USE_FMA4
1187 #define SIMDPP_DISPATCH_8_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
1188 #else
1189 #define SIMDPP_DISPATCH_8_NS_ID_FMA4
1190 #endif
1191 #if SIMDPP_ARCH_PP_NS_USE_XOP
1192 #define SIMDPP_DISPATCH_8_NS_ID_XOP SIMDPP_INSN_ID_XOP
1193 #else
1194 #define SIMDPP_DISPATCH_8_NS_ID_XOP
1195 #endif
1196 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
1197 #define SIMDPP_DISPATCH_8_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
1198 #else
1199 #define SIMDPP_DISPATCH_8_NS_ID_AVX512F
1200 #endif
1201 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
1202 #define SIMDPP_DISPATCH_8_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
1203 #else
1204 #define SIMDPP_DISPATCH_8_NS_ID_AVX512BW
1205 #endif
1206 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
1207 #define SIMDPP_DISPATCH_8_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
1208 #else
1209 #define SIMDPP_DISPATCH_8_NS_ID_AVX512DQ
1210 #endif
1211 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
1212 #define SIMDPP_DISPATCH_8_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
1213 #else
1214 #define SIMDPP_DISPATCH_8_NS_ID_AVX512VL
1215 #endif
1216 #if SIMDPP_ARCH_PP_NS_USE_NEON
1217 #define SIMDPP_DISPATCH_8_NS_ID_NEON SIMDPP_INSN_ID_NEON
1218 #else
1219 #define SIMDPP_DISPATCH_8_NS_ID_NEON
1220 #endif
1221 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
1222 #define SIMDPP_DISPATCH_8_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
1223 #else
1224 #define SIMDPP_DISPATCH_8_NS_ID_NEON_FLT_SP
1225 #endif
1226 #if SIMDPP_ARCH_PP_NS_USE_MSA
1227 #define SIMDPP_DISPATCH_8_NS_ID_MSA SIMDPP_INSN_ID_MSA
1228 #else
1229 #define SIMDPP_DISPATCH_8_NS_ID_MSA
1230 #endif
1231 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
1232 #define SIMDPP_DISPATCH_8_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
1233 #else
1234 #define SIMDPP_DISPATCH_8_NS_ID_ALTIVEC
1235 #endif
1236 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
1237 #define SIMDPP_DISPATCH_8_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
1238 #else
1239 #define SIMDPP_DISPATCH_8_NS_ID_VSX_206
1240 #endif
1241 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
1242 #define SIMDPP_DISPATCH_8_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
1243 #else
1244 #define SIMDPP_DISPATCH_8_NS_ID_VSX_207
1245 #endif
1246
1247 #define SIMDPP_DISPATCH_8_NAMESPACE SIMDPP_PP_PASTE22(arch, \
1248 SIMDPP_DISPATCH_8_NS_ID_NULL, \
1249 SIMDPP_DISPATCH_8_NS_ID_SSE2, \
1250 SIMDPP_DISPATCH_8_NS_ID_SSE3, \
1251 SIMDPP_DISPATCH_8_NS_ID_SSSE3, \
1252 SIMDPP_DISPATCH_8_NS_ID_SSE4_1, \
1253 SIMDPP_DISPATCH_8_NS_ID_POPCNT_INSN, \
1254 SIMDPP_DISPATCH_8_NS_ID_AVX, \
1255 SIMDPP_DISPATCH_8_NS_ID_AVX2, \
1256 SIMDPP_DISPATCH_8_NS_ID_AVX512F, \
1257 SIMDPP_DISPATCH_8_NS_ID_AVX512BW, \
1258 SIMDPP_DISPATCH_8_NS_ID_AVX512DQ, \
1259 SIMDPP_DISPATCH_8_NS_ID_AVX512VL, \
1260 SIMDPP_DISPATCH_8_NS_ID_FMA3, \
1261 SIMDPP_DISPATCH_8_NS_ID_FMA4, \
1262 SIMDPP_DISPATCH_8_NS_ID_XOP, \
1263 SIMDPP_DISPATCH_8_NS_ID_NEON, \
1264 SIMDPP_DISPATCH_8_NS_ID_NEON_FLT_SP, \
1265 SIMDPP_DISPATCH_8_NS_ID_MSA, \
1266 SIMDPP_DISPATCH_8_NS_ID_ALTIVEC, \
1267 SIMDPP_DISPATCH_8_NS_ID_VSX_206, \
1268 SIMDPP_DISPATCH_8_NS_ID_VSX_207)
1269
1270 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_8_NAMESPACE
1271 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
1272 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
1273 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
1274 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
1275
1276 #define SIMDPP_DISPATCH_8_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
1277 { /* the following will fail if the overload is not available */ \
1278 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_8_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
1279 ARRAY[8-1] = ::simdpp::SIMDPP_DISPATCH_8_NAMESPACE::detail::create_fn_version(fun_ptr);\
1280 }
1281
1282 #define SIMDPP_DISPATCH_8_FN_DECLARE(SIGNATURE) \
1283 namespace SIMDPP_DISPATCH_8_NAMESPACE { \
1284 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
1285 }
1286 #undef SIMDPP_ARCH_PP_LIST
1287#else
1288 #define SIMDPP_DISPATCH_8_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
1289 #define SIMDPP_DISPATCH_8_FN_DECLARE(SIGNATURE)
1290#endif
1291
1292#ifdef SIMDPP_DISPATCH_ARCH9
1293 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH9
1294 #include <simdpp/detail/preprocess_single_arch.h>
1295
1296 // Use the results of preprocess_single_arch.h to define
1297 // SIMDPP_DISPATCH_9_NAMESPACE
1298
1299 #if SIMDPP_ARCH_PP_NS_USE_NULL
1300 #define SIMDPP_DISPATCH_9_NS_ID_NULL SIMDPP_INSN_ID_NULL
1301 #else
1302 #define SIMDPP_DISPATCH_9_NS_ID_NULL
1303 #endif
1304 #if SIMDPP_ARCH_PP_NS_USE_SSE2
1305 #define SIMDPP_DISPATCH_9_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
1306 #else
1307 #define SIMDPP_DISPATCH_9_NS_ID_SSE2
1308 #endif
1309 #if SIMDPP_ARCH_PP_NS_USE_SSE3
1310 #define SIMDPP_DISPATCH_9_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
1311 #else
1312 #define SIMDPP_DISPATCH_9_NS_ID_SSE3
1313 #endif
1314 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
1315 #define SIMDPP_DISPATCH_9_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
1316 #else
1317 #define SIMDPP_DISPATCH_9_NS_ID_SSSE3
1318 #endif
1319 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
1320 #define SIMDPP_DISPATCH_9_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
1321 #else
1322 #define SIMDPP_DISPATCH_9_NS_ID_SSE4_1
1323 #endif
1324 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
1325 #define SIMDPP_DISPATCH_9_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
1326 #else
1327 #define SIMDPP_DISPATCH_9_NS_ID_POPCNT_INSN
1328 #endif
1329 #if SIMDPP_ARCH_PP_NS_USE_AVX
1330 #define SIMDPP_DISPATCH_9_NS_ID_AVX SIMDPP_INSN_ID_AVX
1331 #else
1332 #define SIMDPP_DISPATCH_9_NS_ID_AVX
1333 #endif
1334 #if SIMDPP_ARCH_PP_NS_USE_AVX2
1335 #define SIMDPP_DISPATCH_9_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
1336 #else
1337 #define SIMDPP_DISPATCH_9_NS_ID_AVX2
1338 #endif
1339 #if SIMDPP_ARCH_PP_NS_USE_FMA3
1340 #define SIMDPP_DISPATCH_9_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
1341 #else
1342 #define SIMDPP_DISPATCH_9_NS_ID_FMA3
1343 #endif
1344 #if SIMDPP_ARCH_PP_NS_USE_FMA4
1345 #define SIMDPP_DISPATCH_9_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
1346 #else
1347 #define SIMDPP_DISPATCH_9_NS_ID_FMA4
1348 #endif
1349 #if SIMDPP_ARCH_PP_NS_USE_XOP
1350 #define SIMDPP_DISPATCH_9_NS_ID_XOP SIMDPP_INSN_ID_XOP
1351 #else
1352 #define SIMDPP_DISPATCH_9_NS_ID_XOP
1353 #endif
1354 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
1355 #define SIMDPP_DISPATCH_9_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
1356 #else
1357 #define SIMDPP_DISPATCH_9_NS_ID_AVX512F
1358 #endif
1359 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
1360 #define SIMDPP_DISPATCH_9_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
1361 #else
1362 #define SIMDPP_DISPATCH_9_NS_ID_AVX512BW
1363 #endif
1364 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
1365 #define SIMDPP_DISPATCH_9_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
1366 #else
1367 #define SIMDPP_DISPATCH_9_NS_ID_AVX512DQ
1368 #endif
1369 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
1370 #define SIMDPP_DISPATCH_9_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
1371 #else
1372 #define SIMDPP_DISPATCH_9_NS_ID_AVX512VL
1373 #endif
1374 #if SIMDPP_ARCH_PP_NS_USE_NEON
1375 #define SIMDPP_DISPATCH_9_NS_ID_NEON SIMDPP_INSN_ID_NEON
1376 #else
1377 #define SIMDPP_DISPATCH_9_NS_ID_NEON
1378 #endif
1379 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
1380 #define SIMDPP_DISPATCH_9_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
1381 #else
1382 #define SIMDPP_DISPATCH_9_NS_ID_NEON_FLT_SP
1383 #endif
1384 #if SIMDPP_ARCH_PP_NS_USE_MSA
1385 #define SIMDPP_DISPATCH_9_NS_ID_MSA SIMDPP_INSN_ID_MSA
1386 #else
1387 #define SIMDPP_DISPATCH_9_NS_ID_MSA
1388 #endif
1389 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
1390 #define SIMDPP_DISPATCH_9_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
1391 #else
1392 #define SIMDPP_DISPATCH_9_NS_ID_ALTIVEC
1393 #endif
1394 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
1395 #define SIMDPP_DISPATCH_9_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
1396 #else
1397 #define SIMDPP_DISPATCH_9_NS_ID_VSX_206
1398 #endif
1399 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
1400 #define SIMDPP_DISPATCH_9_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
1401 #else
1402 #define SIMDPP_DISPATCH_9_NS_ID_VSX_207
1403 #endif
1404
1405 #define SIMDPP_DISPATCH_9_NAMESPACE SIMDPP_PP_PASTE22(arch, \
1406 SIMDPP_DISPATCH_9_NS_ID_NULL, \
1407 SIMDPP_DISPATCH_9_NS_ID_SSE2, \
1408 SIMDPP_DISPATCH_9_NS_ID_SSE3, \
1409 SIMDPP_DISPATCH_9_NS_ID_SSSE3, \
1410 SIMDPP_DISPATCH_9_NS_ID_SSE4_1, \
1411 SIMDPP_DISPATCH_9_NS_ID_POPCNT_INSN, \
1412 SIMDPP_DISPATCH_9_NS_ID_AVX, \
1413 SIMDPP_DISPATCH_9_NS_ID_AVX2, \
1414 SIMDPP_DISPATCH_9_NS_ID_AVX512F, \
1415 SIMDPP_DISPATCH_9_NS_ID_AVX512BW, \
1416 SIMDPP_DISPATCH_9_NS_ID_AVX512DQ, \
1417 SIMDPP_DISPATCH_9_NS_ID_AVX512VL, \
1418 SIMDPP_DISPATCH_9_NS_ID_FMA3, \
1419 SIMDPP_DISPATCH_9_NS_ID_FMA4, \
1420 SIMDPP_DISPATCH_9_NS_ID_XOP, \
1421 SIMDPP_DISPATCH_9_NS_ID_NEON, \
1422 SIMDPP_DISPATCH_9_NS_ID_NEON_FLT_SP, \
1423 SIMDPP_DISPATCH_9_NS_ID_MSA, \
1424 SIMDPP_DISPATCH_9_NS_ID_ALTIVEC, \
1425 SIMDPP_DISPATCH_9_NS_ID_VSX_206, \
1426 SIMDPP_DISPATCH_9_NS_ID_VSX_207)
1427
1428 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_9_NAMESPACE
1429 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
1430 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
1431 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
1432 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
1433
1434 #define SIMDPP_DISPATCH_9_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
1435 { /* the following will fail if the overload is not available */ \
1436 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_9_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
1437 ARRAY[9-1] = ::simdpp::SIMDPP_DISPATCH_9_NAMESPACE::detail::create_fn_version(fun_ptr);\
1438 }
1439
1440 #define SIMDPP_DISPATCH_9_FN_DECLARE(SIGNATURE) \
1441 namespace SIMDPP_DISPATCH_9_NAMESPACE { \
1442 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
1443 }
1444 #undef SIMDPP_ARCH_PP_LIST
1445#else
1446 #define SIMDPP_DISPATCH_9_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
1447 #define SIMDPP_DISPATCH_9_FN_DECLARE(SIGNATURE)
1448#endif
1449
1450#ifdef SIMDPP_DISPATCH_ARCH10
1451 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH10
1452 #include <simdpp/detail/preprocess_single_arch.h>
1453
1454 // Use the results of preprocess_single_arch.h to define
1455 // SIMDPP_DISPATCH_10_NAMESPACE
1456
1457 #if SIMDPP_ARCH_PP_NS_USE_NULL
1458 #define SIMDPP_DISPATCH_10_NS_ID_NULL SIMDPP_INSN_ID_NULL
1459 #else
1460 #define SIMDPP_DISPATCH_10_NS_ID_NULL
1461 #endif
1462 #if SIMDPP_ARCH_PP_NS_USE_SSE2
1463 #define SIMDPP_DISPATCH_10_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
1464 #else
1465 #define SIMDPP_DISPATCH_10_NS_ID_SSE2
1466 #endif
1467 #if SIMDPP_ARCH_PP_NS_USE_SSE3
1468 #define SIMDPP_DISPATCH_10_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
1469 #else
1470 #define SIMDPP_DISPATCH_10_NS_ID_SSE3
1471 #endif
1472 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
1473 #define SIMDPP_DISPATCH_10_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
1474 #else
1475 #define SIMDPP_DISPATCH_10_NS_ID_SSSE3
1476 #endif
1477 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
1478 #define SIMDPP_DISPATCH_10_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
1479 #else
1480 #define SIMDPP_DISPATCH_10_NS_ID_SSE4_1
1481 #endif
1482 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
1483 #define SIMDPP_DISPATCH_10_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
1484 #else
1485 #define SIMDPP_DISPATCH_10_NS_ID_POPCNT_INSN
1486 #endif
1487 #if SIMDPP_ARCH_PP_NS_USE_AVX
1488 #define SIMDPP_DISPATCH_10_NS_ID_AVX SIMDPP_INSN_ID_AVX
1489 #else
1490 #define SIMDPP_DISPATCH_10_NS_ID_AVX
1491 #endif
1492 #if SIMDPP_ARCH_PP_NS_USE_AVX2
1493 #define SIMDPP_DISPATCH_10_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
1494 #else
1495 #define SIMDPP_DISPATCH_10_NS_ID_AVX2
1496 #endif
1497 #if SIMDPP_ARCH_PP_NS_USE_FMA3
1498 #define SIMDPP_DISPATCH_10_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
1499 #else
1500 #define SIMDPP_DISPATCH_10_NS_ID_FMA3
1501 #endif
1502 #if SIMDPP_ARCH_PP_NS_USE_FMA4
1503 #define SIMDPP_DISPATCH_10_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
1504 #else
1505 #define SIMDPP_DISPATCH_10_NS_ID_FMA4
1506 #endif
1507 #if SIMDPP_ARCH_PP_NS_USE_XOP
1508 #define SIMDPP_DISPATCH_10_NS_ID_XOP SIMDPP_INSN_ID_XOP
1509 #else
1510 #define SIMDPP_DISPATCH_10_NS_ID_XOP
1511 #endif
1512 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
1513 #define SIMDPP_DISPATCH_10_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
1514 #else
1515 #define SIMDPP_DISPATCH_10_NS_ID_AVX512F
1516 #endif
1517 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
1518 #define SIMDPP_DISPATCH_10_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
1519 #else
1520 #define SIMDPP_DISPATCH_10_NS_ID_AVX512BW
1521 #endif
1522 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
1523 #define SIMDPP_DISPATCH_10_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
1524 #else
1525 #define SIMDPP_DISPATCH_10_NS_ID_AVX512DQ
1526 #endif
1527 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
1528 #define SIMDPP_DISPATCH_10_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
1529 #else
1530 #define SIMDPP_DISPATCH_10_NS_ID_AVX512VL
1531 #endif
1532 #if SIMDPP_ARCH_PP_NS_USE_NEON
1533 #define SIMDPP_DISPATCH_10_NS_ID_NEON SIMDPP_INSN_ID_NEON
1534 #else
1535 #define SIMDPP_DISPATCH_10_NS_ID_NEON
1536 #endif
1537 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
1538 #define SIMDPP_DISPATCH_10_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
1539 #else
1540 #define SIMDPP_DISPATCH_10_NS_ID_NEON_FLT_SP
1541 #endif
1542 #if SIMDPP_ARCH_PP_NS_USE_MSA
1543 #define SIMDPP_DISPATCH_10_NS_ID_MSA SIMDPP_INSN_ID_MSA
1544 #else
1545 #define SIMDPP_DISPATCH_10_NS_ID_MSA
1546 #endif
1547 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
1548 #define SIMDPP_DISPATCH_10_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
1549 #else
1550 #define SIMDPP_DISPATCH_10_NS_ID_ALTIVEC
1551 #endif
1552 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
1553 #define SIMDPP_DISPATCH_10_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
1554 #else
1555 #define SIMDPP_DISPATCH_10_NS_ID_VSX_206
1556 #endif
1557 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
1558 #define SIMDPP_DISPATCH_10_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
1559 #else
1560 #define SIMDPP_DISPATCH_10_NS_ID_VSX_207
1561 #endif
1562
1563 #define SIMDPP_DISPATCH_10_NAMESPACE SIMDPP_PP_PASTE22(arch, \
1564 SIMDPP_DISPATCH_10_NS_ID_NULL, \
1565 SIMDPP_DISPATCH_10_NS_ID_SSE2, \
1566 SIMDPP_DISPATCH_10_NS_ID_SSE3, \
1567 SIMDPP_DISPATCH_10_NS_ID_SSSE3, \
1568 SIMDPP_DISPATCH_10_NS_ID_SSE4_1, \
1569 SIMDPP_DISPATCH_10_NS_ID_POPCNT_INSN, \
1570 SIMDPP_DISPATCH_10_NS_ID_AVX, \
1571 SIMDPP_DISPATCH_10_NS_ID_AVX2, \
1572 SIMDPP_DISPATCH_10_NS_ID_AVX512F, \
1573 SIMDPP_DISPATCH_10_NS_ID_AVX512BW, \
1574 SIMDPP_DISPATCH_10_NS_ID_AVX512DQ, \
1575 SIMDPP_DISPATCH_10_NS_ID_AVX512VL, \
1576 SIMDPP_DISPATCH_10_NS_ID_FMA3, \
1577 SIMDPP_DISPATCH_10_NS_ID_FMA4, \
1578 SIMDPP_DISPATCH_10_NS_ID_XOP, \
1579 SIMDPP_DISPATCH_10_NS_ID_NEON, \
1580 SIMDPP_DISPATCH_10_NS_ID_NEON_FLT_SP, \
1581 SIMDPP_DISPATCH_10_NS_ID_MSA, \
1582 SIMDPP_DISPATCH_10_NS_ID_ALTIVEC, \
1583 SIMDPP_DISPATCH_10_NS_ID_VSX_206, \
1584 SIMDPP_DISPATCH_10_NS_ID_VSX_207)
1585
1586 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_10_NAMESPACE
1587 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
1588 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
1589 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
1590 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
1591
1592 #define SIMDPP_DISPATCH_10_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
1593 { /* the following will fail if the overload is not available */ \
1594 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_10_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
1595 ARRAY[10-1] = ::simdpp::SIMDPP_DISPATCH_10_NAMESPACE::detail::create_fn_version(fun_ptr);\
1596 }
1597
1598 #define SIMDPP_DISPATCH_10_FN_DECLARE(SIGNATURE) \
1599 namespace SIMDPP_DISPATCH_10_NAMESPACE { \
1600 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
1601 }
1602 #undef SIMDPP_ARCH_PP_LIST
1603#else
1604 #define SIMDPP_DISPATCH_10_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
1605 #define SIMDPP_DISPATCH_10_FN_DECLARE(SIGNATURE)
1606#endif
1607
1608#ifdef SIMDPP_DISPATCH_ARCH11
1609 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH11
1610 #include <simdpp/detail/preprocess_single_arch.h>
1611
1612 // Use the results of preprocess_single_arch.h to define
1613 // SIMDPP_DISPATCH_11_NAMESPACE
1614
1615 #if SIMDPP_ARCH_PP_NS_USE_NULL
1616 #define SIMDPP_DISPATCH_11_NS_ID_NULL SIMDPP_INSN_ID_NULL
1617 #else
1618 #define SIMDPP_DISPATCH_11_NS_ID_NULL
1619 #endif
1620 #if SIMDPP_ARCH_PP_NS_USE_SSE2
1621 #define SIMDPP_DISPATCH_11_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
1622 #else
1623 #define SIMDPP_DISPATCH_11_NS_ID_SSE2
1624 #endif
1625 #if SIMDPP_ARCH_PP_NS_USE_SSE3
1626 #define SIMDPP_DISPATCH_11_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
1627 #else
1628 #define SIMDPP_DISPATCH_11_NS_ID_SSE3
1629 #endif
1630 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
1631 #define SIMDPP_DISPATCH_11_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
1632 #else
1633 #define SIMDPP_DISPATCH_11_NS_ID_SSSE3
1634 #endif
1635 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
1636 #define SIMDPP_DISPATCH_11_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
1637 #else
1638 #define SIMDPP_DISPATCH_11_NS_ID_SSE4_1
1639 #endif
1640 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
1641 #define SIMDPP_DISPATCH_11_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
1642 #else
1643 #define SIMDPP_DISPATCH_11_NS_ID_POPCNT_INSN
1644 #endif
1645 #if SIMDPP_ARCH_PP_NS_USE_AVX
1646 #define SIMDPP_DISPATCH_11_NS_ID_AVX SIMDPP_INSN_ID_AVX
1647 #else
1648 #define SIMDPP_DISPATCH_11_NS_ID_AVX
1649 #endif
1650 #if SIMDPP_ARCH_PP_NS_USE_AVX2
1651 #define SIMDPP_DISPATCH_11_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
1652 #else
1653 #define SIMDPP_DISPATCH_11_NS_ID_AVX2
1654 #endif
1655 #if SIMDPP_ARCH_PP_NS_USE_FMA3
1656 #define SIMDPP_DISPATCH_11_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
1657 #else
1658 #define SIMDPP_DISPATCH_11_NS_ID_FMA3
1659 #endif
1660 #if SIMDPP_ARCH_PP_NS_USE_FMA4
1661 #define SIMDPP_DISPATCH_11_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
1662 #else
1663 #define SIMDPP_DISPATCH_11_NS_ID_FMA4
1664 #endif
1665 #if SIMDPP_ARCH_PP_NS_USE_XOP
1666 #define SIMDPP_DISPATCH_11_NS_ID_XOP SIMDPP_INSN_ID_XOP
1667 #else
1668 #define SIMDPP_DISPATCH_11_NS_ID_XOP
1669 #endif
1670 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
1671 #define SIMDPP_DISPATCH_11_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
1672 #else
1673 #define SIMDPP_DISPATCH_11_NS_ID_AVX512F
1674 #endif
1675 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
1676 #define SIMDPP_DISPATCH_11_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
1677 #else
1678 #define SIMDPP_DISPATCH_11_NS_ID_AVX512BW
1679 #endif
1680 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
1681 #define SIMDPP_DISPATCH_11_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
1682 #else
1683 #define SIMDPP_DISPATCH_11_NS_ID_AVX512DQ
1684 #endif
1685 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
1686 #define SIMDPP_DISPATCH_11_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
1687 #else
1688 #define SIMDPP_DISPATCH_11_NS_ID_AVX512VL
1689 #endif
1690 #if SIMDPP_ARCH_PP_NS_USE_NEON
1691 #define SIMDPP_DISPATCH_11_NS_ID_NEON SIMDPP_INSN_ID_NEON
1692 #else
1693 #define SIMDPP_DISPATCH_11_NS_ID_NEON
1694 #endif
1695 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
1696 #define SIMDPP_DISPATCH_11_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
1697 #else
1698 #define SIMDPP_DISPATCH_11_NS_ID_NEON_FLT_SP
1699 #endif
1700 #if SIMDPP_ARCH_PP_NS_USE_MSA
1701 #define SIMDPP_DISPATCH_11_NS_ID_MSA SIMDPP_INSN_ID_MSA
1702 #else
1703 #define SIMDPP_DISPATCH_11_NS_ID_MSA
1704 #endif
1705 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
1706 #define SIMDPP_DISPATCH_11_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
1707 #else
1708 #define SIMDPP_DISPATCH_11_NS_ID_ALTIVEC
1709 #endif
1710 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
1711 #define SIMDPP_DISPATCH_11_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
1712 #else
1713 #define SIMDPP_DISPATCH_11_NS_ID_VSX_206
1714 #endif
1715 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
1716 #define SIMDPP_DISPATCH_11_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
1717 #else
1718 #define SIMDPP_DISPATCH_11_NS_ID_VSX_207
1719 #endif
1720
1721 #define SIMDPP_DISPATCH_11_NAMESPACE SIMDPP_PP_PASTE22(arch, \
1722 SIMDPP_DISPATCH_11_NS_ID_NULL, \
1723 SIMDPP_DISPATCH_11_NS_ID_SSE2, \
1724 SIMDPP_DISPATCH_11_NS_ID_SSE3, \
1725 SIMDPP_DISPATCH_11_NS_ID_SSSE3, \
1726 SIMDPP_DISPATCH_11_NS_ID_SSE4_1, \
1727 SIMDPP_DISPATCH_11_NS_ID_POPCNT_INSN, \
1728 SIMDPP_DISPATCH_11_NS_ID_AVX, \
1729 SIMDPP_DISPATCH_11_NS_ID_AVX2, \
1730 SIMDPP_DISPATCH_11_NS_ID_AVX512F, \
1731 SIMDPP_DISPATCH_11_NS_ID_AVX512BW, \
1732 SIMDPP_DISPATCH_11_NS_ID_AVX512DQ, \
1733 SIMDPP_DISPATCH_11_NS_ID_AVX512VL, \
1734 SIMDPP_DISPATCH_11_NS_ID_FMA3, \
1735 SIMDPP_DISPATCH_11_NS_ID_FMA4, \
1736 SIMDPP_DISPATCH_11_NS_ID_XOP, \
1737 SIMDPP_DISPATCH_11_NS_ID_NEON, \
1738 SIMDPP_DISPATCH_11_NS_ID_NEON_FLT_SP, \
1739 SIMDPP_DISPATCH_11_NS_ID_MSA, \
1740 SIMDPP_DISPATCH_11_NS_ID_ALTIVEC, \
1741 SIMDPP_DISPATCH_11_NS_ID_VSX_206, \
1742 SIMDPP_DISPATCH_11_NS_ID_VSX_207)
1743
1744 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_11_NAMESPACE
1745 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
1746 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
1747 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
1748 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
1749
1750 #define SIMDPP_DISPATCH_11_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
1751 { /* the following will fail if the overload is not available */ \
1752 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_11_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
1753 ARRAY[11-1] = ::simdpp::SIMDPP_DISPATCH_11_NAMESPACE::detail::create_fn_version(fun_ptr);\
1754 }
1755
1756 #define SIMDPP_DISPATCH_11_FN_DECLARE(SIGNATURE) \
1757 namespace SIMDPP_DISPATCH_11_NAMESPACE { \
1758 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
1759 }
1760 #undef SIMDPP_ARCH_PP_LIST
1761#else
1762 #define SIMDPP_DISPATCH_11_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
1763 #define SIMDPP_DISPATCH_11_FN_DECLARE(SIGNATURE)
1764#endif
1765
1766#ifdef SIMDPP_DISPATCH_ARCH12
1767 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH12
1768 #include <simdpp/detail/preprocess_single_arch.h>
1769
1770 // Use the results of preprocess_single_arch.h to define
1771 // SIMDPP_DISPATCH_12_NAMESPACE
1772
1773 #if SIMDPP_ARCH_PP_NS_USE_NULL
1774 #define SIMDPP_DISPATCH_12_NS_ID_NULL SIMDPP_INSN_ID_NULL
1775 #else
1776 #define SIMDPP_DISPATCH_12_NS_ID_NULL
1777 #endif
1778 #if SIMDPP_ARCH_PP_NS_USE_SSE2
1779 #define SIMDPP_DISPATCH_12_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
1780 #else
1781 #define SIMDPP_DISPATCH_12_NS_ID_SSE2
1782 #endif
1783 #if SIMDPP_ARCH_PP_NS_USE_SSE3
1784 #define SIMDPP_DISPATCH_12_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
1785 #else
1786 #define SIMDPP_DISPATCH_12_NS_ID_SSE3
1787 #endif
1788 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
1789 #define SIMDPP_DISPATCH_12_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
1790 #else
1791 #define SIMDPP_DISPATCH_12_NS_ID_SSSE3
1792 #endif
1793 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
1794 #define SIMDPP_DISPATCH_12_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
1795 #else
1796 #define SIMDPP_DISPATCH_12_NS_ID_SSE4_1
1797 #endif
1798 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
1799 #define SIMDPP_DISPATCH_12_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
1800 #else
1801 #define SIMDPP_DISPATCH_12_NS_ID_POPCNT_INSN
1802 #endif
1803 #if SIMDPP_ARCH_PP_NS_USE_AVX
1804 #define SIMDPP_DISPATCH_12_NS_ID_AVX SIMDPP_INSN_ID_AVX
1805 #else
1806 #define SIMDPP_DISPATCH_12_NS_ID_AVX
1807 #endif
1808 #if SIMDPP_ARCH_PP_NS_USE_AVX2
1809 #define SIMDPP_DISPATCH_12_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
1810 #else
1811 #define SIMDPP_DISPATCH_12_NS_ID_AVX2
1812 #endif
1813 #if SIMDPP_ARCH_PP_NS_USE_FMA3
1814 #define SIMDPP_DISPATCH_12_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
1815 #else
1816 #define SIMDPP_DISPATCH_12_NS_ID_FMA3
1817 #endif
1818 #if SIMDPP_ARCH_PP_NS_USE_FMA4
1819 #define SIMDPP_DISPATCH_12_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
1820 #else
1821 #define SIMDPP_DISPATCH_12_NS_ID_FMA4
1822 #endif
1823 #if SIMDPP_ARCH_PP_NS_USE_XOP
1824 #define SIMDPP_DISPATCH_12_NS_ID_XOP SIMDPP_INSN_ID_XOP
1825 #else
1826 #define SIMDPP_DISPATCH_12_NS_ID_XOP
1827 #endif
1828 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
1829 #define SIMDPP_DISPATCH_12_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
1830 #else
1831 #define SIMDPP_DISPATCH_12_NS_ID_AVX512F
1832 #endif
1833 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
1834 #define SIMDPP_DISPATCH_12_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
1835 #else
1836 #define SIMDPP_DISPATCH_12_NS_ID_AVX512BW
1837 #endif
1838 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
1839 #define SIMDPP_DISPATCH_12_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
1840 #else
1841 #define SIMDPP_DISPATCH_12_NS_ID_AVX512DQ
1842 #endif
1843 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
1844 #define SIMDPP_DISPATCH_12_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
1845 #else
1846 #define SIMDPP_DISPATCH_12_NS_ID_AVX512VL
1847 #endif
1848 #if SIMDPP_ARCH_PP_NS_USE_NEON
1849 #define SIMDPP_DISPATCH_12_NS_ID_NEON SIMDPP_INSN_ID_NEON
1850 #else
1851 #define SIMDPP_DISPATCH_12_NS_ID_NEON
1852 #endif
1853 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
1854 #define SIMDPP_DISPATCH_12_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
1855 #else
1856 #define SIMDPP_DISPATCH_12_NS_ID_NEON_FLT_SP
1857 #endif
1858 #if SIMDPP_ARCH_PP_NS_USE_MSA
1859 #define SIMDPP_DISPATCH_12_NS_ID_MSA SIMDPP_INSN_ID_MSA
1860 #else
1861 #define SIMDPP_DISPATCH_12_NS_ID_MSA
1862 #endif
1863 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
1864 #define SIMDPP_DISPATCH_12_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
1865 #else
1866 #define SIMDPP_DISPATCH_12_NS_ID_ALTIVEC
1867 #endif
1868 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
1869 #define SIMDPP_DISPATCH_12_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
1870 #else
1871 #define SIMDPP_DISPATCH_12_NS_ID_VSX_206
1872 #endif
1873 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
1874 #define SIMDPP_DISPATCH_12_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
1875 #else
1876 #define SIMDPP_DISPATCH_12_NS_ID_VSX_207
1877 #endif
1878
1879 #define SIMDPP_DISPATCH_12_NAMESPACE SIMDPP_PP_PASTE22(arch, \
1880 SIMDPP_DISPATCH_12_NS_ID_NULL, \
1881 SIMDPP_DISPATCH_12_NS_ID_SSE2, \
1882 SIMDPP_DISPATCH_12_NS_ID_SSE3, \
1883 SIMDPP_DISPATCH_12_NS_ID_SSSE3, \
1884 SIMDPP_DISPATCH_12_NS_ID_SSE4_1, \
1885 SIMDPP_DISPATCH_12_NS_ID_POPCNT_INSN, \
1886 SIMDPP_DISPATCH_12_NS_ID_AVX, \
1887 SIMDPP_DISPATCH_12_NS_ID_AVX2, \
1888 SIMDPP_DISPATCH_12_NS_ID_AVX512F, \
1889 SIMDPP_DISPATCH_12_NS_ID_AVX512BW, \
1890 SIMDPP_DISPATCH_12_NS_ID_AVX512DQ, \
1891 SIMDPP_DISPATCH_12_NS_ID_AVX512VL, \
1892 SIMDPP_DISPATCH_12_NS_ID_FMA3, \
1893 SIMDPP_DISPATCH_12_NS_ID_FMA4, \
1894 SIMDPP_DISPATCH_12_NS_ID_XOP, \
1895 SIMDPP_DISPATCH_12_NS_ID_NEON, \
1896 SIMDPP_DISPATCH_12_NS_ID_NEON_FLT_SP, \
1897 SIMDPP_DISPATCH_12_NS_ID_MSA, \
1898 SIMDPP_DISPATCH_12_NS_ID_ALTIVEC, \
1899 SIMDPP_DISPATCH_12_NS_ID_VSX_206, \
1900 SIMDPP_DISPATCH_12_NS_ID_VSX_207)
1901
1902 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_12_NAMESPACE
1903 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
1904 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
1905 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
1906 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
1907
1908 #define SIMDPP_DISPATCH_12_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
1909 { /* the following will fail if the overload is not available */ \
1910 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_12_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
1911 ARRAY[12-1] = ::simdpp::SIMDPP_DISPATCH_12_NAMESPACE::detail::create_fn_version(fun_ptr);\
1912 }
1913
1914 #define SIMDPP_DISPATCH_12_FN_DECLARE(SIGNATURE) \
1915 namespace SIMDPP_DISPATCH_12_NAMESPACE { \
1916 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
1917 }
1918 #undef SIMDPP_ARCH_PP_LIST
1919#else
1920 #define SIMDPP_DISPATCH_12_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
1921 #define SIMDPP_DISPATCH_12_FN_DECLARE(SIGNATURE)
1922#endif
1923
1924#ifdef SIMDPP_DISPATCH_ARCH13
1925 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH13
1926 #include <simdpp/detail/preprocess_single_arch.h>
1927
1928 // Use the results of preprocess_single_arch.h to define
1929 // SIMDPP_DISPATCH_13_NAMESPACE
1930
1931 #if SIMDPP_ARCH_PP_NS_USE_NULL
1932 #define SIMDPP_DISPATCH_13_NS_ID_NULL SIMDPP_INSN_ID_NULL
1933 #else
1934 #define SIMDPP_DISPATCH_13_NS_ID_NULL
1935 #endif
1936 #if SIMDPP_ARCH_PP_NS_USE_SSE2
1937 #define SIMDPP_DISPATCH_13_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
1938 #else
1939 #define SIMDPP_DISPATCH_13_NS_ID_SSE2
1940 #endif
1941 #if SIMDPP_ARCH_PP_NS_USE_SSE3
1942 #define SIMDPP_DISPATCH_13_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
1943 #else
1944 #define SIMDPP_DISPATCH_13_NS_ID_SSE3
1945 #endif
1946 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
1947 #define SIMDPP_DISPATCH_13_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
1948 #else
1949 #define SIMDPP_DISPATCH_13_NS_ID_SSSE3
1950 #endif
1951 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
1952 #define SIMDPP_DISPATCH_13_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
1953 #else
1954 #define SIMDPP_DISPATCH_13_NS_ID_SSE4_1
1955 #endif
1956 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
1957 #define SIMDPP_DISPATCH_13_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
1958 #else
1959 #define SIMDPP_DISPATCH_13_NS_ID_POPCNT_INSN
1960 #endif
1961 #if SIMDPP_ARCH_PP_NS_USE_AVX
1962 #define SIMDPP_DISPATCH_13_NS_ID_AVX SIMDPP_INSN_ID_AVX
1963 #else
1964 #define SIMDPP_DISPATCH_13_NS_ID_AVX
1965 #endif
1966 #if SIMDPP_ARCH_PP_NS_USE_AVX2
1967 #define SIMDPP_DISPATCH_13_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
1968 #else
1969 #define SIMDPP_DISPATCH_13_NS_ID_AVX2
1970 #endif
1971 #if SIMDPP_ARCH_PP_NS_USE_FMA3
1972 #define SIMDPP_DISPATCH_13_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
1973 #else
1974 #define SIMDPP_DISPATCH_13_NS_ID_FMA3
1975 #endif
1976 #if SIMDPP_ARCH_PP_NS_USE_FMA4
1977 #define SIMDPP_DISPATCH_13_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
1978 #else
1979 #define SIMDPP_DISPATCH_13_NS_ID_FMA4
1980 #endif
1981 #if SIMDPP_ARCH_PP_NS_USE_XOP
1982 #define SIMDPP_DISPATCH_13_NS_ID_XOP SIMDPP_INSN_ID_XOP
1983 #else
1984 #define SIMDPP_DISPATCH_13_NS_ID_XOP
1985 #endif
1986 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
1987 #define SIMDPP_DISPATCH_13_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
1988 #else
1989 #define SIMDPP_DISPATCH_13_NS_ID_AVX512F
1990 #endif
1991 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
1992 #define SIMDPP_DISPATCH_13_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
1993 #else
1994 #define SIMDPP_DISPATCH_13_NS_ID_AVX512BW
1995 #endif
1996 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
1997 #define SIMDPP_DISPATCH_13_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
1998 #else
1999 #define SIMDPP_DISPATCH_13_NS_ID_AVX512DQ
2000 #endif
2001 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
2002 #define SIMDPP_DISPATCH_13_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
2003 #else
2004 #define SIMDPP_DISPATCH_13_NS_ID_AVX512VL
2005 #endif
2006 #if SIMDPP_ARCH_PP_NS_USE_NEON
2007 #define SIMDPP_DISPATCH_13_NS_ID_NEON SIMDPP_INSN_ID_NEON
2008 #else
2009 #define SIMDPP_DISPATCH_13_NS_ID_NEON
2010 #endif
2011 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
2012 #define SIMDPP_DISPATCH_13_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
2013 #else
2014 #define SIMDPP_DISPATCH_13_NS_ID_NEON_FLT_SP
2015 #endif
2016 #if SIMDPP_ARCH_PP_NS_USE_MSA
2017 #define SIMDPP_DISPATCH_13_NS_ID_MSA SIMDPP_INSN_ID_MSA
2018 #else
2019 #define SIMDPP_DISPATCH_13_NS_ID_MSA
2020 #endif
2021 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
2022 #define SIMDPP_DISPATCH_13_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
2023 #else
2024 #define SIMDPP_DISPATCH_13_NS_ID_ALTIVEC
2025 #endif
2026 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
2027 #define SIMDPP_DISPATCH_13_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
2028 #else
2029 #define SIMDPP_DISPATCH_13_NS_ID_VSX_206
2030 #endif
2031 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
2032 #define SIMDPP_DISPATCH_13_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
2033 #else
2034 #define SIMDPP_DISPATCH_13_NS_ID_VSX_207
2035 #endif
2036
2037 #define SIMDPP_DISPATCH_13_NAMESPACE SIMDPP_PP_PASTE22(arch, \
2038 SIMDPP_DISPATCH_13_NS_ID_NULL, \
2039 SIMDPP_DISPATCH_13_NS_ID_SSE2, \
2040 SIMDPP_DISPATCH_13_NS_ID_SSE3, \
2041 SIMDPP_DISPATCH_13_NS_ID_SSSE3, \
2042 SIMDPP_DISPATCH_13_NS_ID_SSE4_1, \
2043 SIMDPP_DISPATCH_13_NS_ID_POPCNT_INSN, \
2044 SIMDPP_DISPATCH_13_NS_ID_AVX, \
2045 SIMDPP_DISPATCH_13_NS_ID_AVX2, \
2046 SIMDPP_DISPATCH_13_NS_ID_AVX512F, \
2047 SIMDPP_DISPATCH_13_NS_ID_AVX512BW, \
2048 SIMDPP_DISPATCH_13_NS_ID_AVX512DQ, \
2049 SIMDPP_DISPATCH_13_NS_ID_AVX512VL, \
2050 SIMDPP_DISPATCH_13_NS_ID_FMA3, \
2051 SIMDPP_DISPATCH_13_NS_ID_FMA4, \
2052 SIMDPP_DISPATCH_13_NS_ID_XOP, \
2053 SIMDPP_DISPATCH_13_NS_ID_NEON, \
2054 SIMDPP_DISPATCH_13_NS_ID_NEON_FLT_SP, \
2055 SIMDPP_DISPATCH_13_NS_ID_MSA, \
2056 SIMDPP_DISPATCH_13_NS_ID_ALTIVEC, \
2057 SIMDPP_DISPATCH_13_NS_ID_VSX_206, \
2058 SIMDPP_DISPATCH_13_NS_ID_VSX_207)
2059
2060 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_13_NAMESPACE
2061 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
2062 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
2063 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
2064 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
2065
2066 #define SIMDPP_DISPATCH_13_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2067 { /* the following will fail if the overload is not available */ \
2068 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_13_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
2069 ARRAY[13-1] = ::simdpp::SIMDPP_DISPATCH_13_NAMESPACE::detail::create_fn_version(fun_ptr);\
2070 }
2071
2072 #define SIMDPP_DISPATCH_13_FN_DECLARE(SIGNATURE) \
2073 namespace SIMDPP_DISPATCH_13_NAMESPACE { \
2074 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
2075 }
2076 #undef SIMDPP_ARCH_PP_LIST
2077#else
2078 #define SIMDPP_DISPATCH_13_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
2079 #define SIMDPP_DISPATCH_13_FN_DECLARE(SIGNATURE)
2080#endif
2081
2082#ifdef SIMDPP_DISPATCH_ARCH14
2083 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH14
2084 #include <simdpp/detail/preprocess_single_arch.h>
2085
2086 // Use the results of preprocess_single_arch.h to define
2087 // SIMDPP_DISPATCH_14_NAMESPACE
2088
2089 #if SIMDPP_ARCH_PP_NS_USE_NULL
2090 #define SIMDPP_DISPATCH_14_NS_ID_NULL SIMDPP_INSN_ID_NULL
2091 #else
2092 #define SIMDPP_DISPATCH_14_NS_ID_NULL
2093 #endif
2094 #if SIMDPP_ARCH_PP_NS_USE_SSE2
2095 #define SIMDPP_DISPATCH_14_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
2096 #else
2097 #define SIMDPP_DISPATCH_14_NS_ID_SSE2
2098 #endif
2099 #if SIMDPP_ARCH_PP_NS_USE_SSE3
2100 #define SIMDPP_DISPATCH_14_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
2101 #else
2102 #define SIMDPP_DISPATCH_14_NS_ID_SSE3
2103 #endif
2104 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
2105 #define SIMDPP_DISPATCH_14_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
2106 #else
2107 #define SIMDPP_DISPATCH_14_NS_ID_SSSE3
2108 #endif
2109 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
2110 #define SIMDPP_DISPATCH_14_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
2111 #else
2112 #define SIMDPP_DISPATCH_14_NS_ID_SSE4_1
2113 #endif
2114 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
2115 #define SIMDPP_DISPATCH_14_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
2116 #else
2117 #define SIMDPP_DISPATCH_14_NS_ID_POPCNT_INSN
2118 #endif
2119 #if SIMDPP_ARCH_PP_NS_USE_AVX
2120 #define SIMDPP_DISPATCH_14_NS_ID_AVX SIMDPP_INSN_ID_AVX
2121 #else
2122 #define SIMDPP_DISPATCH_14_NS_ID_AVX
2123 #endif
2124 #if SIMDPP_ARCH_PP_NS_USE_AVX2
2125 #define SIMDPP_DISPATCH_14_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
2126 #else
2127 #define SIMDPP_DISPATCH_14_NS_ID_AVX2
2128 #endif
2129 #if SIMDPP_ARCH_PP_NS_USE_FMA3
2130 #define SIMDPP_DISPATCH_14_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
2131 #else
2132 #define SIMDPP_DISPATCH_14_NS_ID_FMA3
2133 #endif
2134 #if SIMDPP_ARCH_PP_NS_USE_FMA4
2135 #define SIMDPP_DISPATCH_14_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
2136 #else
2137 #define SIMDPP_DISPATCH_14_NS_ID_FMA4
2138 #endif
2139 #if SIMDPP_ARCH_PP_NS_USE_XOP
2140 #define SIMDPP_DISPATCH_14_NS_ID_XOP SIMDPP_INSN_ID_XOP
2141 #else
2142 #define SIMDPP_DISPATCH_14_NS_ID_XOP
2143 #endif
2144 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
2145 #define SIMDPP_DISPATCH_14_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
2146 #else
2147 #define SIMDPP_DISPATCH_14_NS_ID_AVX512F
2148 #endif
2149 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
2150 #define SIMDPP_DISPATCH_14_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
2151 #else
2152 #define SIMDPP_DISPATCH_14_NS_ID_AVX512BW
2153 #endif
2154 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
2155 #define SIMDPP_DISPATCH_14_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
2156 #else
2157 #define SIMDPP_DISPATCH_14_NS_ID_AVX512DQ
2158 #endif
2159 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
2160 #define SIMDPP_DISPATCH_14_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
2161 #else
2162 #define SIMDPP_DISPATCH_14_NS_ID_AVX512VL
2163 #endif
2164 #if SIMDPP_ARCH_PP_NS_USE_NEON
2165 #define SIMDPP_DISPATCH_14_NS_ID_NEON SIMDPP_INSN_ID_NEON
2166 #else
2167 #define SIMDPP_DISPATCH_14_NS_ID_NEON
2168 #endif
2169 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
2170 #define SIMDPP_DISPATCH_14_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
2171 #else
2172 #define SIMDPP_DISPATCH_14_NS_ID_NEON_FLT_SP
2173 #endif
2174 #if SIMDPP_ARCH_PP_NS_USE_MSA
2175 #define SIMDPP_DISPATCH_14_NS_ID_MSA SIMDPP_INSN_ID_MSA
2176 #else
2177 #define SIMDPP_DISPATCH_14_NS_ID_MSA
2178 #endif
2179 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
2180 #define SIMDPP_DISPATCH_14_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
2181 #else
2182 #define SIMDPP_DISPATCH_14_NS_ID_ALTIVEC
2183 #endif
2184 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
2185 #define SIMDPP_DISPATCH_14_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
2186 #else
2187 #define SIMDPP_DISPATCH_14_NS_ID_VSX_206
2188 #endif
2189 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
2190 #define SIMDPP_DISPATCH_14_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
2191 #else
2192 #define SIMDPP_DISPATCH_14_NS_ID_VSX_207
2193 #endif
2194
2195 #define SIMDPP_DISPATCH_14_NAMESPACE SIMDPP_PP_PASTE22(arch, \
2196 SIMDPP_DISPATCH_14_NS_ID_NULL, \
2197 SIMDPP_DISPATCH_14_NS_ID_SSE2, \
2198 SIMDPP_DISPATCH_14_NS_ID_SSE3, \
2199 SIMDPP_DISPATCH_14_NS_ID_SSSE3, \
2200 SIMDPP_DISPATCH_14_NS_ID_SSE4_1, \
2201 SIMDPP_DISPATCH_14_NS_ID_POPCNT_INSN, \
2202 SIMDPP_DISPATCH_14_NS_ID_AVX, \
2203 SIMDPP_DISPATCH_14_NS_ID_AVX2, \
2204 SIMDPP_DISPATCH_14_NS_ID_AVX512F, \
2205 SIMDPP_DISPATCH_14_NS_ID_AVX512BW, \
2206 SIMDPP_DISPATCH_14_NS_ID_AVX512DQ, \
2207 SIMDPP_DISPATCH_14_NS_ID_AVX512VL, \
2208 SIMDPP_DISPATCH_14_NS_ID_FMA3, \
2209 SIMDPP_DISPATCH_14_NS_ID_FMA4, \
2210 SIMDPP_DISPATCH_14_NS_ID_XOP, \
2211 SIMDPP_DISPATCH_14_NS_ID_NEON, \
2212 SIMDPP_DISPATCH_14_NS_ID_NEON_FLT_SP, \
2213 SIMDPP_DISPATCH_14_NS_ID_MSA, \
2214 SIMDPP_DISPATCH_14_NS_ID_ALTIVEC, \
2215 SIMDPP_DISPATCH_14_NS_ID_VSX_206, \
2216 SIMDPP_DISPATCH_14_NS_ID_VSX_207)
2217
2218 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_14_NAMESPACE
2219 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
2220 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
2221 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
2222 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
2223
2224 #define SIMDPP_DISPATCH_14_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2225 { /* the following will fail if the overload is not available */ \
2226 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_14_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
2227 ARRAY[14-1] = ::simdpp::SIMDPP_DISPATCH_14_NAMESPACE::detail::create_fn_version(fun_ptr);\
2228 }
2229
2230 #define SIMDPP_DISPATCH_14_FN_DECLARE(SIGNATURE) \
2231 namespace SIMDPP_DISPATCH_14_NAMESPACE { \
2232 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
2233 }
2234 #undef SIMDPP_ARCH_PP_LIST
2235#else
2236 #define SIMDPP_DISPATCH_14_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
2237 #define SIMDPP_DISPATCH_14_FN_DECLARE(SIGNATURE)
2238#endif
2239
2240#ifdef SIMDPP_DISPATCH_ARCH15
2241 #define SIMDPP_ARCH_PP_LIST SIMDPP_DISPATCH_ARCH15
2242 #include <simdpp/detail/preprocess_single_arch.h>
2243
2244 // Use the results of preprocess_single_arch.h to define
2245 // SIMDPP_DISPATCH_15_NAMESPACE
2246
2247 #if SIMDPP_ARCH_PP_NS_USE_NULL
2248 #define SIMDPP_DISPATCH_15_NS_ID_NULL SIMDPP_INSN_ID_NULL
2249 #else
2250 #define SIMDPP_DISPATCH_15_NS_ID_NULL
2251 #endif
2252 #if SIMDPP_ARCH_PP_NS_USE_SSE2
2253 #define SIMDPP_DISPATCH_15_NS_ID_SSE2 SIMDPP_INSN_ID_SSE2
2254 #else
2255 #define SIMDPP_DISPATCH_15_NS_ID_SSE2
2256 #endif
2257 #if SIMDPP_ARCH_PP_NS_USE_SSE3
2258 #define SIMDPP_DISPATCH_15_NS_ID_SSE3 SIMDPP_INSN_ID_SSE3
2259 #else
2260 #define SIMDPP_DISPATCH_15_NS_ID_SSE3
2261 #endif
2262 #if SIMDPP_ARCH_PP_NS_USE_SSSE3
2263 #define SIMDPP_DISPATCH_15_NS_ID_SSSE3 SIMDPP_INSN_ID_SSSE3
2264 #else
2265 #define SIMDPP_DISPATCH_15_NS_ID_SSSE3
2266 #endif
2267 #if SIMDPP_ARCH_PP_NS_USE_SSE4_1
2268 #define SIMDPP_DISPATCH_15_NS_ID_SSE4_1 SIMDPP_INSN_ID_SSE4_1
2269 #else
2270 #define SIMDPP_DISPATCH_15_NS_ID_SSE4_1
2271 #endif
2272 #if SIMDPP_ARCH_PP_NS_USE_POPCNT_INSN
2273 #define SIMDPP_DISPATCH_15_NS_ID_POPCNT_INSN SIMDPP_INSN_ID_POPCNT_INSN
2274 #else
2275 #define SIMDPP_DISPATCH_15_NS_ID_POPCNT_INSN
2276 #endif
2277 #if SIMDPP_ARCH_PP_NS_USE_AVX
2278 #define SIMDPP_DISPATCH_15_NS_ID_AVX SIMDPP_INSN_ID_AVX
2279 #else
2280 #define SIMDPP_DISPATCH_15_NS_ID_AVX
2281 #endif
2282 #if SIMDPP_ARCH_PP_NS_USE_AVX2
2283 #define SIMDPP_DISPATCH_15_NS_ID_AVX2 SIMDPP_INSN_ID_AVX2
2284 #else
2285 #define SIMDPP_DISPATCH_15_NS_ID_AVX2
2286 #endif
2287 #if SIMDPP_ARCH_PP_NS_USE_FMA3
2288 #define SIMDPP_DISPATCH_15_NS_ID_FMA3 SIMDPP_INSN_ID_FMA3
2289 #else
2290 #define SIMDPP_DISPATCH_15_NS_ID_FMA3
2291 #endif
2292 #if SIMDPP_ARCH_PP_NS_USE_FMA4
2293 #define SIMDPP_DISPATCH_15_NS_ID_FMA4 SIMDPP_INSN_ID_FMA4
2294 #else
2295 #define SIMDPP_DISPATCH_15_NS_ID_FMA4
2296 #endif
2297 #if SIMDPP_ARCH_PP_NS_USE_XOP
2298 #define SIMDPP_DISPATCH_15_NS_ID_XOP SIMDPP_INSN_ID_XOP
2299 #else
2300 #define SIMDPP_DISPATCH_15_NS_ID_XOP
2301 #endif
2302 #if SIMDPP_ARCH_PP_NS_USE_AVX512F
2303 #define SIMDPP_DISPATCH_15_NS_ID_AVX512F SIMDPP_INSN_ID_AVX512F
2304 #else
2305 #define SIMDPP_DISPATCH_15_NS_ID_AVX512F
2306 #endif
2307 #if SIMDPP_ARCH_PP_NS_USE_AVX512BW
2308 #define SIMDPP_DISPATCH_15_NS_ID_AVX512BW SIMDPP_INSN_ID_AVX512BW
2309 #else
2310 #define SIMDPP_DISPATCH_15_NS_ID_AVX512BW
2311 #endif
2312 #if SIMDPP_ARCH_PP_NS_USE_AVX512DQ
2313 #define SIMDPP_DISPATCH_15_NS_ID_AVX512DQ SIMDPP_INSN_ID_AVX512DQ
2314 #else
2315 #define SIMDPP_DISPATCH_15_NS_ID_AVX512DQ
2316 #endif
2317 #if SIMDPP_ARCH_PP_NS_USE_AVX512VL
2318 #define SIMDPP_DISPATCH_15_NS_ID_AVX512VL SIMDPP_INSN_ID_AVX512VL
2319 #else
2320 #define SIMDPP_DISPATCH_15_NS_ID_AVX512VL
2321 #endif
2322 #if SIMDPP_ARCH_PP_NS_USE_NEON
2323 #define SIMDPP_DISPATCH_15_NS_ID_NEON SIMDPP_INSN_ID_NEON
2324 #else
2325 #define SIMDPP_DISPATCH_15_NS_ID_NEON
2326 #endif
2327 #if SIMDPP_ARCH_PP_NS_USE_NEON_FLT_SP
2328 #define SIMDPP_DISPATCH_15_NS_ID_NEON_FLT_SP SIMDPP_INSN_ID_NEON_FLT_SP
2329 #else
2330 #define SIMDPP_DISPATCH_15_NS_ID_NEON_FLT_SP
2331 #endif
2332 #if SIMDPP_ARCH_PP_NS_USE_MSA
2333 #define SIMDPP_DISPATCH_15_NS_ID_MSA SIMDPP_INSN_ID_MSA
2334 #else
2335 #define SIMDPP_DISPATCH_15_NS_ID_MSA
2336 #endif
2337 #if SIMDPP_ARCH_PP_NS_USE_ALTIVEC
2338 #define SIMDPP_DISPATCH_15_NS_ID_ALTIVEC SIMDPP_INSN_ID_ALTIVEC
2339 #else
2340 #define SIMDPP_DISPATCH_15_NS_ID_ALTIVEC
2341 #endif
2342 #if SIMDPP_ARCH_PP_NS_USE_VSX_206
2343 #define SIMDPP_DISPATCH_15_NS_ID_VSX_206 SIMDPP_INSN_ID_VSX_206
2344 #else
2345 #define SIMDPP_DISPATCH_15_NS_ID_VSX_206
2346 #endif
2347 #if SIMDPP_ARCH_PP_NS_USE_VSX_207
2348 #define SIMDPP_DISPATCH_15_NS_ID_VSX_207 SIMDPP_INSN_ID_VSX_207
2349 #else
2350 #define SIMDPP_DISPATCH_15_NS_ID_VSX_207
2351 #endif
2352
2353 #define SIMDPP_DISPATCH_15_NAMESPACE SIMDPP_PP_PASTE22(arch, \
2354 SIMDPP_DISPATCH_15_NS_ID_NULL, \
2355 SIMDPP_DISPATCH_15_NS_ID_SSE2, \
2356 SIMDPP_DISPATCH_15_NS_ID_SSE3, \
2357 SIMDPP_DISPATCH_15_NS_ID_SSSE3, \
2358 SIMDPP_DISPATCH_15_NS_ID_SSE4_1, \
2359 SIMDPP_DISPATCH_15_NS_ID_POPCNT_INSN, \
2360 SIMDPP_DISPATCH_15_NS_ID_AVX, \
2361 SIMDPP_DISPATCH_15_NS_ID_AVX2, \
2362 SIMDPP_DISPATCH_15_NS_ID_AVX512F, \
2363 SIMDPP_DISPATCH_15_NS_ID_AVX512BW, \
2364 SIMDPP_DISPATCH_15_NS_ID_AVX512DQ, \
2365 SIMDPP_DISPATCH_15_NS_ID_AVX512VL, \
2366 SIMDPP_DISPATCH_15_NS_ID_FMA3, \
2367 SIMDPP_DISPATCH_15_NS_ID_FMA4, \
2368 SIMDPP_DISPATCH_15_NS_ID_XOP, \
2369 SIMDPP_DISPATCH_15_NS_ID_NEON, \
2370 SIMDPP_DISPATCH_15_NS_ID_NEON_FLT_SP, \
2371 SIMDPP_DISPATCH_15_NS_ID_MSA, \
2372 SIMDPP_DISPATCH_15_NS_ID_ALTIVEC, \
2373 SIMDPP_DISPATCH_15_NS_ID_VSX_206, \
2374 SIMDPP_DISPATCH_15_NS_ID_VSX_207)
2375
2376 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE SIMDPP_DISPATCH_15_NAMESPACE
2377 #define SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH 1
2378 #include <simdpp/dispatch/preprocess_single_compile_arch.h>
2379 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_FOR_DISPATCH
2380 #undef SIMDPP_ARCH_PP_THIS_COMPILE_ARCH_NAMESPACE
2381
2382 #define SIMDPP_DISPATCH_15_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2383 { /* the following will fail if the overload is not available */ \
2384 FUN_TYPE fun_ptr = &SIMDPP_DISPATCH_15_NAMESPACE::SIMDPP_PP_REMOVE_PARENS(NAME);\
2385 ARRAY[15-1] = ::simdpp::SIMDPP_DISPATCH_15_NAMESPACE::detail::create_fn_version(fun_ptr);\
2386 }
2387
2388 #define SIMDPP_DISPATCH_15_FN_DECLARE(SIGNATURE) \
2389 namespace SIMDPP_DISPATCH_15_NAMESPACE { \
2390 SIMDPP_PP_REMOVE_PARENS(SIGNATURE); \
2391 }
2392 #undef SIMDPP_ARCH_PP_LIST
2393#else
2394 #define SIMDPP_DISPATCH_15_FN_REGISTER(ARRAY,NAME,FUN_TYPE)
2395 #define SIMDPP_DISPATCH_15_FN_DECLARE(SIGNATURE)
2396#endif
2397
2398
2399#define SIMDPP_DISPATCH_DECLARE_FUNCTIONS(SIGNATURE) \
2400 SIMDPP_DISPATCH_1_FN_DECLARE(SIGNATURE) \
2401 SIMDPP_DISPATCH_2_FN_DECLARE(SIGNATURE) \
2402 SIMDPP_DISPATCH_3_FN_DECLARE(SIGNATURE) \
2403 SIMDPP_DISPATCH_4_FN_DECLARE(SIGNATURE) \
2404 SIMDPP_DISPATCH_5_FN_DECLARE(SIGNATURE) \
2405 SIMDPP_DISPATCH_6_FN_DECLARE(SIGNATURE) \
2406 SIMDPP_DISPATCH_7_FN_DECLARE(SIGNATURE) \
2407 SIMDPP_DISPATCH_8_FN_DECLARE(SIGNATURE) \
2408 SIMDPP_DISPATCH_9_FN_DECLARE(SIGNATURE) \
2409 SIMDPP_DISPATCH_10_FN_DECLARE(SIGNATURE) \
2410 SIMDPP_DISPATCH_11_FN_DECLARE(SIGNATURE) \
2411 SIMDPP_DISPATCH_12_FN_DECLARE(SIGNATURE) \
2412 SIMDPP_DISPATCH_13_FN_DECLARE(SIGNATURE) \
2413 SIMDPP_DISPATCH_14_FN_DECLARE(SIGNATURE) \
2414 SIMDPP_DISPATCH_15_FN_DECLARE(SIGNATURE) \
2415
2416
2417#define SIMDPP_DISPATCH_COLLECT_FUNCTIONS(ARRAY,NAME,FUN_TYPE) \
2418 SIMDPP_DISPATCH_1_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2419 SIMDPP_DISPATCH_2_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2420 SIMDPP_DISPATCH_3_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2421 SIMDPP_DISPATCH_4_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2422 SIMDPP_DISPATCH_5_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2423 SIMDPP_DISPATCH_6_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2424 SIMDPP_DISPATCH_7_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2425 SIMDPP_DISPATCH_8_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2426 SIMDPP_DISPATCH_9_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2427 SIMDPP_DISPATCH_10_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2428 SIMDPP_DISPATCH_11_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2429 SIMDPP_DISPATCH_12_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2430 SIMDPP_DISPATCH_13_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2431 SIMDPP_DISPATCH_14_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2432 SIMDPP_DISPATCH_15_FN_REGISTER(ARRAY,NAME,FUN_TYPE) \
2433
2434
2435#endif // SIMDPP_EMIT_DISPATCHER
2436#endif
2437
2438