Hacker News new | ask | show | jobs
by horyzen 2559 days ago
Not sure about VC++, but in gcc you can use -march=native to let the compiler compile the code with all instruction sets available on your CPU, I think there is a VC++ equivalent.

As for already compiled binary, depending on how it was compiled it may or may not work of a different CPU. Also the compiler doesn't do the runtime checks.

1 comments

GCC can do Function Multi Versioning (https://gcc.gnu.org/wiki/FunctionMultiVersioning , https://lwn.net/Articles/691932/) where it will generate code for multiple CPUs and select the best at run time.