Computing (FOLDOC) dictionary
Jump to user comments
invented by Tom Duff when he was at Lucasfilm. Trying to
bum all the instructions he could out of an inner loop that
copied data serially onto an output port, he decided to unroll
it. He then realised that the unrolled version could be
implemented by *interlacing* the structures of a switch and a
loop:
register n = (count + 7) / 8; /* count @# 0 assumed */
switch (count % 8)
}
Shocking though it appears to all who encounter it for the
first time, the device is actually perfectly valid, legal C.
its most controversial single feature; Duff observed that
"This code forms some sort of argument in that debate, but I'm
not sure whether it's for or against."
[For maximal obscurity, the outermost pair of braces above
could be actually be removed -
GLS]
(2001-06-22)