2023-05-15 08:51:29 +00:00
|
|
|
#ifndef COSMOPOLITAN_THIRD_PARTY_ZLIB_CPU_FEATURES_H_
|
|
|
|
#define COSMOPOLITAN_THIRD_PARTY_ZLIB_CPU_FEATURES_H_
|
|
|
|
#include "libc/nexgen32e/x86feature.h"
|
2023-08-18 16:34:14 +00:00
|
|
|
#include "third_party/zlib/zconf.h"
|
2023-05-15 08:51:29 +00:00
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
#ifdef __x86_64__
|
|
|
|
|
2023-08-18 16:34:14 +00:00
|
|
|
#ifdef Z_COSMO_PREFIX_SET
|
|
|
|
#undef x86_cpu_enable_sse2
|
|
|
|
#undef x86_cpu_enable_ssse3
|
|
|
|
#undef x86_cpu_enable_simd
|
|
|
|
#undef x86_cpu_enable_avx512
|
|
|
|
#undef cpu_check_features
|
|
|
|
#endif
|
|
|
|
|
2023-05-15 08:51:29 +00:00
|
|
|
#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))
|
2024-05-29 17:13:37 +00:00
|
|
|
#define x86_cpu_enable_avx512 (X86_HAVE(AVX512F) && X86_HAVE(PCLMUL) && X86_HAVE(VPCLMULQDQ))
|
2023-08-18 16:34:14 +00:00
|
|
|
#define cpu_check_features() ((void)0)
|
2023-05-15 08:51:29 +00:00
|
|
|
|
|
|
|
#elif defined(__aarch64__)
|
|
|
|
|
2023-07-24 15:31:54 +00:00
|
|
|
extern int arm_cpu_enable_crc32;
|
|
|
|
extern int arm_cpu_enable_pmull;
|
|
|
|
void cpu_check_features(void);
|
2023-05-15 08:51:29 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* COSMOPOLITAN_THIRD_PARTY_ZLIB_CPU_FEATURES_H_ */
|