V6 [PATCH] x86: Add <sys/platform/x86.h>

Florian Weimer fweimer@redhat.com
Fri Oct 26 06:11:00 GMT 2018


* H. J. Lu:

> /* CPU_FEATURE_USABLE evaluates to true if the feature is usable.  */
>  #define CPU_FEATURE_USABLE(name)                                  \
>    ((need_arch_feature_##name                                      \
>      && (x86_get_arch_feature (index_arch_##name##_Usable)         \
>    & (bit_arch_##name##_Usable)) != 0)                             \
>     || (!need_arch_feature_##name 	                           \
>         && (x86_get_cpuid_registers (index_cpu_##name)->reg_##name \
> 	    & (bit_cpu_##name)) != 0))

I still think this is wrong.  This should be a const function, with a
single argument, returning bool, so that we do not expose the internal
implementation.  It will also be possible to use this function from Ada,
Fortran, and so on.  This is not possible with a preprocessor macro.

Thanks,
Florian



More information about the Libc-alpha mailing list