4 ms·
My rationale was that it takes a much bigger knowledge base to optimize code for more complex architectures because of all the factors you have to take into acc
by simias 14y ago
My rationale was that it takes a much bigger knowledge base to optimize code for more complex architectures because of all the factors you have to take into account.
On simple architectures it's often very straightforward and you can sometimes save CPU cycles/memory space by doing some refactoring the compiler can't/is not allowed to do.
You can for instance "stash" certain important values in CPU registers across functions, disregarding the ABI to avoid pushing/popping the stack or moving stuff around in registers. Well, that's not a very good example because you can tell GCC to do exactly that, but it's not a standard C feature and the compiler cannot do that on its own across translation units. So it's one of those situations where you can "outsmart" the compiler, even if the compiler would probably tell you it's not fair game :)