exp/simd/README.md
This package requires Go 1.26 with GOEXPERIMENT=simd and amd64.
See benchmarks.
If you see SIGILL: illegal instruction when running tests, the CPU or VM does not support the SIMD instructions used by that code.
# List SIMD-related flags
grep -E 'avx' /proc/cpuinfo
# Or with lscpu
lscpu | grep -i avx
Rough mapping:
| Tests / code | Required flag(s) | Typical CPUs |
|---|---|---|
| AVX (128-bit) | avx (baseline on amd64) | All amd64 |
| AVX2 (256-bit) | avx2 | Intel Haswell+, AMD Excavator+ |
| AVX-512 (512-bit) | avx512f | Intel Skylake-X+, some Xeons; many AMD/consumer CPUs do not have it |
requireAVX(t) and are skipped if the CPU does not support AVX.requireAVX2(t) and are skipped if the CPU does not support AVX2 (no SIGILL).requireAVX512(t) and skip when AVX-512 is not available.So on a machine without AVX2, AVX2 tests will show as skipped instead of crashing.
If your environment does not support AVX2/AVX-512, you can still run the AVX (128-bit) tests:
GOEXPERIMENT=simd go test -run AVX ./...