about summary refs log tree commit diff
path: root/sysdeps/x86/include/cpu-features.h
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2023-09-20 15:44:50 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2023-09-29 14:18:42 -0500
commitd90b43a4ed475dac5b0cd6e01ceb35c7b0f7f2ff (patch)
tree0015cc47ecb9affe00f1d8afbebf4a5c16d20e25 /sysdeps/x86/include/cpu-features.h
parent5f913506f4bf4785f9cf2c2ac8d17dc9f877ff17 (diff)
downloadglibc-d90b43a4ed475dac5b0cd6e01ceb35c7b0f7f2ff.tar.gz
glibc-d90b43a4ed475dac5b0cd6e01ceb35c7b0f7f2ff.tar.xz
glibc-d90b43a4ed475dac5b0cd6e01ceb35c7b0f7f2ff.zip
x86: Add support for AVX10 preset and vec size in cpu-features
This commit add support for the new AVX10 cpu features:
https://cdrdv2-public.intel.com/784267/355989-intel-avx10-spec.pdf

We add checks for:
    - `AVX10`: Check if AVX10 is present.
    - `AVX10_{X,Y,Z}MM`: Check if a given vec class has AVX10 support.

`make check` passes and cpuid output was checked against GNR/DMR on an
emulator.
Diffstat (limited to 'sysdeps/x86/include/cpu-features.h')
-rw-r--r--sysdeps/x86/include/cpu-features.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/sysdeps/x86/include/cpu-features.h b/sysdeps/x86/include/cpu-features.h
index eb30d342a6..2d7427a6c0 100644
--- a/sysdeps/x86/include/cpu-features.h
+++ b/sysdeps/x86/include/cpu-features.h
@@ -29,7 +29,7 @@
 
 enum
 {
-  CPUID_INDEX_MAX = CPUID_INDEX_14_ECX_0 + 1
+  CPUID_INDEX_MAX = CPUID_INDEX_24_ECX_0 + 1
 };
 
 enum
@@ -319,6 +319,7 @@ enum
 #define bit_cpu_AVX_NE_CONVERT	(1u << 5)
 #define bit_cpu_AMX_COMPLEX	(1u << 8)
 #define bit_cpu_PREFETCHI	(1u << 14)
+#define bit_cpu_AVX10		(1u << 19)
 #define bit_cpu_APX_F		(1u << 21)
 
 /* CPUID_INDEX_19.  */
@@ -332,6 +333,13 @@ enum
 /* EBX.  */
 #define bit_cpu_PTWRITE		(1u << 4)
 
+/* CPUID_INDEX_24_ECX_0.  */
+
+/* EBX.  */
+#define bit_cpu_AVX10_XMM		(1u << 16)
+#define bit_cpu_AVX10_YMM		(1u << 17)
+#define bit_cpu_AVX10_ZMM		(1u << 18)
+
 /* CPUID_INDEX_1.  */
 
 /* ECX.  */
@@ -563,6 +571,7 @@ enum
 #define index_cpu_AVX_NE_CONVERT CPUID_INDEX_7_ECX_1
 #define index_cpu_AMX_COMPLEX	CPUID_INDEX_7_ECX_1
 #define index_cpu_PREFETCHI	CPUID_INDEX_7_ECX_1
+#define index_cpu_AVX10		CPUID_INDEX_7_ECX_1
 #define index_cpu_APX_F		CPUID_INDEX_7_ECX_1
 
 /* CPUID_INDEX_19.  */
@@ -576,6 +585,13 @@ enum
 /* EBX.  */
 #define index_cpu_PTWRITE	CPUID_INDEX_14_ECX_0
 
+/* CPUID_INDEX_24_ECX_0.  */
+
+/* EBX.  */
+#define index_cpu_AVX10_XMM	CPUID_INDEX_24_ECX_0
+#define index_cpu_AVX10_YMM	CPUID_INDEX_24_ECX_0
+#define index_cpu_AVX10_ZMM	CPUID_INDEX_24_ECX_0
+
 /* CPUID_INDEX_1.  */
 
 /* ECX.  */
@@ -809,6 +825,7 @@ enum
 #define reg_AVX_NE_CONVERT	edx
 #define reg_AMX_COMPLEX		edx
 #define reg_PREFETCHI		edx
+#define reg_AVX10		edx
 #define reg_APX_F		edx
 
 /* CPUID_INDEX_19.  */
@@ -822,6 +839,14 @@ enum
 /* EBX.  */
 #define reg_PTWRITE		ebx
 
+/* CPUID_INDEX_24_ECX_0.  */
+
+/* EBX.  */
+#define reg_AVX10_XMM		ebx
+#define reg_AVX10_YMM		ebx
+#define reg_AVX10_ZMM		ebx
+
+
 /* PREFERRED_FEATURE_INDEX_1.  First define the bitindex values
    sequentially, then define the bit_arch* and index_arch_* lookup
    constants.  */