something bugged me about the instruction set extensions and the possible optimization of software for those. In the wikipedia article about the X86 instruction set is a chroniconal list of extensions, like MMX, SSE or AVX. I know i have to recompile a software if i whant it optimized for a new extension. But through other questions here i learned that it is not possible to pack several versions of compiled software in one executable. (For every new extension a new compilation.) My questions are:
- Does code compiled for a extension run on an older cpu without that extension?
- Is there a check for that extension in the compiled code? (IF MMX THEN A ELSE B or similar)
- How do commercial software like Photoshop or an video encoder handle this? Optimize those at all? Or do they optimize only for older extensions and exclude older CPUs from usage?
- Or is it possible to generade optimized code for every cpu generation and pack those in one executebale? Like fat binary but for one CPU family whith different extensions. (IF MMX THEN A ELSEIF MMX AND SSE THEN B or similar) And when the programm is starting it will only load the best optimized but runnable code. Is there a buzzword for this solution?
Thx