From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,28b0249f7691568e X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,28b0249f7691568e X-Google-Attributes: gid1164f8,public From: andrew@gurney.reilly.home (Andrew Reilly) Subject: Re: Alpha in peril? First Canion, now Pfieffer (I do think so) Date: 1999/05/18 Message-ID: <7hsjvd$o9v$1@m2.c2.telstra-mm.net.au>#1/1 X-Deja-AN: 478841557 References: <371AD875.407C6B83@igs.net> <7g4tng$5ue$1@nnrp1.dejanews.com> <7h7vnn$2ts$15@nntp.Stanford.EDU> <5l4sljqx5d.fsf@tequila.cs.yale.edu> <926495090.942894@haldjas.folklore.ee> <37396C9A.BD7A1D3B@hda.hydro.com> <7hp5if$11co$1@news.doit.wisc.edu> <7hq34t$osi$9@nntp.Stanford.EDU> <374110A2.67761C35@hda.hydro.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@m2.c2.telstra-mm.net.au X-Trace: m2.c2.telstra-mm.net.au 927060781 24895 24.192.48.172 (18 May 1999 20:53:01 GMT) Organization: Lake DSP Mime-Version: 1.0 Reply-To: andrew@lake.com.au NNTP-Posting-Date: 18 May 1999 20:53:01 GMT Newsgroups: comp.arch,comp.sys.dec In article <374110A2.67761C35@hda.hydro.com>, Terje Mathisen writes: > PS. Almost all the really high-performance asm kernels I write tend to > use base+index+offset addressing in the innermost loops: > > ESI -> just past the end of input array > EDI -> just past the end of output array > ECX = nr of elements (or size in bytes/size in unrolled blocks etc) > > ; Unrolled 2-8 times: > OFFSET = 0 > next4: > REPT 4 > mov eax,[esi + ecx * SCALE_FACTOR + OFFSET] > ... Do something > mov [edi+ + ecx * SCALE_FACTOR + OFFSET] > OFFSET = OFFSET + ELEMENT_SIZE > ENDM > > ; Update loop counter/address index & branch back > add esi, BLOCK_SIZE > jb next4 > > The individual iterations are of course mixed together for better > pipeling, and the top of the loop will avoid any loop-counter based > addressing which would cause AGIs, but otherwise that is the normal > logic. > > With just base or base + offset addresses, I would have needed more > instructions to update the source & destination pointers as well. Well, it's all a question of where you put your adders and instruction/addressing mode bits, isn't it? Thinking as I write, I can see that this way does have the advantage of not requiring the incremented addresses to be written back to the register file, but neglecting that factor, it doesn't seem to be dramatically more efficient than post-increment addressing modes on other processors. -- Andrew Reilly