qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 15/23] Revert "host/i386: assume presence of SSE2"


From: Richard Henderson
Subject: Re: [PULL 15/23] Revert "host/i386: assume presence of SSE2"
Date: Sat, 22 Jun 2024 09:55:26 -0700
User-agent: Mozilla Thunderbird

On 6/21/24 23:15, Paolo Bonzini wrote:
This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c.
The x86-64 instruction set can now be tuned down to x86-64 v1
or i386 Pentium Pro.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  host/include/i386/host/cpuinfo.h | 1 +
  util/bufferiszero.c              | 4 ++--
  util/cpuinfo-i386.c              | 1 +
  3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/cpuinfo.h
index 72f6fad61e5..81771733eaa 100644
--- a/host/include/i386/host/cpuinfo.h
+++ b/host/include/i386/host/cpuinfo.h
@@ -14,6 +14,7 @@
  #define CPUINFO_POPCNT          (1u << 4)
  #define CPUINFO_BMI1            (1u << 5)
  #define CPUINFO_BMI2            (1u << 6)
+#define CPUINFO_SSE2            (1u << 7)
  #define CPUINFO_AVX1            (1u << 9)
  #define CPUINFO_AVX2            (1u << 10)
  #define CPUINFO_AVX512F         (1u << 11)
diff --git a/util/bufferiszero.c b/util/bufferiszero.c
index 11c080e02cf..74864f7b782 100644
--- a/util/bufferiszero.c
+++ b/util/bufferiszero.c
@@ -188,14 +188,14 @@ static biz_accel_fn const accel_table[] = {
static unsigned best_accel(void)
  {
-#ifdef CONFIG_AVX2_OPT
      unsigned info = cpuinfo_init();
+#ifdef CONFIG_AVX2_OPT
      if (info & CPUINFO_AVX2) {
          return 2;
      }
  #endif
-    return 1;
+    return info & CPUINFO_SSE2 ? 1 : 0;
  }

Merge conflict with master here -- bufferiszero.c has been split.
This hunk now goes in host/include/i386/host/bufferiszero.c.inc.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]