This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/19766] All machines should pass dl_hwcap to ifunc resolvers.
- From: "carlos at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 04 Mar 2016 18:17:33 +0000
- Subject: [Bug libc/19766] All machines should pass dl_hwcap to ifunc resolvers.
- Auto-submitted: auto-generated
- References: <bug-19766-131 at http dot sourceware dot org/bugzilla/>
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.