Path: utzoo!attcan!uunet!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.arch Subject: Re: speculative execution Message-ID: <2354@charon.cwi.nl> Date: 13 Oct 90 03:23:59 GMT References: <1990Oct10.164353.21070@rice.edu> <22587@grebyn.com> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 32 In article <22587@grebyn.com> ckp@grebyn.UUCP (Checkpoint Technologies) writes: > Why not include condition code bits with each register? Store these when > the register value is stored, when it pops out the end of a pipeline. > Include a flag for NAN (not a new idea, right?), and store this for > things like divide-by-0. Then you can trap when the register is used as > a source operand, and you can code explicit tests (and maybe traps) when > you want to, on operations that could very well be taking place > simultaneously. Something similar is done in all machines designed by Seymour Cray. There is no instruction that generates a result trap, only source traps are generated. There are advantages and disadvantages. Advantages: 1. It is possible to initialize all variables at a trapping value. This will very fast eleminate the use of uninitialized values. (CDC users will know this: LDSET(PRESET=UNDEF), although this would not work with integer variables.) 2. It makes it possible for the compiler to generate spurious results. I.e. if the array B has never been initialized the following loop: for I from 1 to N do if A[I] != 0.0 then B[I] = 1.0/A[I] can be modified by omitting the test without adverse effects. This can be beneficial on vector processors. In fact the Fortran compiler on the NEC SX/2 generates spurious results in some cases; alas, they trigger a result trap. Disadvantage: 1. Debugging is very problematical. I know, I have debugged a number of programs on the CDC Cyber. It is very difficult to see where a bad result originates. This is even worse if (as on the Cyber) there are multiple functional units so that it is even problematical which unit did generate the trap. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl