public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] <sys/platform/x86.h>: Add AVX-NE-CONVERT support
@ 2023-04-05 22:45 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2023-04-05 22:45 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=609b7b2d3c0c44f4e42a235f8d7c207c903a6bb1

commit 609b7b2d3c0c44f4e42a235f8d7c207c903a6bb1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Apr 5 09:21:42 2023 -0700

    <sys/platform/x86.h>: Add AVX-NE-CONVERT support
    
    Add AVX-NE-CONVERT support to <sys/platform/x86.h>.
    Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>

Diff:
---
 manual/platform.texi               | 3 +++
 sysdeps/x86/bits/platform/x86.h    | 1 +
 sysdeps/x86/cpu-features.c         | 2 ++
 sysdeps/x86/include/cpu-features.h | 3 +++
 sysdeps/x86/tst-get-cpu-features.c | 2 ++
 5 files changed, 11 insertions(+)

diff --git a/manual/platform.texi b/manual/platform.texi
index 873ea0a84a..1e120993d7 100644
--- a/manual/platform.texi
+++ b/manual/platform.texi
@@ -222,6 +222,9 @@ Leaf (EAX = 23H).
 @item
 @code{AVX_IFMA} -- The AVX-IFMA instruction extensions.
 
+@item
+@code{AVX_NE_CONVERT} -- The AVX-NE-CONVERT instruction extensions.
+
 @item
 @code{AVX_VNNI} -- The AVX-VNNI instruction extensions.
 
diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/x86.h
index 7b239ef188..d8ba33bd42 100644
--- a/sysdeps/x86/bits/platform/x86.h
+++ b/sysdeps/x86/bits/platform/x86.h
@@ -309,6 +309,7 @@ enum
        + cpuid_register_index_edx * 8 * sizeof (unsigned int)),
 
   x86_cpu_AVX_VNNI_INT8		= x86_cpu_index_7_ecx_1_edx + 4,
+  x86_cpu_AVX_NE_CONVERT	= x86_cpu_index_7_ecx_1_edx + 5,
 
   x86_cpu_index_19_ebx
     = (CPUID_INDEX_19 * 8 * 4 * sizeof (unsigned int)
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index f34f4884eb..dfd1b85dce 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -141,6 +141,8 @@ update_active (struct cpu_features *cpu_features)
 		}
 	      /* Determine if AVX-IFMA is usable.  */
 	      CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_IFMA);
+	      /* Determine if AVX-NE-CONVERT is usable.  */
+	      CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_NE_CONVERT);
 	      /* Determine if AVX-VNNI is usable.  */
 	      CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_VNNI);
 	      /* Determine if AVX-VNNI-INT8 is usable.  */
diff --git a/sysdeps/x86/include/cpu-features.h b/sysdeps/x86/include/cpu-features.h
index 5e09c58d9c..673cf8ca92 100644
--- a/sysdeps/x86/include/cpu-features.h
+++ b/sysdeps/x86/include/cpu-features.h
@@ -316,6 +316,7 @@ enum
 
 /* EDX.  */
 #define bit_cpu_AVX_VNNI_INT8	(1u << 4)
+#define bit_cpu_AVX_NE_CONVERT	(1u << 5)
 
 /* CPUID_INDEX_19.  */
 
@@ -556,6 +557,7 @@ enum
 #define index_cpu_AVX_IFMA	CPUID_INDEX_7_ECX_1
 #define index_cpu_LAM		CPUID_INDEX_7_ECX_1
 #define index_cpu_AVX_VNNI_INT8	CPUID_INDEX_7_ECX_1
+#define index_cpu_AVX_NE_CONVERT CPUID_INDEX_7_ECX_1
 
 /* CPUID_INDEX_19.  */
 
@@ -798,6 +800,7 @@ enum
 
 /* EDX.  */
 #define reg_AVX_VNNI_INT8	edx
+#define reg_AVX_NE_CONVERT	edx
 
 /* CPUID_INDEX_19.  */
 
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
index f0585cf330..bb1b67fd1c 100644
--- a/sysdeps/x86/tst-get-cpu-features.c
+++ b/sysdeps/x86/tst-get-cpu-features.c
@@ -216,6 +216,7 @@ do_test (void)
   CHECK_CPU_FEATURE_PRESENT (LAM);
   CHECK_CPU_FEATURE_PRESENT (MSRLIST);
   CHECK_CPU_FEATURE_PRESENT (AVX_VNNI_INT8);
+  CHECK_CPU_FEATURE_PRESENT (AVX_NE_CONVERT);
   CHECK_CPU_FEATURE_PRESENT (AESKLE);
   CHECK_CPU_FEATURE_PRESENT (WIDE_KL);
   CHECK_CPU_FEATURE_PRESENT (PTWRITE);
@@ -384,6 +385,7 @@ do_test (void)
   CHECK_CPU_FEATURE_ACTIVE (AMX_FP16);
   CHECK_CPU_FEATURE_ACTIVE (AVX_IFMA);
   CHECK_CPU_FEATURE_ACTIVE (AVX_VNNI_INT8);
+  CHECK_CPU_FEATURE_ACTIVE (AVX_NE_CONVERT);
   CHECK_CPU_FEATURE_ACTIVE (AESKLE);
   CHECK_CPU_FEATURE_ACTIVE (WIDE_KL);
   CHECK_CPU_FEATURE_ACTIVE (PTWRITE);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-05 22:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-05 22:45 [glibc] <sys/platform/x86.h>: Add AVX-NE-CONVERT support H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).