From: Przemek Klosowski <przemek@rrdjazz.nist.gov>
Subject: Re: Seasons Greetings from a new platform :-)
Date: Tue, 16 Dec 1997 09:40:55 -0500 [thread overview]
Message-ID: <199712161440.JAA29020@rrdjazz.nist.gov> (raw)
mike@clove.com asks
I've heard of `speculative execution' in the stock market, but
... what is this in a microprocessor?
Briefly, modern CPUs are heavily pipelined, meaning that any given
moment they are handling several instructions in different stages of
completion (e.g. they may be writing out results of one instruction,
calculating the results of another one, fetching the operands for a
third one and fetching/decoding a fourth one). This works rather well
for code that simply runs through a long sequence of instructions,
resulting in an average one or more machine instructions completed per
clock cycle, even though the actual instruction operation is much longer.
However, when there is a branch or a conditional operation,
i.e. instruction N+1 executes differently based on the result of
instruction N, this pipeline has to stop and wait for the result of
N. Since on average there is a branch/conditional every 10 or so
instructions, a simple pipeline might be stalled 10-20% of the time.
Speculative execution means that the CPU executes code for either
outcome for the test, but stores the results in temporary hidden
registers, keeping track of what data comes from such speculation.
When the actual predicate becomes known, the CPU picks up the data
calculated for the correct value of the predicate, and discards the
alternative computation. This is of course only possible if the CPU
does have multiple independent functional units (ALUs etc) and temporary
storage; Alpha had such parallel functional units for some time now
because they help even for non-speculative code.
It turns out that with enough functional units and temporary result
storage it pays to do this extra work even though half (or 3/4 or 7/8)
of it is wasted.
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next reply other threads:[~1997-12-16 14:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-12-16 14:40 Przemek Klosowski [this message]
-- strict thread matches above, loose matches on Subject: below --
1997-12-16 15:39 Seasons Greetings from a new platform :-) David Alan Gilbert
[not found] <3496A0A3.31D6AF8D@cogency.co.uk>
1997-12-16 8:32 ` Jay.Estabrook
[not found] <199712151341.IAA18985@clove.com>
1997-12-15 22:33 ` Tom Linden
1997-12-15 13:41 Mike Howard
[not found] <349128C9.5DF646C5@treblig.org>
1997-12-12 9:17 ` Jay.Estabrook
1997-12-13 4:38 ` George
[not found] <3491223D.C87F9F77@voicenet.com>
1997-12-12 19:50 ` Richard Henderson
1997-12-12 15:36 Toon Moene
1997-12-12 11:50 ` Jay.Estabrook
1997-12-12 12:06 Dave Gilbert
1997-12-12 11:55 A.Arnold
1997-12-12 11:38 Uncle George
1997-12-12 9:27 Stefan Schroepfer
1997-12-12 9:15 Dave Gilbert
1997-12-12 7:38 warp
[not found] <3490B5A9.2F1C@agapesystems.com>
1997-12-12 6:07 ` Ross A. Knepper
1997-12-12 3:55 Paul Anderson
[not found] <199712112254.RAA12058@linux03.amt.tay1.dec.com>
1997-12-11 22:06 ` Chris Price
1997-12-12 2:10 ` Christopher F. Miller
1997-12-13 1:50 ` Jakob 'Sparky' Kaivo - MCP
1997-12-11 12:54 Jay.Estabrook
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox