This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: V6 [PATCH] x86: Add <sys/platform/x86.h>
- From: Florian Weimer <fweimer at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 26 Oct 2018 07:16:55 +0200
- Subject: Re: V6 [PATCH] x86: Add <sys/platform/x86.h>
- References: <CAMe9rOqcfBAsSQQme3VJyMKsbAvKO_YdaG=1ZJqrm+T8aPztag@mail.gmail.com>
* 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