Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.




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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: