skeezix
Internal Development
Heres an _anecdone_ (by no means an example of a trend, just an isolated case). Aside from being good-usage or bad-usage, sometimes its just great for pure optimization; sometimes when you do edge case optimization, you break the rules of good taste. (Often
ie: I was working on a CPU emu core (for cinematronics in fact), based on reference assembly from the amazing Zonn. (My core eventually got donated to MAME, and then I think Aaron came along and rewrote it to be more clear and less evil Anyway --
This was back at the time when machines were very slow (none of this Ghz business) so it needed to perform very fast; I think this was Pentium1 days so 60Mhz was not uncommon. Writing it in a sane fashion made it useless, but I chose to write it as a pure dstate machine in one function, with gotos. There was no function calls or looping or the like .. it was all switch/goto (if was too slow).
I made it not too ugly through use of lots of #define macros (and at one point a preprocessor to emit the code from a set of config files), but even then.. the resulting code was not _that_ ugly, and it was _extremely fast_. Function call overhead was too much, if-state,ment overhead was too much
So I'm a fan of good-usage, but sometimes you need to go low level .. without resorting to pure-ASM since I wanted to support multiple chips, etc.
Try explaining this to someone using a rich interpreted or VM'd language 5 layers removed, running on a multi-ghz multi-core machine
jeff
ie: I was working on a CPU emu core (for cinematronics in fact), based on reference assembly from the amazing Zonn. (My core eventually got donated to MAME, and then I think Aaron came along and rewrote it to be more clear and less evil Anyway --
This was back at the time when machines were very slow (none of this Ghz business) so it needed to perform very fast; I think this was Pentium1 days so 60Mhz was not uncommon. Writing it in a sane fashion made it useless, but I chose to write it as a pure dstate machine in one function, with gotos. There was no function calls or looping or the like .. it was all switch/goto (if was too slow).
I made it not too ugly through use of lots of #define macros (and at one point a preprocessor to emit the code from a set of config files), but even then.. the resulting code was not _that_ ugly, and it was _extremely fast_. Function call overhead was too much, if-state,ment overhead was too much
So I'm a fan of good-usage, but sometimes you need to go low level .. without resorting to pure-ASM since I wanted to support multiple chips, etc.
Try explaining this to someone using a rich interpreted or VM'd language 5 layers removed, running on a multi-ghz multi-core machine
jeff