All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Xiaoyao Li <xiaoyao.li@intel.com>
Subject: [PULL 11/13] target/i386: add FZRM, FSRS, FSRC
Date: Mon, 27 Feb 2023 18:55:22 +0100	[thread overview]
Message-ID: <20230227175524.710880-12-pbonzini@redhat.com> (raw)
In-Reply-To: <20230227175524.710880-1-pbonzini@redhat.com>

These are three more markers for string operation optimizations.
They can all be added to TCG, whose string operations are more or
less as fast as they can be for short lengths.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 7 ++++---
 target/i386/cpu.h | 7 +++++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 34e2cead870e..26ec6e9da754 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -662,7 +662,8 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
           /* CPUID_7_0_ECX_OSPKE is dynamic */ \
           CPUID_7_0_ECX_LA57 | CPUID_7_0_ECX_PKS | CPUID_7_0_ECX_VAES)
 #define TCG_7_0_EDX_FEATURES CPUID_7_0_EDX_FSRM
-#define TCG_7_1_EAX_FEATURES 0
+#define TCG_7_1_EAX_FEATURES (CPUID_7_1_EAX_FZRM | CPUID_7_1_EAX_FSRS | \
+          CPUID_7_1_EAX_FSRC)
 #define TCG_APM_FEATURES 0
 #define TCG_6_EAX_FEATURES CPUID_6_EAX_ARAT
 #define TCG_XSAVE_FEATURES (CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XGETBV1)
@@ -872,8 +873,8 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
         .feat_names = {
             NULL, NULL, NULL, NULL,
             "avx-vnni", "avx512-bf16", NULL, NULL,
-            NULL, NULL, NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "fzrm", "fsrs",
+            "fsrc", NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index d4bc19577a21..e0703feb5ed0 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -900,6 +900,13 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
 #define CPUID_7_1_EAX_AVX_VNNI          (1U << 4)
 /* AVX512 BFloat16 Instruction */
 #define CPUID_7_1_EAX_AVX512_BF16       (1U << 5)
+/* Fast Zero REP MOVS */
+#define CPUID_7_1_EAX_FZRM              (1U << 10)
+/* Fast Short REP STOS */
+#define CPUID_7_1_EAX_FSRS              (1U << 11)
+/* Fast Short REP CMPS/SCAS */
+#define CPUID_7_1_EAX_FSRC              (1U << 12)
+
 /* XFD Extend Feature Disabled */
 #define CPUID_D_1_EAX_XFD               (1U << 4)
 
-- 
2.39.1



  parent reply	other threads:[~2023-02-27 17:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
2023-02-27 17:55 ` [PULL 01/13] target/i386: Fix BZHI instruction Paolo Bonzini
2023-02-27 17:55 ` [PULL 02/13] meson: Avoid duplicates in generated config-poison.h again Paolo Bonzini
2023-02-27 17:55 ` [PULL 03/13] meson: stop looking for 'sphinx-build-3' Paolo Bonzini
2023-03-02 16:54   ` Peter Maydell
2023-02-27 17:55 ` [PULL 04/13] configure: protect against escaping venv when running Meson Paolo Bonzini
2023-02-27 17:55 ` [PULL 05/13] configure: Look for auxiliary Python installations Paolo Bonzini
2023-02-27 17:55 ` [PULL 06/13] lcitool: update submodule Paolo Bonzini
2023-02-27 17:55 ` [PULL 07/13] docs/devel: update and clarify lcitool instructions Paolo Bonzini
2023-02-27 17:55 ` [PULL 08/13] ci, docker: update CentOS and OpenSUSE Python to non-EOL versions Paolo Bonzini
2023-02-27 17:55 ` [PULL 09/13] MAINTAINERS: Cover RCU documentation Paolo Bonzini
2023-02-27 17:55 ` [PULL 10/13] target/i386: add FSRM to TCG Paolo Bonzini
2023-02-27 17:55 ` Paolo Bonzini [this message]
2023-02-27 17:55 ` [PULL 12/13] target/i386: KVM: allow fast string operations if host supports them Paolo Bonzini
2023-02-28 15:09 ` [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230227175524.710880-12-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiaoyao.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.