Support avx512f + vpclmulqdq crc32() acceleration

Cosmo's _Cz_crc32() function now goes 73 GiB/s on Threadripper. This
will significantly improve the performance of the PKZIP file format.
This algorithm is also used by apelink, to create deterministic ids.
This commit is contained in:
Justine Tunney 2024-05-29 10:13:37 -07:00
parent 7c8df05042
commit a05ce3ad9d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 385 additions and 8 deletions

View file

@ -16,7 +16,7 @@ COSMOPOLITAN_C_START_
#define x86_cpu_enable_sse2 X86_HAVE(SSE2)
#define x86_cpu_enable_ssse3 X86_HAVE(SSSE3)
#define x86_cpu_enable_simd (X86_HAVE(SSE4_2) && X86_HAVE(PCLMUL))
#define x86_cpu_enable_avx512 X86_HAVE(AVX512F)
#define x86_cpu_enable_avx512 (X86_HAVE(AVX512F) && X86_HAVE(PCLMUL) && X86_HAVE(VPCLMULQDQ))
#define cpu_check_features() ((void)0)
#elif defined(__aarch64__)