I understand that all x86 (i386) binaries compiled today, with the latest compilers (GCC, Intel CC, VC, etc) will run on an Intel 386 machine (allowing for external dependencies, like OS functions, etc) which explains why there are videos on YouTube of people getting Windows 7 to install and run on a 20 year-old computer.
But I don't understand how ISA extensions work, such as MMX and SSE. If a program's code has an extension instruction but the instruction is not supported by the processor then surely the program must crash (presumably a processor interrupt into the OS). The only solution I can think of is that the program's binary checks to see if an instruction is supported, and if not then it executes lowest-common-denominator code that is guaranteed to be supported by every platform, but surely that can make binaries very large, and what about instructions that were extensions but are now practically standard, like floating-point operations? Does that mean that every i386 binary that does FP operations also include software-FP emulation?
If a program does instruction-supported checks, then where does it do them? If you've got a tight loop then you don't want it performing the check within the loop. I don't believe compilers are smart enough yet to know how to optimise for that in every situation, so the lack of visible compiler options is weird.
I can't find any settings or options in my VC project settings for the compiler or linker for controlling instruction emission. There are a few about optimization but nothing that gives the control I expect.
And what about AMD's "3DNow!" extension? 3DNow is meant to be an extension on top of MMX, so it has some unique instructions and aspects of its own, but I can't find any references to it in my VC compiler or linker settings, so if I'm writing code how can I get my compiler to use the 3DNow! instructions (rather than MMX)?
Also, the Wikipedia article on 3DNow states that AMD removed a few 3DNow instructions from their processors - if there exists code that assumes these instructions are present will it no-longer work?