This is the mail archive of the glibc-bugs@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]

[Bug libc/19766] All machines should pass dl_hwcap to ifunc resolvers.


https://sourceware.org/bugzilla/show_bug.cgi?id=19766

--- Comment #3 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Carlos O'Donell from comment #2)
> (In reply to Jakub Jelinek from comment #1)
> > Why?  On i386/x86_64 it can (and usually does) just use the cpuid
> > instruction to query the same information.
> 
> It's faster than cpuid and doesn't serialize the instruction stream. If you
> really need cpuid then you're free to call it and process the information
> yourself, but AT_HWCAP (merged with AT_HWCAP2 on 64-bit platforms) contains
> useful information the ifunc resolver might need.

So one problem is that AT_HWCAP can't tell you about XSAVE/OSXSAVE which is
required to enable AVX512 variants. So you're probably right that most people
for modern hardware detection will have to rely on cpuid. Which is problematic. 

I wonder if we can just document the safe functions to use in the IFUNC and
that would be enough, for example __builtin_cpu_init, __buildin_cpu_is, and
__builtin_cpu_supports should be safe because gcc already uses them in
multiversioning on x86?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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