This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__ ifunc examples?
- From: James Cloos <cloos at jhcloos dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 22 Mar 2012 16:52:16 -0400
- Subject: Re: __attribute__ ifunc examples?
- Copyright: Copyright 2012 James Cloos
- Openpgp: ED7DAEA6; url=http://jhcloos.com/public_key/0xED7DAEA6.asc
- Openpgp-fingerprint: E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6
- References: <m3ehsvmfeh.fsf@carbon.jhcloos.org> <mcrr4wuzioo.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
>>>>> "ILT" == Ian Lance Taylor <iant@google.com> writes:
JC>> Does anyone have a worked example in C of using attribute ifunc to
JC>> dispatch over the various x86 SSE/AVX flags, as well as arm neon?
ILT> For your case you need to write foo_ifunc using appropriate asm
ILT> instructions to check cpuid or whatever.
Thanks, but that much I already got out of the docs. I was hoping for
an example of actual checks for the various cpu features for x86 & arm
in the ifunc context.
The existing cpu feature detectors out in the wild, plus the i+a+v docs,
should provide enough extra clue, of course. Just a matter of coding,
after all.
ILT> At present you have to call it manually. There is an outstanding patch
ILT> to add __builtin_cpuid on x86 systems, but I don't think it has been
ILT> approved.
That would be a useful addition.
Thank you.
-JimC
--
James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6