Explanation, please!

Paul Fuqua pf at csc.ti.com
Fri Sep 2 02:31:53 AEST 1988


    Date: Wednesday, August 31, 1988  9:13pm (CDT)
    From: loren at pixar.UUCP (Loren Carpenter)
    Subject: Re: Explanation, please!
    Newsgroups: comp.lang.c,comp.arch
    
    The Duff Loop (as far as I know) was first cast into C by Tom Duff when
    he was at Lucasfilm in the early 1980's.  We used it at Lucasfilm wherever
    we needed reasonable speed without resorting to assembly language.  It
    obviously generalizes to more than memory copy & clear.

There was a discussion of the device in comp.protocols.tcp-ip not too long
ago, as a way to speed up the calculation of checksums.  The one point that I
haven't seen brought out here yet is that if the unrolling factor is a power
of two, the divide/remainder operations are simply a shift and a mask.

                              pf

Paul Fuqua
Texas Instruments Computer Science Center, Dallas, Texas
CSNet:  pf at csc.ti.com (ARPA too, sometimes)
UUCP:   {smu, texsun, cs.utexas.edu, im4u, rice}!ti-csl!pf



More information about the Comp.lang.c mailing list