home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / arch / 9082 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  3.0 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!uvaarpa!gems.vcu.edu!fritz
  2. From: fritz@gems.vcu.edu (Fritz)
  3. Newsgroups: comp.arch
  4. Subject: Re: trapping speculative ops
  5. Message-ID: <1992Aug28.123840.87@gems.vcu.edu>
  6. Date: 28 Aug 92 12:38:39 -0400
  7. References: <GLEW.92Aug25180333@pdx007.intel.com> <CLIFFC.92Aug27082745@medea.rice.edu>
  8. Organization: Medical College of Virginia
  9. Lines: 60
  10.  
  11. In article <CLIFFC.92Aug27082745@medea.rice.edu>, 
  12.   cliffc@rice.edu (Cliff Click) writes:
  13.  
  14. [...]
  15. > <Cliff Click>
  16. > || Let every register have some extra "trap" bits.
  17. > || A read of the register with it's trap bits set, causes the exception.
  18. > || A write to the register sets the trap bits according to the success of
  19. > || the operation.
  20. > || 
  21. > || With this design, exceptions are triggered at the START of some operation,
  22. > || instead of in the middle of it.
  23. > <Stanley T.H. Chow>
  24. > | Very nice model, but what to do about saving and restoring registers
  25. > | across subroutine call, interupts, etc.?
  26. > <Cliff Click>
  27. > Soft answer:
  28. > The compiler knows that live and possibly dangerous results cannot be 
  29. > carried across a subroutine call.  Therefore it uses every possibly 
  30. > dangerous result before the subroutine call.  This means you cannot 
  31. > lift that divide-by-zero across the subroutine call.
  32. > Hard answer:
  33. > The hardware allows these bits to be read and written using a special 
  34. > register.  The special register can be "slow" because it's assumed to be
  35. > an infrequent operation.  The trap bits are saved and restored along with
  36. > the registers.
  37. > Interrupts appear to require the "hard answer", but there is another way
  38. > (albeit possible worse):
  39. > Harder Soft answer:
  40. > Only 1 interruptable condition can exist at a time.  The compiler forces the
  41. > issue by using the possible dangerous register before it allows another 
  42. > operation which can cause a dangerous register.  External interrupts are
  43. > disabled while a dangerous register exists.  The compiler ensures that no
  44. > register is kept dangerous for longer than the desired interrupt latency.
  45. > Since only 1 interrupt can occur at a time, no trap bits need to be saved
  46. > or restored.
  47. > Scheduling restrictions in this answer are probably worse than implementing 
  48. > the hardware solution.  I have no idea what you can implement cheaply in
  49. > hardware.
  50. [...]
  51. > Stanley Chow            schow@BNR.CA
  52. > Cliff Click             cliffc@cs.rice.edu
  53. [...]
  54.  
  55. A hardware answer for interrupts only that might be easier to implement
  56. would be to say that during interrupt service, the trap bits are not set
  57. on writes, and are ignored on reads.  Any operation that would
  58. ordinarily trap is undefined during interrupt service: it might put
  59. garbage in the register, (possibly _after_ returning from the interrupt).
  60. You'd have to be pretty confident that the interrupt routines didn't
  61. divide by zero and so forth--but you have to be pretty confident in the
  62. correctness of your interrupt routines with any architecture.
  63.  
  64. You'd use the software answer for subroutine calls.
  65.