faster bcopy using duffs device (source)

Chris Torek chris at mimsy.UUCP
Fri Sep 8 14:26:37 AEST 1989


In article <5180 at portia.Stanford.EDU> stergios at Jessica.stanford.edu
(stergios marinopoulos) writes:
>I wanted a faster bcopy, so I used duffs device as a basis for it.

bcopy() should be written in assembly (on most processors), put in
a library, and forgotten about, because---for instance---a dbra loop
beats a Duff loop on a 68010, every time.  (And on a 68000, a loop
using movml is best.  68020s have an I-cache, so a hand-coded `Duffish'
loop is a good bet.  Some VAXen have a special instruction which does
a good job.  [movc3 is done in software on the 610.]  `rep movsb' [or
is there a `movsw'?] is best on an 80x86.  LDIR is best on a Z80.  A
Duff-style loop is probably best on a PDP-11.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list