1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* StringZilla machine probe: prints the tiers the RUNNING CPU supports, one comma-separated list.
*
* Unlike the sibling `<arch>_<tier>.c` files - which are try-COMPILED to learn what the toolchain can
* emit - this program is try-RUN by the build systems (CMake `try_run`, Cargo `build.rs`) to learn what
* the build machine can execute. Static/comptime dispatch then enables the intersection of the two sets.
*
* The translation unit is serial-only (every `SZ_USE_*` is off, so no SIMD kernel or intrinsics header
* is pulled in and it compiles at baseline flags everywhere), yet the runtime detectors still report the
* FULL hardware capability set - detection is independent of the compiled tiers by design: cpuid/xgetbv
* on x86, sysctl on Apple, `mrs` with a SIGILL guard on Linux Arm, auxiliary-vector HWCAPs on RISC-V,
* LoongArch, and POWER. Token names come from the library's own capability map, so build systems parse
* tokens they know and ignore the rest. On platforms where the header performs no real hardware
* introspection (WebAssembly, OS-less targets - see `SZ_CAPABILITIES_RUNTIME_DETECTABLE_`) the program
* exits non-zero instead of printing a misleading "serial", and build systems treat that like any other
* probe failure: no answer, fall back to the target description.
*/
int