3 ms·
You could do some tricks with GCC like not specifying arguments in your MOV instructions and let GCC use the optimal registers it calculates during compiling. P
by bitL 10y ago
You could do some tricks with GCC like not specifying arguments in your MOV instructions and let GCC use the optimal registers it calculates during compiling. Practical consequence was that instead of doing some default MOV AX, [something] then MOV BX, [something], then e.g. MUL BX, you could have avoided the first two operations as GCC would chain them together properly without the need to fill in values; so by inlining such code you'd get very very close to hand-written assembly language without additional overhead, speeding up your 3D engine significantly.
- pjmlp 10y agoOn those days I seldom found a compiler that was able to generate better Assembly than a human coder at junior level would be capable of. So we just wrote the inline Assembly 100% ourselves, regardless of the compiler.