|
|
b1dca6 |
commit 428985c436f442e91e27173bccaf28f547233586
|
|
|
b1dca6 |
Author: H.J. Lu <hjl.tools@gmail.com>
|
|
|
b1dca6 |
Date: Thu Oct 8 08:50:44 2020 -0700
|
|
|
b1dca6 |
|
|
|
b1dca6 |
<sys/platform/x86.h>: Add FSRCS/FSRS/FZLRM support
|
|
|
b1dca6 |
|
|
|
b1dca6 |
Add Fast Short REP CMP and SCA (FSRCS), Fast Short REP STO (FSRS) and
|
|
|
b1dca6 |
Fast Zero-Length REP MOV (FZLRM) support to <sys/platform/x86.h>.
|
|
|
b1dca6 |
|
|
|
b1dca6 |
diff --git a/manual/platform.texi b/manual/platform.texi
|
|
|
b1dca6 |
index 1e44525552f5bda5..8fec2933d6442823 100644
|
|
|
b1dca6 |
--- a/manual/platform.texi
|
|
|
b1dca6 |
+++ b/manual/platform.texi
|
|
|
b1dca6 |
@@ -331,12 +331,21 @@ extensions.
|
|
|
b1dca6 |
@item
|
|
|
b1dca6 |
@code{FSGSBASE} -- RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE instructions.
|
|
|
b1dca6 |
|
|
|
b1dca6 |
+@item
|
|
|
b1dca6 |
+@code{FSRCS} -- Fast Short REP CMP and SCA.
|
|
|
b1dca6 |
+
|
|
|
b1dca6 |
@item
|
|
|
b1dca6 |
@code{FSRM} -- Fast Short REP MOV.
|
|
|
b1dca6 |
|
|
|
b1dca6 |
+@item
|
|
|
b1dca6 |
+@code{FSRS} -- Fast Short REP STO.
|
|
|
b1dca6 |
+
|
|
|
b1dca6 |
@item
|
|
|
b1dca6 |
@code{FXSR} -- FXSAVE and FXRSTOR instructions.
|
|
|
b1dca6 |
|
|
|
b1dca6 |
+@item
|
|
|
b1dca6 |
+@code{FZLRM} -- Fast Zero-Length REP MOV.
|
|
|
b1dca6 |
+
|
|
|
b1dca6 |
@item
|
|
|
b1dca6 |
@code{GFNI} -- GFNI instruction extensions.
|
|
|
b1dca6 |
|
|
|
b1dca6 |
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
|
|
|
b1dca6 |
index 3e5b9341c9756009..5f0548fe08134236 100644
|
|
|
b1dca6 |
--- a/sysdeps/x86/cpu-features.c
|
|
|
b1dca6 |
+++ b/sysdeps/x86/cpu-features.c
|
|
|
b1dca6 |
@@ -93,6 +93,9 @@ update_usable (struct cpu_features *cpu_features)
|
|
|
b1dca6 |
CPU_FEATURE_SET_USABLE (cpu_features, TBM);
|
|
|
b1dca6 |
CPU_FEATURE_SET_USABLE (cpu_features, RDTSCP);
|
|
|
b1dca6 |
CPU_FEATURE_SET_USABLE (cpu_features, WBNOINVD);
|
|
|
b1dca6 |
+ CPU_FEATURE_SET_USABLE (cpu_features, FZLRM);
|
|
|
b1dca6 |
+ CPU_FEATURE_SET_USABLE (cpu_features, FSRS);
|
|
|
b1dca6 |
+ CPU_FEATURE_SET_USABLE (cpu_features, FSRCS);
|
|
|
b1dca6 |
|
|
|
b1dca6 |
/* Can we call xgetbv? */
|
|
|
b1dca6 |
if (CPU_FEATURES_CPU_P (cpu_features, OSXSAVE))
|
|
|
b1dca6 |
diff --git a/sysdeps/x86/sys/platform/x86.h b/sysdeps/x86/sys/platform/x86.h
|
|
|
b1dca6 |
index 357c6f1c5605d82d..e5cc7c683a20b5a0 100644
|
|
|
b1dca6 |
--- a/sysdeps/x86/sys/platform/x86.h
|
|
|
b1dca6 |
+++ b/sysdeps/x86/sys/platform/x86.h
|
|
|
b1dca6 |
@@ -313,6 +313,9 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
|
|
|
b1dca6 |
/* EAX. */
|
|
|
b1dca6 |
#define bit_cpu_AVX_VNNI (1u << 4)
|
|
|
b1dca6 |
#define bit_cpu_AVX512_BF16 (1u << 5)
|
|
|
b1dca6 |
+#define bit_cpu_FZLRM (1u << 10)
|
|
|
b1dca6 |
+#define bit_cpu_FSRS (1u << 11)
|
|
|
b1dca6 |
+#define bit_cpu_FSRCS (1u << 12)
|
|
|
b1dca6 |
#define bit_cpu_HRESET (1u << 22)
|
|
|
b1dca6 |
|
|
|
b1dca6 |
/* COMMON_CPUID_INDEX_19. */
|
|
|
b1dca6 |
@@ -534,6 +537,9 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
|
|
|
b1dca6 |
/* EAX. */
|
|
|
b1dca6 |
#define index_cpu_AVX_VNNI COMMON_CPUID_INDEX_7_ECX_1
|
|
|
b1dca6 |
#define index_cpu_AVX512_BF16 COMMON_CPUID_INDEX_7_ECX_1
|
|
|
b1dca6 |
+#define index_cpu_FZLRM COMMON_CPUID_INDEX_7_ECX_1
|
|
|
b1dca6 |
+#define index_cpu_FSRS COMMON_CPUID_INDEX_7_ECX_1
|
|
|
b1dca6 |
+#define index_cpu_FSRCS COMMON_CPUID_INDEX_7_ECX_1
|
|
|
b1dca6 |
#define index_cpu_HRESET COMMON_CPUID_INDEX_7_ECX_1
|
|
|
b1dca6 |
|
|
|
b1dca6 |
/* COMMON_CPUID_INDEX_19. */
|
|
|
b1dca6 |
@@ -755,6 +761,9 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
|
|
|
b1dca6 |
/* EAX. */
|
|
|
b1dca6 |
#define reg_AVX_VNNI eax
|
|
|
b1dca6 |
#define reg_AVX512_BF16 eax
|
|
|
b1dca6 |
+#define reg_FZLRM eax
|
|
|
b1dca6 |
+#define reg_FSRS eax
|
|
|
b1dca6 |
+#define reg_FSRCS eax
|
|
|
b1dca6 |
#define reg_HRESET eax
|
|
|
b1dca6 |
|
|
|
b1dca6 |
/* COMMON_CPUID_INDEX_19. */
|
|
|
b1dca6 |
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
|
|
|
b1dca6 |
index 1516af1d461a801b..2763deb6d008597f 100644
|
|
|
b1dca6 |
--- a/sysdeps/x86/tst-get-cpu-features.c
|
|
|
b1dca6 |
+++ b/sysdeps/x86/tst-get-cpu-features.c
|
|
|
b1dca6 |
@@ -221,6 +221,9 @@ do_test (void)
|
|
|
b1dca6 |
CHECK_CPU_FEATURE (WBNOINVD);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE (AVX_VNNI);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE (AVX512_BF16);
|
|
|
b1dca6 |
+ CHECK_CPU_FEATURE (FZLRM);
|
|
|
b1dca6 |
+ CHECK_CPU_FEATURE (FSRS);
|
|
|
b1dca6 |
+ CHECK_CPU_FEATURE (FSRCS);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE (HRESET);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE (AESKLE);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE (WIDE_KL);
|
|
|
b1dca6 |
@@ -378,6 +381,9 @@ do_test (void)
|
|
|
b1dca6 |
CHECK_CPU_FEATURE_USABLE (WBNOINVD);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE_USABLE (AVX_VNNI);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE_USABLE (AVX512_BF16);
|
|
|
b1dca6 |
+ CHECK_CPU_FEATURE_USABLE (FZLRM);
|
|
|
b1dca6 |
+ CHECK_CPU_FEATURE_USABLE (FSRS);
|
|
|
b1dca6 |
+ CHECK_CPU_FEATURE_USABLE (FSRCS);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE_USABLE (AESKLE);
|
|
|
b1dca6 |
CHECK_CPU_FEATURE_USABLE (WIDE_KL);
|
|
|
b1dca6 |
|