From 9620398097de3981c1adf5233e2b3478d36bc1b3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 29 Jun 2020 18:30:54 -0700 Subject: x86: Install [BZ #26124] Install so that programmers can do #if __has_include() #include #endif ... if (CPU_FEATURE_USABLE (SSE2)) ... if (CPU_FEATURE_USABLE (AVX2)) ... exports only: enum { COMMON_CPUID_INDEX_1 = 0, COMMON_CPUID_INDEX_7, COMMON_CPUID_INDEX_80000001, COMMON_CPUID_INDEX_D_ECX_1, COMMON_CPUID_INDEX_80000007, COMMON_CPUID_INDEX_80000008, COMMON_CPUID_INDEX_7_ECX_1, /* Keep the following line at the end. */ COMMON_CPUID_INDEX_MAX }; struct cpuid_features { struct cpuid_registers cpuid; struct cpuid_registers usable; }; struct cpu_features { struct cpu_features_basic basic; struct cpuid_features features[COMMON_CPUID_INDEX_MAX]; }; /* Get a pointer to the CPU features structure. */ extern const struct cpu_features *__x86_get_cpu_features (unsigned int max) __attribute__ ((const)); Since all feature checks are done through macros, programs compiled with a newer are compatible with the older glibc binaries as long as the layout of struct cpu_features is identical. The features array can be expanded with backward binary compatibility for both .o and .so files. When COMMON_CPUID_INDEX_MAX is increased to support new processor features, __x86_get_cpu_features in the older glibc binaries returns NULL and HAS_CPU_FEATURE/CPU_FEATURE_USABLE return false on the new processor feature. No new symbol version is neeeded. Both CPU_FEATURE_USABLE and HAS_CPU_FEATURE are provided. HAS_CPU_FEATURE can be used to identify processor features. Note: Although GCC has __builtin_cpu_supports, it only supports a subset of and it is equivalent to CPU_FEATURE_USABLE. It doesn't support HAS_CPU_FEATURE. --- sysdeps/i386/i686/multiarch/Makefile | 4 ---- sysdeps/i386/i686/multiarch/test-multiarch.c | 1 - 2 files changed, 5 deletions(-) delete mode 100644 sysdeps/i386/i686/multiarch/test-multiarch.c (limited to 'sysdeps/i386') diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile index bf75a9947f..c4897922d7 100644 --- a/sysdeps/i386/i686/multiarch/Makefile +++ b/sysdeps/i386/i686/multiarch/Makefile @@ -1,7 +1,3 @@ -ifeq ($(subdir),csu) -tests += test-multiarch -endif - ifeq ($(subdir),string) gen-as-const-headers += locale-defines.sym sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \ diff --git a/sysdeps/i386/i686/multiarch/test-multiarch.c b/sysdeps/i386/i686/multiarch/test-multiarch.c deleted file mode 100644 index 593cfec273..0000000000 --- a/sysdeps/i386/i686/multiarch/test-multiarch.c +++ /dev/null @@ -1 +0,0 @@ -#include -- cgit v1.2.1