Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site gloria.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!rochester!rocksvax!rocksanne!sunybcs!gloria!colonel From: colonel@gloria.UUCP (Col. G. L. Sicherman) Newsgroups: net.lang.c Subject: Re: fast string copy Message-ID: <1049@gloria.UUCP> Date: Wed, 27-Mar-85 19:43:11 EST Article-I.D.: gloria.1049 Posted: Wed Mar 27 19:43:11 1985 Date-Received: Sat, 30-Mar-85 00:20:24 EST References: <1061@decwrl.UUCP> Organization: The Church of Artificial Intelligence Lines: 24 ["In the service of Virman Vundabar we learn perfection!"] > I think this is cute, how VAX/VMS beats Unix at its own game. The VMS C > compiler generates code as good as or better than anything I have seen posted > so far! > > char *s,*t; > while (*s++ = *t++); > > generates (on a VAX 780): > > movb (r2)+,(r1)+ > beql sym.2 > sym.1: > movb (r2)+,(r1)+ > bneq sym.1 > sym.2: > > This is as fast as you can get. Careful! You can probably speed it up by unrolling the loop.... -- Col. G. L. Sicherman ...{rocksvax|decvax}!sunybcs!colonel