0%

duff's device

D d

Transcription

    • US Pronunciation
    • US IPA
    • US Pronunciation
    • US IPA

Definitions of duff's device words

  • noun Technical meaning of duff's device 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 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) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } Shocking though it appears to all who encounter it for the first time, the device is actually perfectly valid, legal C. C's default fall through in case statements has long been 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." 1
  • noun duff's device (computing, programming) A particular optimized implementation of a serial copy that uses an unusual C-language construct for loop unwinding. 0

Information block about the term

Parts of speech for Duff's device

noun
adjective
verb
adverb
pronoun
preposition
conjunction
determiner
exclamation

See also

Matching words

Was this page helpful?
Yes No
Thank you for your feedback! Tell your friends about this page
Tell us why?