diff mbox series

[3/9] util: Add i386 CPUINFO_ATOMIC_VMOVDQU

Message ID 20230518044058.2777467-4-richard.henderson@linaro.org
State Superseded
Headers show
Series Host-specific includes, begin cpuinfo.h | expand

Commit Message

Richard Henderson May 18, 2023, 4:40 a.m. UTC
Add a bit to indicate when VMOVDQU is also atomic if aligned.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/host/i386/cpuinfo.h | 1 +
 util/cpuinfo-i386.c         | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Peter Maydell May 18, 2023, 3:52 p.m. UTC | #1
On Thu, 18 May 2023 at 05:41, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Add a bit to indicate when VMOVDQU is also atomic if aligned.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  include/host/i386/cpuinfo.h | 1 +
>  util/cpuinfo-i386.c         | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox series

Patch

diff --git a/include/host/i386/cpuinfo.h b/include/host/i386/cpuinfo.h
index e6f7461378..a6537123cf 100644
--- a/include/host/i386/cpuinfo.h
+++ b/include/host/i386/cpuinfo.h
@@ -25,6 +25,7 @@ 
 #define CPUINFO_AVX512DQ        (1u << 14)
 #define CPUINFO_AVX512VBMI2     (1u << 15)
 #define CPUINFO_ATOMIC_VMOVDQA  (1u << 16)
+#define CPUINFO_ATOMIC_VMOVDQU  (1u << 17)
 
 /* Initialized with a constructor. */
 extern unsigned cpuinfo;
diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c
index cb9475c688..b72374362f 100644
--- a/util/cpuinfo-i386.c
+++ b/util/cpuinfo-i386.c
@@ -77,8 +77,10 @@  unsigned __attribute__((constructor)) cpuinfo_init(void)
                  * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688
                  */
                 __cpuid(0, a, b, c, d);
-                if (c == signature_INTEL_ecx || c == signature_AMD_ecx) {
+                if (c == signature_INTEL_ecx) {
                     info |= CPUINFO_ATOMIC_VMOVDQA;
+                } else if (c == signature_AMD_ecx) {
+                    info |= CPUINFO_ATOMIC_VMOVDQA | CPUINFO_ATOMIC_VMOVDQU;
                 }
             }
         }