Hacker Dictionary
 
Browse the Dictionary...
All A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Navigation Random Term
  • reply
    n. See {followup}.


  •  View Definition: Duff's device 

    Duff's device


    n. The most dramatic use yet seen of {fall through} in C, 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 realized 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) { case 0 do { *to = *from++; case 7 *to = *from++; case 6 *to = *from++; case 5 *to = *from++; case 4 *to = *from++; case 3