about summary refs log tree commit diff
path: root/sysdeps/x86/cpu-features.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2023-07-26 08:20:16 -0700
committerH.J. Lu <hjl.tools@gmail.com>2023-07-27 08:42:32 -0700
commit1547d6a64f4b981a06fd46ee446425a32558f2d0 (patch)
tree04c1d9b268be4d36880792b115c88ebe135dd6d9 /sysdeps/x86/cpu-features.c
parentc8c8dbbf279b0ebaed3e871f626ba7dde876d247 (diff)
downloadglibc-1547d6a64f4b981a06fd46ee446425a32558f2d0.tar.gz
glibc-1547d6a64f4b981a06fd46ee446425a32558f2d0.tar.xz
glibc-1547d6a64f4b981a06fd46ee446425a32558f2d0.zip
<sys/platform/x86.h>: Add APX support
Add support for Intel Advanced Performance Extensions:

https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html

to <sys/platform/x86.h>.
Diffstat (limited to 'sysdeps/x86/cpu-features.c')
-rw-r--r--sysdeps/x86/cpu-features.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 9ac195810f..badf088874 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -226,6 +226,10 @@ update_active (struct cpu_features *cpu_features)
 	  CPU_FEATURE_SET_ACTIVE (cpu_features, AMX_COMPLEX);
 	}
 
+      /* APX is usable only if the APX state is supported by kernel.  */
+      if ((xcrlow & bit_APX_state) != 0)
+	CPU_FEATURE_SET_ACTIVE (cpu_features, APX_F);
+
       /* These features are usable only when OSXSAVE is enabled.  */
       CPU_FEATURE_SET (cpu_features, XSAVE);
       CPU_FEATURE_SET_ACTIVE (cpu_features, XSAVEOPT);