User: Password:
|
|
Subscribe / Log in / New account

An Introduction to GCC Compiler Intrinsics in Vector Processing (Linux Journal)

An Introduction to GCC Compiler Intrinsics in Vector Processing (Linux Journal)

Posted Sep 25, 2012 11:49 UTC (Tue) by nix (subscriber, #2304)
In reply to: An Introduction to GCC Compiler Intrinsics in Vector Processing (Linux Journal) by khim
Parent article: An Introduction to GCC Compiler Intrinsics in Vector Processing (Linux Journal)

Perhaps this can be made simpler at the GCC level? Some kind of attribute which you can attach to you function to say "I need versions for Atom, Bulldozer, Core2, K8, K10, and Pentium4 - with automatic switch to pick one of them at runtime".
You can do this with a library, a couple of #defines, and IFUNC. However, for smaller operations this is actually harmful because the hit from the indirection through the PLT exceeds the time spent in the function. (Note that since glibc itself avoids use of the PLT for internal calls, its own calls to memcpy() et al do not benefit from IFUNC at all, and always go to a maximally-generic routine. The cost of this seems to be minimal.)


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds