Skip to content

Commit cdbd10c

Browse files
committed
Introduce X86_CHECK() macro
1 parent afbef6c commit cdbd10c

File tree

4 files changed

+287
-226
lines changed

4 files changed

+287
-226
lines changed

libc/nexgen32e/x86compiler.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#ifndef COSMOPOLITAN_LIBC_NEXGEN32E_X86COMPILER_H_
22
#define COSMOPOLITAN_LIBC_NEXGEN32E_X86COMPILER_H_
3+
#ifdef __x86_64__
34

45
/**
56
* @fileoverview x86 cpu feature compile-time requirement detection.
@@ -24,6 +25,42 @@
2425
#define _X86_CC_AVX2 0
2526
#endif
2627

28+
#ifdef __AVXVNNI__
29+
#define _X86_CC_AVXVNNI 1
30+
#else
31+
#define _X86_CC_AVXVNNI 0
32+
#endif
33+
34+
#ifdef __AVX512F__
35+
#define _X86_CC_AVX512F 1
36+
#else
37+
#define _X86_CC_AVX512F 0
38+
#endif
39+
40+
#ifdef __AVX512BF16__
41+
#define _X86_CC_AVX512BF16 1
42+
#else
43+
#define _X86_CC_AVX512BF16 0
44+
#endif
45+
46+
#ifdef __AVX512VBMI__
47+
#define _X86_CC_AVX512VBMI 1
48+
#else
49+
#define _X86_CC_AVX512VBMI 0
50+
#endif
51+
52+
#ifdef __AVX512VNNI__
53+
#define _X86_CC_AVX512VNNI 1
54+
#else
55+
#define _X86_CC_AVX512VNNI 0
56+
#endif
57+
58+
#ifdef __AVX5124VNNIW__
59+
#define _X86_CC_AVX5124VNNIW 1
60+
#else
61+
#define _X86_CC_AVX5124VNNIW 0
62+
#endif
63+
2764
#ifdef __ABM__
2865
#define _X86_CC_ABM 1
2966
#else
@@ -138,4 +175,5 @@
138175
#define _X86_CC_RDPID 0
139176
#endif
140177

178+
#endif /* __x86_64__ */
141179
#endif /* COSMOPOLITAN_LIBC_NEXGEN32E_X86COMPILER_H_ */

0 commit comments

Comments
 (0)