Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!nike!oliveb!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: brk's zero-fill behavior on VAXen Message-ID: <8953@sun.uucp> Date: Wed, 5-Nov-86 15:22:37 EST Article-I.D.: sun.8953 Posted: Wed Nov 5 15:22:37 1986 Date-Received: Wed, 5-Nov-86 22:47:42 EST References: <1375@batcomputer.TN.CORNELL.EDU> Organization: Sun Microsystems, Inc. Lines: 60 > "One or a few" is not a meaningful criterion. I'll agree with that, but... > The Vax's MOVC5 instruction is indeed a single instruction - but it runs > at just about the same speed as an equivalent sequence of CLRL (reg)+ > instructions. Oh, really? *Which* VAX's MOVC5 instruction? I tried this on an 11/750, and got: % cat bzeroes.s .globl _bzerow1 .align 2 _bzerow1: .word 0 movl 4(ap),r3 movc5 $0,(r3),$0,8(ap),(r3) # conventional MOVC5 ret .globl _bzerow2 .align 2 _bzerow2: .word 0 movl 4(ap),r3 movl 8(ap),r2 1: clrl (r3)+ # SOBGTR loop of CLRL sobgtr r2,1b # NOTE - "bzerow1" takes a byte ret # count, this one takes a longword # count .globl _bzerow3 .align 2 _bzerow3: .word 0 movl 4(ap),r3 clrl (r3)+ # a total of 1024 CLRLs ... clrl (r3)+ ret I built three programs, each of which just calls a byte-clearer 1024 times. The first program calls "bzerow1" with a count of 4096 (bytes); "time" gives 1.1u 0.0s 0:01 89% 5+11k 0+1io 2pf+0w The second calls "bzerow2" with a count of 1024 (longwords); "time" gives 3.6u 0.0s 0:03 95% 1+11k 0+0io 1pf+0w The third calls "bzerow3", which always clears 1024 longwords (the count is irrelevant); "time" gives 2.1u 0.0s 0:02 91% 5+11k 0+0io 1pf+0w -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)