back to memcpy eh?

Tim Rowledge tim at sumeru.stanford.edu
Sat Dec 15 04:57:36 UTC 2001


"David N. Smith (IBM)" wrote:
> 
> John:
> 
> That is one of the more disgusting bits of C code I've ever seen (short of the Obfuscated C contest). And it's legal!  Beautiful!
Hey, what's wrong with it? Same trick was used in BrouHaHa 10-15 years
ago. Seems perfectly legit to me...

In fact I did one even wilder; when ARMs didn't have instruction caches
it was trivial to do self compiling code. For a few instructions work
you could generate a loop (on the stack, of course :-) that would blast
out some number of prepared registers using the multiple-store rapid
dump instruction, loop appropriately and then fill in the last few slot.
Same idea made ARM bitblt go like a rat up a drainpipe even without fast
memory, caches, pipelining, all this modern crap. We'ad it tough in them
days. Tell that to kids these days and they won't believe yer.

tim






More information about the Squeak-dev mailing list