Hacker News new | past | comments | ask | show | jobs | submit login

You’d need to recompile the binary to take advantage of new instructions.

The compiler alone, but also the code, can create branches where the binary checks if certain instructions are available and if they are not, use a less optimal operation.

Backwards compatibility for modern binaries basically. But not forward ability to see the future instructions that haven’t been invented yet.

Not all binaries are fully backwards compatible. If you’re missing AVX, a surprising number of games won’t run. Sometimes only because the launcher won’t run, even though the game plays without AVX.




I've actually sometimes seen this as an argument in favor of JITed languages like C# and Java, that you can take advantage of newer CPU features and instructions etc. without having to recompile. In practice languages that compile to native binaries still win at performance, but it was interesting to see it turned into a talking point.


JIT languages still have a bit of a trade off.

But for a pure pre-compiled example there is Apple Bitcode which is meant to be compiled to the destination architecture before run (as opposed to JIT code which is compiled when run). It's mandatory for Apple watchOS apps and when they released watch with a 64bit CPU they just recompiled all the apps.


I believe that the binaries that actually get shipped to the watch are final bits. Apple just compiles the bitcode that developers give them into versions for all of the watches that they are supporting, and those versions get downloaded by the actual watches.

If they come out with new watches, then they can re-compile all of the code for the new watches with no developer involvement. It is really the best solution for all involved.




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

Search: