Xref: utzoo comp.lang.c:12297 comp.arch:6218 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!pollux!ti-csl!pf@csc.ti.com From: pf@csc.ti.com (Paul Fuqua) Newsgroups: comp.lang.c,comp.arch Subject: Re: Explanation, please! Message-ID: <57733@ti-csl.CSNET> Date: 1 Sep 88 16:31:53 GMT References: <2361@pixar.UUCP> Sender: news@ti-csl.CSNET Organization: TI Computer Science Center Lines: 22 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@csc.ti.com (ARPA too, sometimes) UUCP: {smu, texsun, cs.utexas.edu, im4u, rice}!ti-csl!pf