home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!decwrl!deccrl!news.crl.dec.com!rdg.dec.com!ryn.mro4.dec.com!ricks.enet.dec.com!akhiani
- From: akhiani@ricks.enet.dec.com (Homayoon Akhiani)
- Newsgroups: comp.arch
- Subject: Re: trapping speculative ops
- Message-ID: <1992Aug26.153528.7699@ryn.mro4.dec.com>
- Date: 26 Aug 92 15:35:28 GMT
- References: <l8gi9jINNaad@exodus.Eng.Sun.COM> <1992Aug12.155317.27437@bcars64a.bnr.ca> <l8j0qkINNikb@exodus.Eng.Sun.COM> <BtEzrK.Jso.2@cs.cmu.edu>
- Sender: news@ryn.mro4.dec.com (USENET News System)
- Reply-To: akhiani@ricks.enet.dec.com (Homayoon Akhiani)
- Organization: Digital Equipment Corporation
- Lines: 66
-
-
-
- In article <BtEzrK.Jso.2@cs.cmu.edu>, lindsay+@cs.cmu.edu (Donald Lindsay) writes:
- |>From: lindsay+@cs.cmu.edu (Donald Lindsay)
- |>Newsgroups: comp.arch
- |>Subject: Re: trapping speculative ops
- |>
- ...........................
- |>
- |>But this is just a specific optimization. The broader question is,
- |>waht about traps while executing speculatively? There seem to be two
- |>answers:
- |>
- |>1) Let the hardware do all the speculative execution. This puts it on
- |>the hardware's head to not trap until it knows it really should have.
- |>
- |>2) Allow compiled code a way to postpone consequences until it
- |>wants to know. This covers e.g.
- |>
- |> if( b != 0 ) c = a/b;
- |>
- |>and an assortment of other cases.
- |>
- |>The problem with (1) is that it makes for complex hardware. The
- |>problem with (2) is that instruction sets are generally not set
- |>up to allow such leeway.
- |>--
- |>Don D.C.Lindsay Carnegie Mellon Computer Science
- |>
-
- I believe that there is a 3rd option:
- 3) Hardware has Trap Status and Control register
- Using the control resgister, Software will disable all traps.
- So when a exception rises, the hardware will not trap, it will update the
- "Status Register" and follows the normal execution path.
-
- At a point that Software decided to use the result of the "Speculative"
- flow, Software will read the "Status Register" and if the Status for
- the chosing flow had no trap in it, the bingo!
-
- example:
-
- if(z) c = a/b;
- else c = a/d;
- (Note that since traps are disabled there is no need for if(b!=0))
-
- Can be executed as follow:
-
- tmp1 = a/b
- tmp2 = a/d
- if(z) {Check status on tmp1, if nothing bad then c = tmp1;
- else {Check status on tmp2, if nothing bad then c = tmp2;
-
- If we have 2 divider units, we can start both division at the same time.
- Therefore, if z==1 then we simply ignore the result and traps on a/d
- calcaulation.
-
-
-
- --
- -------------------------------------------------------------------------------
- Homayoon Akhiani "Turning Ideas into ... Reality"
- Digital Equipment Corporation
- 77 Reed Rd. Hudson, MA 01701 "All Rights Reserved. Copyright(c)1992"
- Email: akhiani@ricks.enet.dec.com "The words are mine, and not my employer"
- -------------------------------------------------------------------------------
-