[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/5] Revert "host/i386: assume presence of SSE2"
From: |
Alexander Monakov |
Subject: |
[PATCH 3/5] Revert "host/i386: assume presence of SSE2" |
Date: |
Wed, 12 Jun 2024 13:55:23 +0300 |
This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c.
Revert in preparation to rolling back x86_64-v2 ISA requirement.
Signed-off-by: Alexander Monakov <amonakov@ispras.ru>
---
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 72f6fad6..81771733 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 11c080e0..74864f7b 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;
}
#elif defined(__aarch64__) && defined(__ARM_NEON)
diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c
index ca74ef04..90f92a42 100644
--- a/util/cpuinfo-i386.c
+++ b/util/cpuinfo-i386.c
@@ -34,6 +34,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
if (max >= 1) {
__cpuid(1, a, b, c, d);
+ info |= (d & bit_SSE2 ? CPUINFO_SSE2 : 0);
info |= (c & bit_MOVBE ? CPUINFO_MOVBE : 0);
info |= (c & bit_POPCNT ? CPUINFO_POPCNT : 0);
info |= (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0);
--
2.32.0
- [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Alexander Monakov, 2024/06/12
- [PATCH 4/5] Revert "host/i386: assume presence of CMOV", Alexander Monakov, 2024/06/12
- [PATCH 2/5] Revert "host/i386: assume presence of SSSE3", Alexander Monakov, 2024/06/12
- [PATCH 3/5] Revert "host/i386: assume presence of SSE2",
Alexander Monakov <=
- [PATCH 5/5] Revert "meson: assume x86-64-v2 baseline ISA", Alexander Monakov, 2024/06/12
- [PATCH 1/5] Revert "host/i386: assume presence of POPCNT", Alexander Monakov, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Daniel P . Berrangé, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Paolo Bonzini, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Alexander Monakov, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Paolo Bonzini, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Alexander Monakov, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Paolo Bonzini, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Alexander Monakov, 2024/06/12
- Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts, Paolo Bonzini, 2024/06/12