* 21164 architecture
@ 1997-10-24 4:00 Bill Moyer
1997-10-26 4:00 ` John McNamara
0 siblings, 1 reply; 3+ messages in thread
From: Bill Moyer @ 1997-10-24 4:00 UTC (permalink / raw)
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
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 21164 architecture
1997-10-24 4:00 21164 architecture Bill Moyer
@ 1997-10-26 4:00 ` John McNamara
1997-10-26 4:00 ` Douglas H. Borsom
0 siblings, 1 reply; 3+ messages in thread
From: John McNamara @ 1997-10-26 4:00 UTC (permalink / raw)
In article <62r1pd$o71$1@andros.cygnus.com>, billm@cygnus.com (Bill Moyer)
wrote:
> 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.
[snip]
>
> -- ttk
>
>--
It's true that the non-pipelined multiply is accessed through E0.
However, E0 is free to perform non-multiply instructions while the
multiply unit is busy. The only restriction is that no instruction
can be issued in E0 two cycles (if I recall correctly) before the
multiply completes. This allows the multiply to write to the register
set when complete. So... don't be too concerned about the shifts.
One of the best tools for profiling alpha code is DCPI (digital
continuous profiling infrastructure), available from one of the
digital research sites. It uses the 21164 performance counters
to accurately profile code. The dcpicalc command gives the
assembly for a routine together with cycles per instruction based
on the counters. It also gives a best guess as to the cause for
stalls in execution: e.g. static conflicts, dcache/icache misses,
mispredicts, etc.
--
John McNamara "I am not a number, I am a free man"
jfm6@jaguNET.com -- No. 6
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-10-26 4:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-10-24 4:00 21164 architecture Bill Moyer
1997-10-26 4:00 ` John McNamara
1997-10-26 4:00 ` Douglas H. Borsom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox