V5 [PATCH 1/2] x86: Add <sys/platform/x86.h>

H.J. Lu hjl.tools@gmail.com
Wed Oct 24 09:33:00 GMT 2018


On 10/24/18, Florian Weimer <fweimer@redhat.com> wrote:
> * H. J. Lu:
>
>> +@defmac HAS_CPU_FEATURE(name)
>> +
>> +Evaluate to true if the CPU feature @code{name} is supported as
>> indicated
>> +by @code{CPUID} instruction.  The available features are:
>
> I'm still puzzled why we expose this function.  It will only confuse
> programmers.

A use case:  AVX512 bits can be used to tell Xeon Phi from Skylake
sever even if AVX512 instructions aren't used/needed at all.

>> +@defmac CPU_FEATURE_USABLE(name)
>> +
>> +Evaluate to true if the architecture feature @code{name} is usable.
>> +The supported features are:
>
> This is the only interface which should be exposed.
>
> Thanks,
> Florian
>


-- 
H.J.



More information about the Libc-alpha mailing list