This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/x86/xgetbv created. glibc-2.24-75-gd440ef9
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 18 Aug 2016 18:15:17 -0000
- Subject: GNU C Library master sources branch hjl/x86/xgetbv created. glibc-2.24-75-gd440ef9
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/x86/xgetbv has been created
at d440ef968d25abb5c56f00e315f6ca7022da4dc3 (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d440ef968d25abb5c56f00e315f6ca7022da4dc3
commit d440ef968d25abb5c56f00e315f6ca7022da4dc3
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Aug 18 11:14:54 2016 -0700
Add bit_arch_XGETBV_ECX_1
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 9ce4b49..e9af03d 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -205,6 +205,17 @@ init_cpu_features (struct cpu_features *cpu_features)
if (CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
|= bit_arch_AVX_Fast_Unaligned_Load;
+
+ if (cpu_features->max_cpuid >= 0xd)
+ {
+ /* Check if XGETBV suports ECX = 1. */
+ unsigned int eax;
+
+ __cpuid_count (0xd, 1, eax, ebx, ecx, edx);
+ if ((eax & (1 << 2)) != 0)
+ cpu_features->feature[index_arch_XGETBV_ECX_1]
+ |= bit_arch_XGETBV_ECX_1;
+ }
}
/* This spells out "AuthenticAMD". */
else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index 97ffe76..a5c3257 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -37,6 +37,7 @@
#define bit_arch_Prefer_No_VZEROUPPER (1 << 17)
#define bit_arch_Fast_Unaligned_Copy (1 << 18)
#define bit_arch_Prefer_ERMS (1 << 19)
+#define bit_arch_XGETBV_ECX_1 (1 << 20)
/* CPUID Feature flags. */
@@ -107,6 +108,7 @@
# define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE
# define index_arch_Fast_Unaligned_Copy FEATURE_INDEX_1*FEATURE_SIZE
# define index_arch_Prefer_ERMS FEATURE_INDEX_1*FEATURE_SIZE
+# define index_arch_XGETBV_ECX_1 FEATURE_INDEX_1*FEATURE_SIZE
# if defined (_LIBC) && !IS_IN (nonlib)
@@ -277,6 +279,7 @@ extern const struct cpu_features *__get_cpu_features (void)
# define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1
# define index_arch_Fast_Unaligned_Copy FEATURE_INDEX_1
# define index_arch_Prefer_ERMS FEATURE_INDEX_1
+# define index_arch_XGETBV_ECX_1 FEATURE_INDEX_1
#endif /* !__ASSEMBLER__ */
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources