home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!darwin.sura.net!uvaarpa!gems.vcu.edu!fritz
- From: fritz@gems.vcu.edu (Fritz)
- Newsgroups: comp.arch
- Subject: Re: trapping speculative ops
- Message-ID: <1992Aug28.123840.87@gems.vcu.edu>
- Date: 28 Aug 92 12:38:39 -0400
- References: <GLEW.92Aug25180333@pdx007.intel.com> <CLIFFC.92Aug27082745@medea.rice.edu>
- Organization: Medical College of Virginia
- Lines: 60
-
- In article <CLIFFC.92Aug27082745@medea.rice.edu>,
- cliffc@rice.edu (Cliff Click) writes:
-
- [...]
- > <Cliff Click>
- > || Let every register have some extra "trap" bits.
- > || A read of the register with it's trap bits set, causes the exception.
- > || A write to the register sets the trap bits according to the success of
- > || the operation.
- > ||
- > || With this design, exceptions are triggered at the START of some operation,
- > || instead of in the middle of it.
- >
- > <Stanley T.H. Chow>
- > | Very nice model, but what to do about saving and restoring registers
- > | across subroutine call, interupts, etc.?
- >
- > <Cliff Click>
- > Soft answer:
- > The compiler knows that live and possibly dangerous results cannot be
- > carried across a subroutine call. Therefore it uses every possibly
- > dangerous result before the subroutine call. This means you cannot
- > lift that divide-by-zero across the subroutine call.
- >
- > Hard answer:
- > The hardware allows these bits to be read and written using a special
- > register. The special register can be "slow" because it's assumed to be
- > an infrequent operation. The trap bits are saved and restored along with
- > the registers.
- >
- > Interrupts appear to require the "hard answer", but there is another way
- > (albeit possible worse):
- >
- > Harder Soft answer:
- > Only 1 interruptable condition can exist at a time. The compiler forces the
- > issue by using the possible dangerous register before it allows another
- > operation which can cause a dangerous register. External interrupts are
- > disabled while a dangerous register exists. The compiler ensures that no
- > register is kept dangerous for longer than the desired interrupt latency.
- > Since only 1 interrupt can occur at a time, no trap bits need to be saved
- > or restored.
- > Scheduling restrictions in this answer are probably worse than implementing
- > the hardware solution. I have no idea what you can implement cheaply in
- > hardware.
- >
- [...]
- > Stanley Chow schow@BNR.CA
- > Cliff Click cliffc@cs.rice.edu
- [...]
-
- A hardware answer for interrupts only that might be easier to implement
- would be to say that during interrupt service, the trap bits are not set
- on writes, and are ignored on reads. Any operation that would
- ordinarily trap is undefined during interrupt service: it might put
- garbage in the register, (possibly _after_ returning from the interrupt).
- You'd have to be pretty confident that the interrupt routines didn't
- divide by zero and so forth--but you have to be pretty confident in the
- correctness of your interrupt routines with any architecture.
-
- You'd use the software answer for subroutine calls.
-