Re:Hand-Coded Assembly Beats Intrinsics in Speed and Simplicity
by nteon on Tuesday August 11, 2015 @04:18PM
(#10044062)
for an example, checkout this: http://pasky.or.cz/dev/glibc/ifunc.c
Two implementations are compiled (one is optimized using instructions only available on certain processors), and the decision of which one to use is made at program startup.
So yea, populating this at runtime depending on the CPU features supported by your CPU is possible, and the linux dynamic linker does this: http://man7.org/linux/man-pages/man8/ld.so.8.html (check out the section on hardware capabilities).