This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]