There are something else that couldn't be done in C:sean_vn wrote:Hey, there is a lot of junk in the Intel instruction set, but bswap, haddps, rdrand, and some of the crc instructions do things that are not so expressable in c. Sometimes you can gain.
If there is no special instruction you can exploit then gcc or java hotspot will generally do better than you can.
- choosing to use only registers (the register keyword doesn't works all the times)
- keeping most used pointers in fixed registers (edi=move, esi=node, for sample)
- call a set of functions with values/pointers in fixed registers, not on the stack (a kind of __fastcall shared by multiple functions)
- return from a function both a value and a flag (Carry set, for sample)
- some magics with flags (maybe this couldn't be true)
All of this has not be proven that could give you a faster programs, but sometimes does, i think.