Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Fat binary
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Function multi-versioning=== Even in a program or [[library (computing)|library]] intended for the same [[instruction set architecture]], a programmer may wish to make use of some newer instruction set extensions while keeping compatibility with an older CPU. This can be achieved with ''function multi-versioning'' (FMV): versions of the same function are written into the program, and a piece of code decides which one to use by detecting the CPU's capabilities (such as through [[CPUID]]). [[Intel C++ Compiler]], GCC, and LLVM all have the ability to automatically generate multi-versioned functions.<ref name="Wennborg_2018"/> This is a form of [[dynamic dispatch]] without any semantic effects. Many math libraries feature hand-written assembly routines that are automatically chosen according to CPU capability. Examples include [[glibc]], [[Intel MKL]], and [[OpenBLAS]]. In addition, the library loader in glibc supports loading from alternative paths for specific CPU features.<ref name="Bahena_2018"/> A similar, but byte-level granular approach originally devised by Matthias R. Paul and Axel C. Frinke is to let a small self-discarding, [[instruction relaxation|relaxing]] and [[relocating loader]] embedded into the executable file alongside any number of alternative binary code snippets conditionally build a size- or speed-optimized runtime image of a program or driver necessary to perform (or not perform) a particular function in a particular target environment at [[load-time]] through a form of [[dynamic dead code elimination]] (DDCE).<ref name="Paul_1997_FreeKEYB"/><ref name="Paul_2002_DDCE2"/><ref name="Paul_2001_FK"/><ref name="Paul_2001_DDCE"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)