From: utzoo!watmath!watcgl!dmmartindale
Newsgroups: net.unix-wizards
Title: Re: dump/restor SLOW -- why?
Article-I.D.: watcgl.153
Posted: Mon Jan 31 21:53:44 1983
Received: Mon Jan 31 23:59:31 1983
References: wivax.4456

There is no need to build something like "asm.sed" simply to get a fast
memory copy routine.  Simply replace the code for "copy" in restor with:

#ifdef vax
copy(f, t, s)
char *f, *t;
{
	asm("movc3 12(ap),*4(ap),*8(ap)");
}
#else vax
copy(f, t, s)
register char *f, *t;
{
	register i;

	i = s;
	do
		*t++ = *f++;
	while (--i);
}
#endif vax

Something similar could be done with the code that clears a buffer, but
not nearly as much time is spent in it as in copy().  A better solution,
though, would be to rewrite restor so that the routines which want to
look at the tape a block at a time are simply given a pointer to the
block, rather than requiring the data to be copied from the tape buffer
to some other internal buffer.