Debian Codegraph @

third-party/simde/simde-arch.h

raw
1 /* Architecture detection
2 * Created by Evan Nemerson <[email protected]>
3 *
4 * To the extent possible under law, the authors have waived all
5 * copyright and related or neighboring rights to this code. For
6 * details, see the Creative Commons Zero 1.0 Universal license at
7 * <https://creativecommons.org/publicdomain/zero/1.0/>
8 *
9 * SPDX-License-Identifier: CC0-1.0
10 *
11 * Different compilers define different preprocessor macros for the
12 * same architecture. This is an attempt to provide a single
13 * interface which is usable on any compiler.
14 *
15 * In general, a macro named SIMDE_ARCH_* is defined for each
16 * architecture the CPU supports. When there are multiple possible
17 * versions, we try to define the macro to the target version. For
18 * example, if you want to check for i586+, you could do something
19 * like:
20 *
21 * #if defined(SIMDE_ARCH_X86) && (SIMDE_ARCH_X86 >= 5)
22 * ...
23 * #endif
24 *
25 * You could also just check that SIMDE_ARCH_X86 >= 5 without checking
26 * if it's defined first, but some compilers may emit a warning about
27 * an undefined macro being used (e.g., GCC with -Wundef).
28 *
29 * This was originally created for SIMDe
30 * <https://github.com/simd-everywhere/simde> (hence the prefix), but this
31 * header has no dependencies and may be used anywhere. It is
32 * originally based on information from
33 * <https://sourceforge.net/p/predef/wiki/Architectures/>, though it
34 * has been enhanced with additional information.
35 *
36 * If you improve this file, or find a bug, please file the issue at
37 * <https://github.com/simd-everywhere/simde/issues>. If you copy this into
38 * your project, even if you change the prefix, please keep the links
39 * to SIMDe intact so others know where to report issues, submit
40 * enhancements, and find the latest version. */
41
42 #if !defined(SIMDE_ARCH_H)
43 #define SIMDE_ARCH_H
44
45 /* Alpha
46 <https://en.wikipedia.org/wiki/DEC_Alpha> */
47 #if defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
48 # if defined(__alpha_ev6__)
49 # define SIMDE_ARCH_ALPHA 6
50 # elif defined(__alpha_ev5__)
51 # define SIMDE_ARCH_ALPHA 5
52 # elif defined(__alpha_ev4__)
53 # define SIMDE_ARCH_ALPHA 4
54 # else
55 # define SIMDE_ARCH_ALPHA 1
56 # endif
57 #endif
58 #if defined(SIMDE_ARCH_ALPHA)
59 # define SIMDE_ARCH_ALPHA_CHECK(version) ((version) <= SIMDE_ARCH_ALPHA)
60 #else
61 # define SIMDE_ARCH_ALPHA_CHECK(version) (0)
62 #endif
63
64 /* Atmel AVR
65 <https://en.wikipedia.org/wiki/Atmel_AVR> */
66 #if defined(__AVR_ARCH__)
67 # define SIMDE_ARCH_AVR __AVR_ARCH__
68 #endif
69
70 /* AMD64 / x86_64
71 <https://en.wikipedia.org/wiki/X86-64> */
72 #if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
73 # if !defined(_M_ARM64EC)
74 # define SIMDE_ARCH_AMD64 1000
75 # endif
76 #endif
77
78 /* ARM
79 <https://en.wikipedia.org/wiki/ARM_architecture> */
80 #if defined(__ARM_ARCH)
81 # if __ARM_ARCH > 100
82 # define SIMDE_ARCH_ARM (__ARM_ARCH)
83 # else
84 # define SIMDE_ARCH_ARM (__ARM_ARCH * 100)
85 # endif
86 #elif defined(_M_ARM)
87 # if _M_ARM > 100
88 # define SIMDE_ARCH_ARM (_M_ARM)
89 # else
90 # define SIMDE_ARCH_ARM (_M_ARM * 100)
91 # endif
92 #elif defined(_M_ARM64) || defined(_M_ARM64EC)
93 # define SIMDE_ARCH_ARM 800
94 #elif defined(__arm__) || defined(__thumb__) || defined(__TARGET_ARCH_ARM) || defined(_ARM) || defined(_M_ARM) || defined(_M_ARM)
95 # define SIMDE_ARCH_ARM 1
96 #endif
97 #if defined(SIMDE_ARCH_ARM)
98 # define SIMDE_ARCH_ARM_CHECK(major, minor) (((major * 100) + (minor)) <= SIMDE_ARCH_ARM)
99 #else
100 # define SIMDE_ARCH_ARM_CHECK(major, minor) (0)
101 #endif
102
103 /* AArch64
104 <https://en.wikipedia.org/wiki/ARM_architecture> */
105 #if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
106 # define SIMDE_ARCH_AARCH64 1000
107 #endif
108 #if defined(SIMDE_ARCH_AARCH64)
109 # define SIMDE_ARCH_AARCH64_CHECK(version) ((version) <= SIMDE_ARCH_AARCH64)
110 #else
111 # define SIMDE_ARCH_AARCH64_CHECK(version) (0)
112 #endif
113
114 /* ARM SIMD ISA extensions */
115 #if defined(__ARM_NEON) || defined(SIMDE_ARCH_AARCH64)
116 # if defined(SIMDE_ARCH_AARCH64)
117 # define SIMDE_ARCH_ARM_NEON SIMDE_ARCH_AARCH64
118 # elif defined(SIMDE_ARCH_ARM)
119 # define SIMDE_ARCH_ARM_NEON SIMDE_ARCH_ARM
120 # endif
121 #endif
122 #if defined(__ARM_FEATURE_SVE)
123 # define SIMDE_ARCH_ARM_SVE
124 #endif
125
126 /* Blackfin
127 <https://en.wikipedia.org/wiki/Blackfin> */
128 #if defined(__bfin) || defined(__BFIN__) || defined(__bfin__)
129 # define SIMDE_ARCH_BLACKFIN 1
130 #endif
131
132 /* CRIS
133 <https://en.wikipedia.org/wiki/ETRAX_CRIS> */
134 #if defined(__CRIS_arch_version)
135 # define SIMDE_ARCH_CRIS __CRIS_arch_version
136 #elif defined(__cris__) || defined(__cris) || defined(__CRIS) || defined(__CRIS__)
137 # define SIMDE_ARCH_CRIS 1
138 #endif
139
140 /* Convex
141 <https://en.wikipedia.org/wiki/Convex_Computer> */
142 #if defined(__convex_c38__)
143 # define SIMDE_ARCH_CONVEX 38
144 #elif defined(__convex_c34__)
145 # define SIMDE_ARCH_CONVEX 34
146 #elif defined(__convex_c32__)
147 # define SIMDE_ARCH_CONVEX 32
148 #elif defined(__convex_c2__)
149 # define SIMDE_ARCH_CONVEX 2
150 #elif defined(__convex__)
151 # define SIMDE_ARCH_CONVEX 1
152 #endif
153 #if defined(SIMDE_ARCH_CONVEX)
154 # define SIMDE_ARCH_CONVEX_CHECK(version) ((version) <= SIMDE_ARCH_CONVEX)
155 #else
156 # define SIMDE_ARCH_CONVEX_CHECK(version) (0)
157 #endif
158
159 /* Adapteva Epiphany
160 <https://en.wikipedia.org/wiki/Adapteva_Epiphany> */
161 #if defined(__epiphany__)
162 # define SIMDE_ARCH_EPIPHANY 1
163 #endif
164
165 /* Fujitsu FR-V
166 <https://en.wikipedia.org/wiki/FR-V_(microprocessor)> */
167 #if defined(__frv__)
168 # define SIMDE_ARCH_FRV 1
169 #endif
170
171 /* H8/300
172 <https://en.wikipedia.org/wiki/H8_Family> */
173 #if defined(__H8300__)
174 # define SIMDE_ARCH_H8300
175 #endif
176
177 /* Elbrus (8S, 8SV and successors)
178 <https://en.wikipedia.org/wiki/Elbrus-8S> */
179 #if defined(__e2k__)
180 # define SIMDE_ARCH_E2K
181 #endif
182
183 /* HP/PA / PA-RISC
184 <https://en.wikipedia.org/wiki/PA-RISC> */
185 #if defined(__PA8000__) || defined(__HPPA20__) || defined(__RISC2_0__) || defined(_PA_RISC2_0)
186 # define SIMDE_ARCH_HPPA 20
187 #elif defined(__PA7100__) || defined(__HPPA11__) || defined(_PA_RISC1_1)
188 # define SIMDE_ARCH_HPPA 11
189 #elif defined(_PA_RISC1_0)
190 # define SIMDE_ARCH_HPPA 10
191 #elif defined(__hppa__) || defined(__HPPA__) || defined(__hppa)
192 # define SIMDE_ARCH_HPPA 1
193 #endif
194 #if defined(SIMDE_ARCH_HPPA)
195 # define SIMDE_ARCH_HPPA_CHECK(version) ((version) <= SIMDE_ARCH_HPPA)
196 #else
197 # define SIMDE_ARCH_HPPA_CHECK(version) (0)
198 #endif
199
200 /* x86
201 <https://en.wikipedia.org/wiki/X86> */
202 #if defined(_M_IX86)
203 # define SIMDE_ARCH_X86 (_M_IX86 / 100)
204 #elif defined(__I86__)
205 # define SIMDE_ARCH_X86 __I86__
206 #elif defined(i686) || defined(__i686) || defined(__i686__)
207 # define SIMDE_ARCH_X86 6
208 #elif defined(i586) || defined(__i586) || defined(__i586__)
209 # define SIMDE_ARCH_X86 5
210 #elif defined(i486) || defined(__i486) || defined(__i486__)
211 # define SIMDE_ARCH_X86 4
212 #elif defined(i386) || defined(__i386) || defined(__i386__)
213 # define SIMDE_ARCH_X86 3
214 #elif defined(_X86_) || defined(__X86__) || defined(__THW_INTEL__)
215 # define SIMDE_ARCH_X86 3
216 #endif
217 #if defined(SIMDE_ARCH_X86)
218 # define SIMDE_ARCH_X86_CHECK(version) ((version) <= SIMDE_ARCH_X86)
219 #else
220 # define SIMDE_ARCH_X86_CHECK(version) (0)
221 #endif
222
223 /* SIMD ISA extensions for x86/x86_64 and Elbrus */
224 #if defined(SIMDE_ARCH_X86) || defined(SIMDE_ARCH_AMD64) || defined(SIMDE_ARCH_E2K)
225 # if defined(_M_IX86_FP)
226 # define SIMDE_ARCH_X86_MMX
227 # if (_M_IX86_FP >= 1)
228 # define SIMDE_ARCH_X86_SSE 1
229 # endif
230 # if (_M_IX86_FP >= 2)
231 # define SIMDE_ARCH_X86_SSE2 1
232 # endif
233 # elif defined(_M_X64)
234 # define SIMDE_ARCH_X86_SSE 1
235 # define SIMDE_ARCH_X86_SSE2 1
236 # else
237 # if defined(__MMX__)
238 # define SIMDE_ARCH_X86_MMX 1
239 # endif
240 # if defined(__SSE__)
241 # define SIMDE_ARCH_X86_SSE 1
242 # endif
243 # if defined(__SSE2__)
244 # define SIMDE_ARCH_X86_SSE2 1
245 # endif
246 # endif
247 # if defined(__SSE3__)
248 # define SIMDE_ARCH_X86_SSE3 1
249 # endif
250 # if defined(__SSSE3__)
251 # define SIMDE_ARCH_X86_SSSE3 1
252 # endif
253 # if defined(__SSE4_1__)
254 # define SIMDE_ARCH_X86_SSE4_1 1
255 # endif
256 # if defined(__SSE4_2__)
257 # define SIMDE_ARCH_X86_SSE4_2 1
258 # endif
259 # if defined(__XOP__)
260 # define SIMDE_ARCH_X86_XOP 1
261 # endif
262 # if defined(__AVX__)
263 # define SIMDE_ARCH_X86_AVX 1
264 # if !defined(SIMDE_ARCH_X86_SSE3)
265 # define SIMDE_ARCH_X86_SSE3 1
266 # endif
267 # if !defined(SIMDE_ARCH_X86_SSE4_1)
268 # define SIMDE_ARCH_X86_SSE4_1 1
269 # endif
270 # if !defined(SIMDE_ARCH_X86_SSE4_1)
271 # define SIMDE_ARCH_X86_SSE4_2 1
272 # endif
273 # endif
274 # if defined(__AVX2__)
275 # define SIMDE_ARCH_X86_AVX2 1
276 # endif
277 # if defined(__FMA__)
278 # define SIMDE_ARCH_X86_FMA 1
279 # if !defined(SIMDE_ARCH_X86_AVX)
280 # define SIMDE_ARCH_X86_AVX 1
281 # endif
282 # endif
283 # if defined(__AVX512VP2INTERSECT__)
284 # define SIMDE_ARCH_X86_AVX512VP2INTERSECT 1
285 # endif
286 # if defined(__AVX512BITALG__)
287 # define SIMDE_ARCH_X86_AVX512BITALG 1
288 # endif
289 # if defined(__AVX512VPOPCNTDQ__)
290 # define SIMDE_ARCH_X86_AVX512VPOPCNTDQ 1
291 # endif
292 # if defined(__AVX512VBMI__)
293 # define SIMDE_ARCH_X86_AVX512VBMI 1
294 # endif
295 # if defined(__AVX512VBMI2__)
296 # define SIMDE_ARCH_X86_AVX512VBMI2 1
297 # endif
298 # if defined(__AVX512VNNI__)
299 # define SIMDE_ARCH_X86_AVX512VNNI 1
300 # endif
301 # if defined(__AVX5124VNNIW__)
302 # define SIMDE_ARCH_X86_AVX5124VNNIW 1
303 # endif
304 # if defined(__AVX512BW__)
305 # define SIMDE_ARCH_X86_AVX512BW 1
306 # endif
307 # if defined(__AVX512BF16__)
308 # define SIMDE_ARCH_X86_AVX512BF16 1
309 # endif
310 # if defined(__AVX512CD__)
311 # define SIMDE_ARCH_X86_AVX512CD 1
312 # endif
313 # if defined(__AVX512DQ__)
314 # define SIMDE_ARCH_X86_AVX512DQ 1
315 # endif
316 # if defined(__AVX512F__)
317 # define SIMDE_ARCH_X86_AVX512F 1
318 # endif
319 # if defined(__AVX512VL__)
320 # define SIMDE_ARCH_X86_AVX512VL 1
321 # endif
322 # if defined(__GFNI__)
323 # define SIMDE_ARCH_X86_GFNI 1
324 # endif
325 # if defined(__PCLMUL__)
326 # define SIMDE_ARCH_X86_PCLMUL 1
327 # endif
328 # if defined(__VPCLMULQDQ__)
329 # define SIMDE_ARCH_X86_VPCLMULQDQ 1
330 # endif
331 # if defined(__F16C__)
332 # define SIMDE_ARCH_X86_F16C 1
333 # endif
334 #endif
335
336 /* Itanium
337 <https://en.wikipedia.org/wiki/Itanium> */
338 #if defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(__ia64) || defined(_M_IA64) || defined(__itanium__)
339 # define SIMDE_ARCH_IA64 1
340 #endif
341
342 /* Renesas M32R
343 <https://en.wikipedia.org/wiki/M32R> */
344 #if defined(__m32r__) || defined(__M32R__)
345 # define SIMDE_ARCH_M32R
346 #endif
347
348 /* Motorola 68000
349 <https://en.wikipedia.org/wiki/Motorola_68000> */
350 #if defined(__mc68060__) || defined(__MC68060__)
351 # define SIMDE_ARCH_M68K 68060
352 #elif defined(__mc68040__) || defined(__MC68040__)
353 # define SIMDE_ARCH_M68K 68040
354 #elif defined(__mc68030__) || defined(__MC68030__)
355 # define SIMDE_ARCH_M68K 68030
356 #elif defined(__mc68020__) || defined(__MC68020__)
357 # define SIMDE_ARCH_M68K 68020
358 #elif defined(__mc68010__) || defined(__MC68010__)
359 # define SIMDE_ARCH_M68K 68010
360 #elif defined(__mc68000__) || defined(__MC68000__)
361 # define SIMDE_ARCH_M68K 68000
362 #endif
363 #if defined(SIMDE_ARCH_M68K)
364 # define SIMDE_ARCH_M68K_CHECK(version) ((version) <= SIMDE_ARCH_M68K)
365 #else
366 # define SIMDE_ARCH_M68K_CHECK(version) (0)
367 #endif
368
369 /* Xilinx MicroBlaze
370 <https://en.wikipedia.org/wiki/MicroBlaze> */
371 #if defined(__MICROBLAZE__) || defined(__microblaze__)
372 # define SIMDE_ARCH_MICROBLAZE
373 #endif
374
375 /* MIPS
376 <https://en.wikipedia.org/wiki/MIPS_architecture> */
377 #if defined(_MIPS_ISA_MIPS64R2)
378 # define SIMDE_ARCH_MIPS 642
379 #elif defined(_MIPS_ISA_MIPS64)
380 # define SIMDE_ARCH_MIPS 640
381 #elif defined(_MIPS_ISA_MIPS32R2)
382 # define SIMDE_ARCH_MIPS 322
383 #elif defined(_MIPS_ISA_MIPS32)
384 # define SIMDE_ARCH_MIPS 320
385 #elif defined(_MIPS_ISA_MIPS4)
386 # define SIMDE_ARCH_MIPS 4
387 #elif defined(_MIPS_ISA_MIPS3)
388 # define SIMDE_ARCH_MIPS 3
389 #elif defined(_MIPS_ISA_MIPS2)
390 # define SIMDE_ARCH_MIPS 2
391 #elif defined(_MIPS_ISA_MIPS1)
392 # define SIMDE_ARCH_MIPS 1
393 #elif defined(_MIPS_ISA_MIPS) || defined(__mips) || defined(__MIPS__)
394 # define SIMDE_ARCH_MIPS 1
395 #endif
396 #if defined(SIMDE_ARCH_MIPS)
397 # define SIMDE_ARCH_MIPS_CHECK(version) ((version) <= SIMDE_ARCH_MIPS)
398 #else
399 # define SIMDE_ARCH_MIPS_CHECK(version) (0)
400 #endif
401
402 #if defined(__mips_loongson_mmi)
403 # define SIMDE_ARCH_MIPS_LOONGSON_MMI 1
404 #endif
405
406 #if defined(__mips_msa)
407 # define SIMDE_ARCH_MIPS_MSA 1
408 #endif
409
410 /* Matsushita MN10300
411 <https://en.wikipedia.org/wiki/MN103> */
412 #if defined(__MN10300__) || defined(__mn10300__)
413 # define SIMDE_ARCH_MN10300 1
414 #endif
415
416 /* POWER
417 <https://en.wikipedia.org/wiki/IBM_POWER_Instruction_Set_Architecture> */
418 #if defined(_M_PPC)
419 # define SIMDE_ARCH_POWER _M_PPC
420 #elif defined(_ARCH_PWR9)
421 # define SIMDE_ARCH_POWER 900
422 #elif defined(_ARCH_PWR8)
423 # define SIMDE_ARCH_POWER 800
424 #elif defined(_ARCH_PWR7)
425 # define SIMDE_ARCH_POWER 700
426 #elif defined(_ARCH_PWR6)
427 # define SIMDE_ARCH_POWER 600
428 #elif defined(_ARCH_PWR5)
429 # define SIMDE_ARCH_POWER 500
430 #elif defined(_ARCH_PWR4)
431 # define SIMDE_ARCH_POWER 400
432 #elif defined(_ARCH_440) || defined(__ppc440__)
433 # define SIMDE_ARCH_POWER 440
434 #elif defined(_ARCH_450) || defined(__ppc450__)
435 # define SIMDE_ARCH_POWER 450
436 #elif defined(_ARCH_601) || defined(__ppc601__)
437 # define SIMDE_ARCH_POWER 601
438 #elif defined(_ARCH_603) || defined(__ppc603__)
439 # define SIMDE_ARCH_POWER 603
440 #elif defined(_ARCH_604) || defined(__ppc604__)
441 # define SIMDE_ARCH_POWER 604
442 #elif defined(_ARCH_605) || defined(__ppc605__)
443 # define SIMDE_ARCH_POWER 605
444 #elif defined(_ARCH_620) || defined(__ppc620__)
445 # define SIMDE_ARCH_POWER 620
446 #elif defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || defined(__ppc__) || defined(__PPC__) || defined(_ARCH_PPC) || defined(__ppc)
447 # define SIMDE_ARCH_POWER 1
448 #endif
449 #if defined(SIMDE_ARCH_POWER)
450 #define SIMDE_ARCH_POWER_CHECK(version) ((version) <= SIMDE_ARCH_POWER)
451 #else
452 #define SIMDE_ARCH_POWER_CHECK(version) (0)
453 #endif
454
455 #if defined(__ALTIVEC__)
456 # define SIMDE_ARCH_POWER_ALTIVEC SIMDE_ARCH_POWER
457 #define SIMDE_ARCH_POWER_ALTIVEC_CHECK(version) ((version) <= SIMDE_ARCH_POWER)
458 #else
459 #define SIMDE_ARCH_POWER_ALTIVEC_CHECK(version) (0)
460 #endif
461
462 /* SPARC
463 <https://en.wikipedia.org/wiki/SPARC> */
464 #if defined(__sparc_v9__) || defined(__sparcv9)
465 # define SIMDE_ARCH_SPARC 9
466 #elif defined(__sparc_v8__) || defined(__sparcv8)
467 # define SIMDE_ARCH_SPARC 8
468 #elif defined(__sparc_v7__) || defined(__sparcv7)
469 # define SIMDE_ARCH_SPARC 7
470 #elif defined(__sparc_v6__) || defined(__sparcv6)
471 # define SIMDE_ARCH_SPARC 6
472 #elif defined(__sparc_v5__) || defined(__sparcv5)
473 # define SIMDE_ARCH_SPARC 5
474 #elif defined(__sparc_v4__) || defined(__sparcv4)
475 # define SIMDE_ARCH_SPARC 4
476 #elif defined(__sparc_v3__) || defined(__sparcv3)
477 # define SIMDE_ARCH_SPARC 3
478 #elif defined(__sparc_v2__) || defined(__sparcv2)
479 # define SIMDE_ARCH_SPARC 2
480 #elif defined(__sparc_v1__) || defined(__sparcv1)
481 # define SIMDE_ARCH_SPARC 1
482 #elif defined(__sparc__) || defined(__sparc)
483 # define SIMDE_ARCH_SPARC 1
484 #endif
485 #if defined(SIMDE_ARCH_SPARC)
486 #define SIMDE_ARCH_SPARC_CHECK(version) ((version) <= SIMDE_ARCH_SPARC)
487 #else
488 #define SIMDE_ARCH_SPARC_CHECK(version) (0)
489 #endif
490
491 /* SuperH
492 <https://en.wikipedia.org/wiki/SuperH> */
493 #if defined(__sh5__) || defined(__SH5__)
494 # define SIMDE_ARCH_SUPERH 5
495 #elif defined(__sh4__) || defined(__SH4__)
496 # define SIMDE_ARCH_SUPERH 4
497 #elif defined(__sh3__) || defined(__SH3__)
498 # define SIMDE_ARCH_SUPERH 3
499 #elif defined(__sh2__) || defined(__SH2__)
500 # define SIMDE_ARCH_SUPERH 2
501 #elif defined(__sh1__) || defined(__SH1__)
502 # define SIMDE_ARCH_SUPERH 1
503 #elif defined(__sh__) || defined(__SH__)
504 # define SIMDE_ARCH_SUPERH 1
505 #endif
506
507 /* IBM System z
508 <https://en.wikipedia.org/wiki/IBM_System_z> */
509 #if defined(__370__) || defined(__THW_370__) || defined(__s390__) || defined(__s390x__) || defined(__zarch__) || defined(__SYSC_ZARCH__)
510 # define SIMDE_ARCH_ZARCH __ARCH__
511 #endif
512 #if defined(SIMDE_ARCH_ZARCH)
513 #define SIMDE_ARCH_ZARCH_CHECK(version) ((version) <= SIMDE_ARCH_ZARCH)
514 #else
515 #define SIMDE_ARCH_ZARCH_CHECK(version) (0)
516 #endif
517
518 #if defined(SIMDE_ARCH_ZARCH) && defined(__VEC__)
519 #define SIMDE_ARCH_ZARCH_ZVECTOR SIMDE_ARCH_ZARCH
520 #endif
521
522 /* TMS320 DSP
523 <https://en.wikipedia.org/wiki/Texas_Instruments_TMS320> */
524 #if defined(_TMS320C6740) || defined(__TMS320C6740__)
525 # define SIMDE_ARCH_TMS320 6740
526 #elif defined(_TMS320C6700_PLUS) || defined(__TMS320C6700_PLUS__)
527 # define SIMDE_ARCH_TMS320 6701
528 #elif defined(_TMS320C6700) || defined(__TMS320C6700__)
529 # define SIMDE_ARCH_TMS320 6700
530 #elif defined(_TMS320C6600) || defined(__TMS320C6600__)
531 # define SIMDE_ARCH_TMS320 6600
532 #elif defined(_TMS320C6400_PLUS) || defined(__TMS320C6400_PLUS__)
533 # define SIMDE_ARCH_TMS320 6401
534 #elif defined(_TMS320C6400) || defined(__TMS320C6400__)
535 # define SIMDE_ARCH_TMS320 6400
536 #elif defined(_TMS320C6200) || defined(__TMS320C6200__)
537 # define SIMDE_ARCH_TMS320 6200
538 #elif defined(_TMS320C55X) || defined(__TMS320C55X__)
539 # define SIMDE_ARCH_TMS320 550
540 #elif defined(_TMS320C54X) || defined(__TMS320C54X__)
541 # define SIMDE_ARCH_TMS320 540
542 #elif defined(_TMS320C28X) || defined(__TMS320C28X__)
543 # define SIMDE_ARCH_TMS320 280
544 #endif
545 #if defined(SIMDE_ARCH_TMS320)
546 #define SIMDE_ARCH_TMS320_CHECK(version) ((version) <= SIMDE_ARCH_TMS320)
547 #else
548 #define SIMDE_ARCH_TMS320_CHECK(version) (0)
549 #endif
550
551 /* WebAssembly */
552 #if defined(__wasm__)
553 # define SIMDE_ARCH_WASM 1
554 #endif
555
556 #if defined(SIMDE_ARCH_WASM) && defined(__wasm_simd128__)
557 # define SIMDE_ARCH_WASM_SIMD128
558 #endif
559
560 /* Xtensa
561 <https://en.wikipedia.org/wiki/> */
562 #if defined(__xtensa__) || defined(__XTENSA__)
563 # define SIMDE_ARCH_XTENSA 1
564 #endif
565
566 /* Availability of 16-bit floating-point arithmetic intrinsics */
567 #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
568 # define SIMDE_ARCH_ARM_NEON_FP16
569 #endif
570
571 #endif /* !defined(SIMDE_ARCH_H) */