[PATCH] additional bit values for cpuid.h
Jonathan Gray
jsg at jsg.id.au
Sun Aug 31 08:35:41 PDT 2014
The attached patch adds some additional Intel cpuid values and adds
aliases for some defines used by the equivalent gcc header.
The bit_SSE4_1 and bit_SSE4_2 aliases in particular would be
useful for Mesa and xf86-video-intel which currently define
their own values due to the mismatch between clang and gcc.
-------------- next part --------------
Index: lib/Headers/cpuid.h
===================================================================
--- lib/Headers/cpuid.h (revision 216841)
+++ lib/Headers/cpuid.h (working copy)
@@ -28,6 +28,7 @@
/* Features in %ecx for level 1 */
#define bit_SSE3 0x00000001
#define bit_PCLMULQDQ 0x00000002
+#define bit_PCLMUL bit_PCLMULQDQ /* for gcc compat */
#define bit_DTES64 0x00000004
#define bit_MONITOR 0x00000008
#define bit_DSCPL 0x00000010
@@ -44,15 +45,19 @@
#define bit_PCID 0x00020000
#define bit_DCA 0x00040000
#define bit_SSE41 0x00080000
+#define bit_SSE4_1 bit_SSE41 /* for gcc compat */
#define bit_SSE42 0x00100000
+#define bit_SSE4_2 bit_SSE42 /* for gcc compat */
#define bit_x2APIC 0x00200000
#define bit_MOVBE 0x00400000
#define bit_POPCNT 0x00800000
#define bit_TSCDeadline 0x01000000
#define bit_AESNI 0x02000000
+#define bit_AES bit_AESNI /* for gcc compat */
#define bit_XSAVE 0x04000000
#define bit_OSXSAVE 0x08000000
#define bit_AVX 0x10000000
+#define bit_F16C 0x20000000
#define bit_RDRAND 0x40000000
/* Features in %edx for level 1 */
@@ -65,6 +70,7 @@
#define bit_PAE 0x00000040
#define bit_MCE 0x00000080
#define bit_CX8 0x00000100
+#define bit_CMPXCHG8B bit_CX8 /* for gcc compat */
#define bit_APIC 0x00000200
#define bit_SEP 0x00000800
#define bit_MTRR 0x00001000
@@ -89,8 +95,17 @@
/* Features in %ebx for level 7 sub-leaf 0 */
#define bit_FSGSBASE 0x00000001
+#define bit_BMI 0x00000008
+#define bit_HLE 0x00000010
+#define bit_AVX2 0x00000020
#define bit_SMEP 0x00000080
+#define bit_BMI2 0x00000100
#define bit_ENH_MOVSB 0x00000200
+#define bit_INVPCID 0x00000400
+#define bit_RTM 0x00000800
+#define bit_RDSEED 0x00040000
+#define bit_ADX 0x00080000
+#define bit_SMAP 0x00100000
/* PIC on i386 uses %ebx, so preserve it. */
#if __i386__
More information about the cfe-commits
mailing list