Skip to contentSkip to conversation

x86: add AVX512_VPOPCNTDQ features

PATCH Superseded He Chen 3 participants 4 messages Jan 10, 2017 – Jan 12, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

He Chen

author
#0 lore raw

PATCH 1/1 x86: add AVX512_VPOPCNTDQ features

AVX512_VPOPCNTDQ: Vector POPCNT instructions for word and qwords. variable precision.

---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
target/i386/cpu.c +1 -1
index b0640f1..ae900b5 100644
@@ -435,7 +435,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             NULL, "avx512vbmi", "umip", "pku",
             "ospke", NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "vpopcntdq", NULL,
             "la57", NULL, NULL, NULL,
             NULL, NULL, "rdpid", NULL,
             NULL, NULL, NULL, NULL,
target/i386/cpu.h +1 -0
index a7f2f60..73edc60 100644
@@ -630,6 +630,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_ECX_UMIP     (1U << 2)
 #define CPUID_7_0_ECX_PKU      (1U << 3)
 #define CPUID_7_0_ECX_OSPKE    (1U << 4)
+#define CPUID_7_0_ECX_VPOPCNTDQ (1U << 14) /* POPCNT for vectors of DW/QW */
 #define CPUID_7_0_ECX_LA57     (1U << 16)
 #define CPUID_7_0_ECX_RDPID    (1U << 22)
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 14 lines · He Chen

AVX512_VPOPCNTDQ: Vector POPCNT instructions for word and qwords. variable precision.

---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
target/i386/cpu.c +0 -0
index b0640f1..ae900b5 100644

target/i386/cpu.c static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { · line 438

Quoted 5 lines
target/i386/cpu.c +1 -1
@@ -435,7 +435,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             NULL, "avx512vbmi", "umip", "pku",
             "ospke", NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "vpopcntdq", NULL,

The patches I see on linux-kernel use the "avx512_vpopcntdq" name. Why not use "avx512-vpopcntdq" in QEMU to avoid confusion?

Quoted 19 lines
target/i386/cpu.c +0 -0
             "la57", NULL, NULL, NULL,
             NULL, NULL, "rdpid", NULL,
             NULL, NULL, NULL, NULL,
target/i386/cpu.h +1 -0
index a7f2f60..73edc60 100644
@@ -630,6 +630,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_ECX_UMIP     (1U << 2)
 #define CPUID_7_0_ECX_PKU      (1U << 3)
 #define CPUID_7_0_ECX_OSPKE    (1U << 4)
+#define CPUID_7_0_ECX_VPOPCNTDQ (1U << 14) /* POPCNT for vectors of DW/QW */
 #define CPUID_7_0_ECX_LA57     (1U << 16)
 #define CPUID_7_0_ECX_RDPID    (1U << 22)
 
Signature · 1 line
2.7.4
Signature · 1 line
Eduardo
#2 lore raw
Quoted 10 lines · Eduardo Habkost
Quoted 9 lines · He Chen

AVX512_VPOPCNTDQ: Vector POPCNT instructions for word and qwords. variable precision.

---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Quoted 13 lines

target/i386/cpu.c static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { · line 438

Quoted 10 lines
target/i386/cpu.c +1 -1
index b0640f1..ae900b5 100644
@@ -435,7 +435,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             NULL, "avx512vbmi", "umip", "pku",
             "ospke", NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "vpopcntdq", NULL,

The patches I see on linux-kernel use the "avx512_vpopcntdq" name. Why not use "avx512-vpopcntdq" in QEMU to avoid confusion?

Or without the dash too, for consistency with avx512vbmi.

Paolo

Quoted 21 lines
Quoted 20 lines
target/i386/cpu.c +0 -0
             "la57", NULL, NULL, NULL,
             NULL, NULL, "rdpid", NULL,
             NULL, NULL, NULL, NULL,
target/i386/cpu.h +1 -0
index a7f2f60..73edc60 100644
@@ -630,6 +630,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_ECX_UMIP     (1U << 2)
 #define CPUID_7_0_ECX_PKU      (1U << 3)
 #define CPUID_7_0_ECX_OSPKE    (1U << 4)
+#define CPUID_7_0_ECX_VPOPCNTDQ (1U << 14) /* POPCNT for vectors of DW/QW */
 #define CPUID_7_0_ECX_LA57     (1U << 16)
 #define CPUID_7_0_ECX_RDPID    (1U << 22)
 
Signature · 1 line
2.7.4
#3 lore raw
Quoted 25 lines · Paolo Bonzini
Quoted 10 lines · Eduardo Habkost
Quoted 9 lines · He Chen

AVX512_VPOPCNTDQ: Vector POPCNT instructions for word and qwords. variable precision.

---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Quoted 13 lines

target/i386/cpu.c static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { · line 438

Quoted 10 lines
target/i386/cpu.c +1 -1
index b0640f1..ae900b5 100644
@@ -435,7 +435,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
             NULL, "avx512vbmi", "umip", "pku",
             "ospke", NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "vpopcntdq", NULL,

The patches I see on linux-kernel use the "avx512_vpopcntdq" name. Why not use "avx512-vpopcntdq" in QEMU to avoid confusion?

Quoted 1 line

Or without the dash too, for consistency with avx512vbmi.

I would agree if Linux was consistent and used "avx512vpopcntdq" instead of "avx512_vpopcntdq". But if Linux choose to use "avx512_vpopcntdq", I would like to use a compatible name in QEMU.

Other software components are likely to use the same flag names as Linux. If we use a different name, they will need to manually translate the Linux names to QEMU names.

Signature · 1 line
Eduardo