From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,5b59af3acfc3c403,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,5b59af3acfc3c403,start X-Google-Attributes: gid102b75,public From: billm@cygnus.com (Bill Moyer) Subject: 21164 architecture Date: 1997/10/24 Message-ID: <62r1pd$o71$1@andros.cygnus.com>#1/1 X-Deja-AN: 284764636 Distribution: usa Organization: Cygnus Support, Mountain View, CA Newsgroups: comp.sys.dec,comp.arch Hello. I've been generating quite a bit of Alpha assembly lately, and have a couple of "Why'd they do THAT?" questions about the organi- zation of the functional units in the 21164's EBOX. The 21164 has two integer pipelines; the first (E0) provides access to a multiplier, an adder, a shifter, and a logic box, while the other (E1) provides access to just an adder, a logic box, and a branch/jump unit. As long as the pipes are kept full, each normally completes one instruction per clock cycle. Multiplication, on the other hand, takes a long time (8 cycles for a 32-bit multiply, 12 cycles for 64- bit), and it would be nice to be able to shove as many instructions through the other pipe as possible while E0 is tied up. Alas, I'm limited to loads, adds/subtracts, logic, compares, and branches. I often find myself wishing that the 21164 either had a shifter in both pipes (especially when I'm writing rotate-intensive code) or at least had the shifter in E1 instead of E0. I have "Alpha Implementations and Architecture" by Bhandarkar, and have read the sections describing the considerable research that went into determining the optimal design for the Alpha. It looks impres- sive, and makes me wonder if my frustration is borne of my own misun- derstanding? Or perhaps the designers simply didn't have the room on the die to spare for an additional shifter? The other question is more of a wish.. Much of the code I port to the Alpha is intrinsically 32-bit, and I am always looking for ways to use the Alpha's 64-bit registers and operations to operate on 32- bit values in parallel for higher performance. The addition of ex- plicitly "parallel" addition and subtraction operations, implemented by making arithmetic carry between the 31st and 32nd bits of a 64-bit register conditional, would greatly expediate such efforts and would not (I think; I'm not a hardware engineer) require many more transis- tors on the die. An example of what I mean: currently, to load four 32-bit values and perform two subtractions would involve something like: ldl $1, 16($15) ldl $2, 20($15) ldl $3, 24($15) ldl $4, 28($15) subq $1, $3, $1 subq $2, $4, $2 stl $1, 16($15) stl $2, 20($15) (code left in unoptimized order for clarity) With a "parallel" subtract operation and appropriate prearrangement of values in memory for adjacency, the loads, subtractions, and stores could be combined: ldq $1, 16($15) ldq $2, 24($15) psub $1, $2, $1 stq $1, 16($15) My thought is that for very little transistor cost, "parallel" add and subtract operations could be used in conjunction with traditional logic operations (and, bis, bic, xor, ornot, eqv, which already possess the quality of parallel applicability) to enhance the performance of many 32-bit algorithms. -- ttk --