Over time, Intel and other processor core designers add more and more instructions to the cores in our machines. A good question is how quickly and easily new instructions added to an Instruction-Set Architecture (ISA) actually gets employed by software to improve performance and add new capabilities. Considering that our operating systems and programs are generally backwards-compatible, and run on all kind of hardware, can they actually take advantage of new instructions?
The answer today, at least on Intel Architecture, is to use the CPUID instruction to find out the available instructions and dynamically (or at least at boot or program start) determine the best code to use. I just did a quick investigation of how this works with a few variants of Linux on Nehalem (1st generation Core i7) and Skylake (6th generation Core i7) processors, and wrote up the results on Intel Software.
In short, even something like a Linux boot changes the instructions used depending on the architecture. Checking this was pretty easy using Simics, since I could use our instrumentation features to enumerate all the different instructions used.