38
38
#define CPUINFO_ARCH_PNACL 1
39
39
#endif
40
40
41
- #if defined(EMSCRIPTEN )
41
+ #if defined(__asmjs__ )
42
42
#define CPUINFO_ARCH_ASMJS 1
43
43
#endif
44
44
45
+ #if defined(__wasm__ )
46
+ #if defined(__wasm_simd128__ )
47
+ #define CPUINFO_ARCH_WASMSIMD 1
48
+ #else
49
+ #define CPUINFO_ARCH_WASM 1
50
+ #endif
51
+ #endif
52
+
45
53
#if CPUINFO_ARCH_X86 && defined(_MSC_VER )
46
54
#define CPUINFO_ABI __cdecl
47
55
#elif CPUINFO_ARCH_X86 && defined(__GNUC__ )
80
88
#define CPUINFO_ARCH_ASMJS 0
81
89
#endif
82
90
91
+ #ifndef CPUINFO_ARCH_WASM
92
+ #define CPUINFO_ARCH_WASM 0
93
+ #endif
94
+
95
+ #ifndef CPUINFO_ARCH_WASMSIMD
96
+ #define CPUINFO_ARCH_WASMSIMD 0
97
+ #endif
98
+
83
99
#define CPUINFO_CACHE_UNIFIED 0x00000001
84
100
#define CPUINFO_CACHE_INCLUSIVE 0x00000002
85
101
#define CPUINFO_CACHE_COMPLEX_INDEXING 0x00000004
@@ -278,24 +294,32 @@ enum cpuinfo_uarch {
278
294
cpuinfo_uarch_haswell = 0x00100208 ,
279
295
/** Intel Broadwell microarchitecture. */
280
296
cpuinfo_uarch_broadwell = 0x00100209 ,
281
- /** Intel Sky Lake microarchitecture. */
297
+ /** Intel Sky Lake microarchitecture (14 nm, including Kaby/Coffee/Whiskey/Amber/Comet/Cascade/Cooper Lake) . */
282
298
cpuinfo_uarch_sky_lake = 0x0010020A ,
283
- /** Intel Kaby Lake microarchitecture. */
284
- cpuinfo_uarch_kaby_lake = 0x0010020B ,
299
+ /** DEPRECATED (Intel Kaby Lake microarchitecture). */
300
+ cpuinfo_uarch_kaby_lake = 0x0010020A ,
301
+ /** Intel Palm Cove microarchitecture (10 nm, Cannon Lake). */
302
+ cpuinfo_uarch_palm_cove = 0x0010020B ,
303
+ /** Intel Sunny Cove microarchitecture (10 nm, Ice Lake). */
304
+ cpuinfo_uarch_sunny_cove = 0x0010020C ,
285
305
286
306
/** Pentium 4 with Willamette, Northwood, or Foster cores. */
287
307
cpuinfo_uarch_willamette = 0x00100300 ,
288
308
/** Pentium 4 with Prescott and later cores. */
289
309
cpuinfo_uarch_prescott = 0x00100301 ,
290
310
291
311
/** Intel Atom on 45 nm process. */
292
- cpuinfo_uarch_bonnell = 0x00100400 ,
312
+ cpuinfo_uarch_bonnell = 0x00100400 ,
293
313
/** Intel Atom on 32 nm process. */
294
- cpuinfo_uarch_saltwell = 0x00100401 ,
314
+ cpuinfo_uarch_saltwell = 0x00100401 ,
295
315
/** Intel Silvermont microarchitecture (22 nm out-of-order Atom). */
296
- cpuinfo_uarch_silvermont = 0x00100402 ,
316
+ cpuinfo_uarch_silvermont = 0x00100402 ,
297
317
/** Intel Airmont microarchitecture (14 nm out-of-order Atom). */
298
- cpuinfo_uarch_airmont = 0x00100403 ,
318
+ cpuinfo_uarch_airmont = 0x00100403 ,
319
+ /** Intel Goldmont microarchitecture (Denverton, Apollo Lake). */
320
+ cpuinfo_uarch_goldmont = 0x00100404 ,
321
+ /** Intel Goldmont Plus microarchitecture (Gemini Lake). */
322
+ cpuinfo_uarch_goldmont_plus = 0x00100405 ,
299
323
300
324
/** Intel Knights Ferry HPC boards. */
301
325
cpuinfo_uarch_knights_ferry = 0x00100500 ,
@@ -335,8 +359,10 @@ enum cpuinfo_uarch {
335
359
cpuinfo_uarch_steamroller = 0x00200107 ,
336
360
/** AMD Excavator microarchitecture (Carizzo APUs). */
337
361
cpuinfo_uarch_excavator = 0x00200108 ,
338
- /** AMD Zen microarchitecture (Ryzen CPUs). */
362
+ /** AMD Zen microarchitecture (12/14 nm Ryzen and EPYC CPUs). */
339
363
cpuinfo_uarch_zen = 0x00200109 ,
364
+ /** AMD Zen 2 microarchitecture (7 nm Ryzen and EPYC CPUs). */
365
+ cpuinfo_uarch_zen2 = 0x0020010A ,
340
366
341
367
/** NSC Geode and AMD Geode GX and LX. */
342
368
cpuinfo_uarch_geode = 0x00200200 ,
@@ -370,23 +396,34 @@ enum cpuinfo_uarch {
370
396
cpuinfo_uarch_cortex_a17 = 0x00300217 ,
371
397
372
398
/** ARM Cortex-A32. */
373
- cpuinfo_uarch_cortex_a32 = 0x00300332 ,
399
+ cpuinfo_uarch_cortex_a32 = 0x00300332 ,
374
400
/** ARM Cortex-A35. */
375
- cpuinfo_uarch_cortex_a35 = 0x00300335 ,
401
+ cpuinfo_uarch_cortex_a35 = 0x00300335 ,
376
402
/** ARM Cortex-A53. */
377
- cpuinfo_uarch_cortex_a53 = 0x00300353 ,
403
+ cpuinfo_uarch_cortex_a53 = 0x00300353 ,
378
404
/** ARM Cortex-A55. */
379
- cpuinfo_uarch_cortex_a55 = 0x00300355 ,
405
+ cpuinfo_uarch_cortex_a55 = 0x00300355 ,
380
406
/** ARM Cortex-A57. */
381
- cpuinfo_uarch_cortex_a57 = 0x00300357 ,
407
+ cpuinfo_uarch_cortex_a57 = 0x00300357 ,
408
+ /** ARM Cortex-A65. */
409
+ cpuinfo_uarch_cortex_a65 = 0x00300365 ,
382
410
/** ARM Cortex-A72. */
383
- cpuinfo_uarch_cortex_a72 = 0x00300372 ,
411
+ cpuinfo_uarch_cortex_a72 = 0x00300372 ,
384
412
/** ARM Cortex-A73. */
385
- cpuinfo_uarch_cortex_a73 = 0x00300373 ,
413
+ cpuinfo_uarch_cortex_a73 = 0x00300373 ,
386
414
/** ARM Cortex-A75. */
387
- cpuinfo_uarch_cortex_a75 = 0x00300375 ,
415
+ cpuinfo_uarch_cortex_a75 = 0x00300375 ,
388
416
/** ARM Cortex-A76. */
389
- cpuinfo_uarch_cortex_a76 = 0x00300376 ,
417
+ cpuinfo_uarch_cortex_a76 = 0x00300376 ,
418
+ /** ARM Cortex-A76AE. */
419
+ cpuinfo_uarch_cortex_a76ae = 0x00300378 ,
420
+ /** ARM Cortex-A77. */
421
+ cpuinfo_uarch_cortex_a77 = 0x00300377 ,
422
+
423
+ /** ARM Neoverse N1. */
424
+ cpuinfo_uarch_neoverse_n1 = 0x00300400 ,
425
+ /** ARM Neoverse E1. */
426
+ cpuinfo_uarch_neoverse_e1 = 0x00300401 ,
390
427
391
428
/** Qualcomm Scorpion. */
392
429
cpuinfo_uarch_scorpion = 0x00400100 ,
@@ -406,12 +443,22 @@ enum cpuinfo_uarch {
406
443
/** Nvidia Carmel. */
407
444
cpuinfo_uarch_carmel = 0x00500102 ,
408
445
409
- /** Samsung Mongoose M1 (Exynos 8890 big cores). */
446
+ /** Samsung Exynos M1 (Exynos 8890 big cores). */
447
+ cpuinfo_uarch_exynos_m1 = 0x00600100 ,
448
+ /** Samsung Exynos M2 (Exynos 8895 big cores). */
449
+ cpuinfo_uarch_exynos_m2 = 0x00600101 ,
450
+ /** Samsung Exynos M3 (Exynos 9810 big cores). */
451
+ cpuinfo_uarch_exynos_m3 = 0x00600102 ,
452
+ /** Samsung Exynos M4 (Exynos 9820 big cores). */
453
+ cpuinfo_uarch_exynos_m4 = 0x00600103 ,
454
+ /** Samsung Exynos M5 (Exynos 9830 big cores). */
455
+ cpuinfo_uarch_exynos_m5 = 0x00600104 ,
456
+
457
+ /* Old names for Exynos. */
410
458
cpuinfo_uarch_mongoose_m1 = 0x00600100 ,
411
- /** Samsung Mongoose M2 (Exynos 8895 big cores). */
412
459
cpuinfo_uarch_mongoose_m2 = 0x00600101 ,
413
- /** Samsung Meerkat M3 (Exynos 9810 big cores). */
414
460
cpuinfo_uarch_meerkat_m3 = 0x00600102 ,
461
+ cpuinfo_uarch_meerkat_m4 = 0x00600103 ,
415
462
416
463
/** Apple A6 and A6X processors. */
417
464
cpuinfo_uarch_swift = 0x00700100 ,
@@ -640,6 +687,8 @@ void CPUINFO_ABI cpuinfo_deinitialize(void);
640
687
bool avx512bitalg ;
641
688
bool avx512vpopcntdq ;
642
689
bool avx512vnni ;
690
+ bool avx512bf16 ;
691
+ bool avx512vp2intersect ;
643
692
bool avx512_4vnniw ;
644
693
bool avx512_4fmaps ;
645
694
bool hle ;
@@ -1110,6 +1159,22 @@ static inline bool cpuinfo_has_x86_avx512vnni(void) {
1110
1159
#endif
1111
1160
}
1112
1161
1162
+ static inline bool cpuinfo_has_x86_avx512bf16 (void ) {
1163
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1164
+ return cpuinfo_isa .avx512bf16 ;
1165
+ #else
1166
+ return false;
1167
+ #endif
1168
+ }
1169
+
1170
+ static inline bool cpuinfo_has_x86_avx512vp2intersect (void ) {
1171
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1172
+ return cpuinfo_isa .avx512vp2intersect ;
1173
+ #else
1174
+ return false;
1175
+ #endif
1176
+ }
1177
+
1113
1178
static inline bool cpuinfo_has_x86_avx512_4vnniw (void ) {
1114
1179
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1115
1180
return cpuinfo_isa .avx512_4vnniw ;
@@ -1682,6 +1747,11 @@ uint32_t CPUINFO_ABI cpuinfo_get_l2_caches_count(void);
1682
1747
uint32_t CPUINFO_ABI cpuinfo_get_l3_caches_count (void );
1683
1748
uint32_t CPUINFO_ABI cpuinfo_get_l4_caches_count (void );
1684
1749
1750
+ /**
1751
+ * Returns upper bound on cache size.
1752
+ */
1753
+ uint32_t CPUINFO_ABI cpuinfo_get_max_cache_size (void );
1754
+
1685
1755
const struct cpuinfo_processor * CPUINFO_ABI cpuinfo_get_current_processor (void );
1686
1756
const struct cpuinfo_core * CPUINFO_ABI cpuinfo_get_current_core (void );
1687
1757
0 commit comments