public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] <sys/platform/x86.h>: Add FSRCS/FSRS/FZLRM support
@ 2020-10-09 19:37 H.J. Lu
0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2020-10-09 19:37 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=428985c436f442e91e27173bccaf28f547233586
commit 428985c436f442e91e27173bccaf28f547233586
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Oct 8 08:50:44 2020 -0700
<sys/platform/x86.h>: Add FSRCS/FSRS/FZLRM support
Add Fast Short REP CMP and SCA (FSRCS), Fast Short REP STO (FSRS) and
Fast Zero-Length REP MOV (FZLRM) support to <sys/platform/x86.h>.
Diff:
---
manual/platform.texi | 9 +++++++++
sysdeps/x86/cpu-features.c | 3 +++
sysdeps/x86/sys/platform/x86.h | 9 +++++++++
sysdeps/x86/tst-get-cpu-features.c | 6 ++++++
4 files changed, 27 insertions(+)
diff --git a/manual/platform.texi b/manual/platform.texi
index 1e44525552..8fec2933d6 100644
--- a/manual/platform.texi
+++ b/manual/platform.texi
@@ -331,12 +331,21 @@ extensions.
@item
@code{FSGSBASE} -- RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE instructions.
+@item
+@code{FSRCS} -- Fast Short REP CMP and SCA.
+
@item
@code{FSRM} -- Fast Short REP MOV.
+@item
+@code{FSRS} -- Fast Short REP STO.
+
@item
@code{FXSR} -- FXSAVE and FXRSTOR instructions.
+@item
+@code{FZLRM} -- Fast Zero-Length REP MOV.
+
@item
@code{GFNI} -- GFNI instruction extensions.
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index b0fac22c27..286ff96771 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -93,6 +93,9 @@ update_usable (struct cpu_features *cpu_features)
CPU_FEATURE_SET_USABLE (cpu_features, TBM);
CPU_FEATURE_SET_USABLE (cpu_features, RDTSCP);
CPU_FEATURE_SET_USABLE (cpu_features, WBNOINVD);
+ CPU_FEATURE_SET_USABLE (cpu_features, FZLRM);
+ CPU_FEATURE_SET_USABLE (cpu_features, FSRS);
+ CPU_FEATURE_SET_USABLE (cpu_features, FSRCS);
/* Can we call xgetbv? */
if (CPU_FEATURES_CPU_P (cpu_features, OSXSAVE))
diff --git a/sysdeps/x86/sys/platform/x86.h b/sysdeps/x86/sys/platform/x86.h
index 394f1c41a6..3ef92b04e8 100644
--- a/sysdeps/x86/sys/platform/x86.h
+++ b/sysdeps/x86/sys/platform/x86.h
@@ -313,6 +313,9 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
/* EAX. */
#define bit_cpu_AVX_VNNI (1u << 4)
#define bit_cpu_AVX512_BF16 (1u << 5)
+#define bit_cpu_FZLRM (1u << 10)
+#define bit_cpu_FSRS (1u << 11)
+#define bit_cpu_FSRCS (1u << 12)
#define bit_cpu_HRESET (1u << 22)
/* COMMON_CPUID_INDEX_19. */
@@ -534,6 +537,9 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
/* EAX. */
#define index_cpu_AVX_VNNI COMMON_CPUID_INDEX_7_ECX_1
#define index_cpu_AVX512_BF16 COMMON_CPUID_INDEX_7_ECX_1
+#define index_cpu_FZLRM COMMON_CPUID_INDEX_7_ECX_1
+#define index_cpu_FSRS COMMON_CPUID_INDEX_7_ECX_1
+#define index_cpu_FSRCS COMMON_CPUID_INDEX_7_ECX_1
#define index_cpu_HRESET COMMON_CPUID_INDEX_7_ECX_1
/* COMMON_CPUID_INDEX_19. */
@@ -755,6 +761,9 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
/* EAX. */
#define reg_AVX_VNNI eax
#define reg_AVX512_BF16 eax
+#define reg_FZLRM eax
+#define reg_FSRS eax
+#define reg_FSRCS eax
#define reg_HRESET eax
/* COMMON_CPUID_INDEX_19. */
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
index aacaa49045..667aa27117 100644
--- a/sysdeps/x86/tst-get-cpu-features.c
+++ b/sysdeps/x86/tst-get-cpu-features.c
@@ -223,6 +223,9 @@ do_test (void)
CHECK_CPU_FEATURE (WBNOINVD);
CHECK_CPU_FEATURE (AVX_VNNI);
CHECK_CPU_FEATURE (AVX512_BF16);
+ CHECK_CPU_FEATURE (FZLRM);
+ CHECK_CPU_FEATURE (FSRS);
+ CHECK_CPU_FEATURE (FSRCS);
CHECK_CPU_FEATURE (HRESET);
CHECK_CPU_FEATURE (AESKLE);
CHECK_CPU_FEATURE (WIDE_KL);
@@ -380,6 +383,9 @@ do_test (void)
CHECK_CPU_FEATURE_USABLE (WBNOINVD);
CHECK_CPU_FEATURE_USABLE (AVX_VNNI);
CHECK_CPU_FEATURE_USABLE (AVX512_BF16);
+ CHECK_CPU_FEATURE_USABLE (FZLRM);
+ CHECK_CPU_FEATURE_USABLE (FSRS);
+ CHECK_CPU_FEATURE_USABLE (FSRCS);
CHECK_CPU_FEATURE_USABLE (AESKLE);
CHECK_CPU_FEATURE_USABLE (WIDE_KL);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-09 19:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 19:37 [glibc] <sys/platform/x86.h>: Add FSRCS/FSRS/FZLRM support H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).