V4 [PATCH] x86: Add <sys/platform/x86.h>
Florian Weimer
fweimer@redhat.com
Thu Sep 20 11:41:00 GMT 2018
* H. J. Lu:
> Add <sys/platform/x86.h> to provide an API to access x86 specific platform
> features. It makes raw and derived CPUID information available to
> applications so that programmers can avoid complicated steps to retrieve
> the same information with CPUID instructions.
Sorry, I still think that this patch semantically depends on delayed
IFUNC processing.
Furthermore, I strongly prefer a simplified interface, like:
enum {
X86_FEATURE_MMX,
X86_FEATURE_SSE,
X86_FEATURE_SSE2,
…
X86_FEATURE_AVX512F,
…
};
_Bool x86_feature_usable (int index) __attribute__ ((pure));
Applications could then do something like this:
if (x86_feature_usable (X86_FEATURE_AVX512F))
return &__matmul_avx512f;
I don't think there is value in exposing the CPUID data directly. If
programmers need it, they can use <cpuid.h> from GCC instead, without
needing to worry how glibc populates its data structures.
Thanks,
Florian
More information about the Libc-alpha
mailing list