This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: __attribute__ ifunc examples?


>>>>> "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


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