[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/45] host/i386: assume presence of POPCNT
From: |
Paolo Bonzini |
Subject: |
[PULL 07/45] host/i386: assume presence of POPCNT |
Date: |
Tue, 4 Jun 2024 08:43:31 +0200 |
QEMU now requires an x86-64-v2 host, which has the POPCNT instruction.
Use it freely in TCG-generated code.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
host/include/i386/host/cpuinfo.h | 1 -
tcg/i386/tcg-target.h | 5 ++---
util/cpuinfo-i386.c | 1 -
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/cpuinfo.h
index 72f6fad61e5..c1e94d75ce1 100644
--- a/host/include/i386/host/cpuinfo.h
+++ b/host/include/i386/host/cpuinfo.h
@@ -11,7 +11,6 @@
#define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */
#define CPUINFO_MOVBE (1u << 2)
#define CPUINFO_LZCNT (1u << 3)
-#define CPUINFO_POPCNT (1u << 4)
#define CPUINFO_BMI1 (1u << 5)
#define CPUINFO_BMI2 (1u << 6)
#define CPUINFO_AVX1 (1u << 9)
diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 2f67a97e059..ecc69827287 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -111,7 +111,6 @@ typedef enum {
#endif
#define have_bmi1 (cpuinfo & CPUINFO_BMI1)
-#define have_popcnt (cpuinfo & CPUINFO_POPCNT)
#define have_avx1 (cpuinfo & CPUINFO_AVX1)
#define have_avx2 (cpuinfo & CPUINFO_AVX2)
#define have_movbe (cpuinfo & CPUINFO_MOVBE)
@@ -143,7 +142,7 @@ typedef enum {
#define TCG_TARGET_HAS_nor_i32 0
#define TCG_TARGET_HAS_clz_i32 1
#define TCG_TARGET_HAS_ctz_i32 1
-#define TCG_TARGET_HAS_ctpop_i32 have_popcnt
+#define TCG_TARGET_HAS_ctpop_i32 1
#define TCG_TARGET_HAS_deposit_i32 1
#define TCG_TARGET_HAS_extract_i32 1
#define TCG_TARGET_HAS_sextract_i32 1
@@ -178,7 +177,7 @@ typedef enum {
#define TCG_TARGET_HAS_nor_i64 0
#define TCG_TARGET_HAS_clz_i64 1
#define TCG_TARGET_HAS_ctz_i64 1
-#define TCG_TARGET_HAS_ctpop_i64 have_popcnt
+#define TCG_TARGET_HAS_ctpop_i64 1
#define TCG_TARGET_HAS_deposit_i64 1
#define TCG_TARGET_HAS_extract_i64 1
#define TCG_TARGET_HAS_sextract_i64 0
diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c
index 6d474a6259a..8f2694d88f2 100644
--- a/util/cpuinfo-i386.c
+++ b/util/cpuinfo-i386.c
@@ -35,7 +35,6 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
__cpuid(1, a, b, c, d);
info |= (c & bit_MOVBE ? CPUINFO_MOVBE : 0);
- info |= (c & bit_POPCNT ? CPUINFO_POPCNT : 0);
info |= (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0);
/* NOTE: our AES support requires SSSE3 (PSHUFB) as well. */
--
2.45.1
- [PULL 00/45] mostly i386 patches for 2024-06-04, Paolo Bonzini, 2024/06/04
- [PULL 02/45] host/i386: nothing looks at CPUINFO_SSE4, Paolo Bonzini, 2024/06/04
- [PULL 01/45] virtio-blk: remove SCSI passthrough functionality, Paolo Bonzini, 2024/06/04
- [PULL 03/45] meson: assume x86-64-v2 baseline ISA, Paolo Bonzini, 2024/06/04
- [PULL 05/45] host/i386: assume presence of SSE2, Paolo Bonzini, 2024/06/04
- [PULL 04/45] host/i386: assume presence of CMOV, Paolo Bonzini, 2024/06/04
- [PULL 06/45] host/i386: assume presence of SSSE3, Paolo Bonzini, 2024/06/04
- [PULL 08/45] target/i386: fix SSE and SSE2 feature check, Paolo Bonzini, 2024/06/04
- [PULL 07/45] host/i386: assume presence of POPCNT,
Paolo Bonzini <=
- [PULL 09/45] target/i386: fix memory opsize for Mov to/from Seg, Paolo Bonzini, 2024/06/04
- [PULL 10/45] target/i386/tcg: Fix RDPID feature check, Paolo Bonzini, 2024/06/04
- [PULL 12/45] update-linux-headers: fix forwarding to asm-generic headers, Paolo Bonzini, 2024/06/04
- [PULL 11/45] target/i386: fix xsave.flat from kvm-unit-tests, Paolo Bonzini, 2024/06/04
- [PULL 13/45] update-linux-headers: move pvpanic.h to correct directory, Paolo Bonzini, 2024/06/04
- [PULL 14/45] linux-headers: Update to current kvm/next, Paolo Bonzini, 2024/06/04
- [PULL 15/45] update-linux-headers: import linux/kvm_para.h header, Paolo Bonzini, 2024/06/04
- [PULL 16/45] machine: allow early use of machine_require_guest_memfd, Paolo Bonzini, 2024/06/04
- [PULL 17/45] i386/sev: Replace error_report with error_setg, Paolo Bonzini, 2024/06/04
- [PULL 18/45] i386/sev: Introduce "sev-common" type to encapsulate common SEV state, Paolo Bonzini, 2024/06/04