Zend certified PHP/Magento developer

Do modern 64-bit (AMD64) applications use different code paths for different CPU generations?

Background:
Back in 2005, the Intel C compiler created three different versions of compiled code, two of which corresponded what was optimal for current Intel CPUs at the time. One was optimized for the Pentium 4, one for the Pentium III, and finally a completely unoptimized version (even lacking 386 compatible CPU optimizations) that would run significantly more slowly on any CPU. Big problems resulting in a lawsuit arose when any AMD CPU was considered to be a legacy CPU and the unoptimized code would run.

If I understand correctly, with more modern 64-bit CPUs, the differences in architecture and optimizations between the original 64-bit CPUs from 2004 and the current ones are fewer compared to the changes that occurred in x86 CPUs through the 1990s. For instance, all AMD64 based CPUs support a fairly advanced instruction set with SSE2 support. Even with the introduction of AVX, the basic non SIMD instruction set should be fairly similar. With that said, is it common for modern compilers to produce different versions of code for different generations of AMD64 based CPUs?

Related question: Does modern software use different CPUs features selectively?