Introduce X86_CHECK() macro

This commit is contained in:
Justine Tunney 2023-11-10 15:41:55 -08:00
parent afbef6c361
commit cdbd10c9d0
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 287 additions and 226 deletions

View file

@ -1,5 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_NEXGEN32E_X86COMPILER_H_
#define COSMOPOLITAN_LIBC_NEXGEN32E_X86COMPILER_H_
#ifdef __x86_64__
/**
* @fileoverview x86 cpu feature compile-time requirement detection.
@ -24,6 +25,42 @@
#define _X86_CC_AVX2 0
#endif
#ifdef __AVXVNNI__
#define _X86_CC_AVXVNNI 1
#else
#define _X86_CC_AVXVNNI 0
#endif
#ifdef __AVX512F__
#define _X86_CC_AVX512F 1
#else
#define _X86_CC_AVX512F 0
#endif
#ifdef __AVX512BF16__
#define _X86_CC_AVX512BF16 1
#else
#define _X86_CC_AVX512BF16 0
#endif
#ifdef __AVX512VBMI__
#define _X86_CC_AVX512VBMI 1
#else
#define _X86_CC_AVX512VBMI 0
#endif
#ifdef __AVX512VNNI__
#define _X86_CC_AVX512VNNI 1
#else
#define _X86_CC_AVX512VNNI 0
#endif
#ifdef __AVX5124VNNIW__
#define _X86_CC_AVX5124VNNIW 1
#else
#define _X86_CC_AVX5124VNNIW 0
#endif
#ifdef __ABM__
#define _X86_CC_ABM 1
#else
@ -138,4 +175,5 @@
#define _X86_CC_RDPID 0
#endif
#endif /* __x86_64__ */
#endif /* COSMOPOLITAN_LIBC_NEXGEN32E_X86COMPILER_H_ */