I got user requests to export <cpu-features.h> so that people can do #if __has_include(<cpu-features.h>) #include <cpu-features.h> #endif ... if (HAS_CPU_FEATURE (SSE3)) ... if (CPU_FEATURE_USABLE (SSE3)) ...
GCC already has this as __builtin_cpu_supports. Why isn't that sufficient? GCC support is desirable so that GCC can turn the expression into a true value at compile time if the CPU feature is required by the current compilation environment.
(In reply to Florian Weimer from comment #1) > GCC already has this as __builtin_cpu_supports. Why isn't that sufficient? > > GCC support is desirable so that GCC can turn the expression into a true > value at compile time if the CPU feature is required by the current > compilation environment. __builtin_cpu_supports only supports a subset of <cpu-features.h>.
A patch is posted at https://sourceware.org/pipermail/libc-alpha/2020-June/115158.html
Fixed in 2.33 by commit 9620398097de3981c1adf5233e2b3478d36bc1b3 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Jun 29 18:30:54 2020 -0700 x86: Install <sys/platform/x86.h> [BZ #26124]