3 ms·
Yes, I do Dreamcast homebrew, and even with GCC 12.2, the compiler does such stupid, stupid things. The SH has addressing modes for postincrement reads and pre
by TapamN 3y ago
Yes, I do Dreamcast homebrew, and even with GCC 12.2, the compiler does such stupid, stupid things.
The SH has addressing modes for postincrement reads and predecrement writes, so something like
var = *ptr++;
can be compiled down to a single instruction. But GCC almost always does something moronic. I've seen it generate code equivalent to:
ptr++; tmp = ptr; tmp -= 16; var = tmp[15];
Insane.
Older versions of GCC (3.x) are generally much better at low level instruction selection, but newer versions are better at big-picture stuff like optimizing across function calls, so speed-wise, across a whole program, they aren't too dissimilar. Newer versions are still worth it for the feature set (better warnings, modern standards like C23/C++23, etc).