home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / arch / 9016 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  1.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!usenet.coe.montana.edu!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!lindsay
  2. From: lindsay+@cs.cmu.edu (Donald Lindsay)
  3. Newsgroups: comp.arch
  4. Subject: Re: trapping speculative ops
  5. Message-ID: <BtEzrK.Jso.2@cs.cmu.edu>
  6. Date: 23 Aug 92 02:18:55 GMT
  7. Article-I.D.: cs.BtEzrK.Jso.2
  8. References: <l8gi9jINNaad@exodus.Eng.Sun.COM> <1992Aug12.155317.27437@bcars64a.bnr.ca> <l8j0qkINNikb@exodus.Eng.Sun.COM>
  9. Sender: news@cs.cmu.edu (Usenet News System)
  10. Organization: School of Computer Science, Carnegie Mellon
  11. Lines: 35
  12. Nntp-Posting-Host: gandalf.cs.cmu.edu
  13.  
  14.  
  15. chased@rbbb.Eng.Sun.COM (David Chase) writes:
  16. >...being able to read zeros from page zero.  
  17. >This lets you do a slightly better job of pipelining loops
  18. >of the form
  19. >
  20. >   while (p != 0 && p -> data != K) p = p -> next;
  21.  
  22. >>Don't you want the user code to trap?
  23. >No, not if it makes the code run significantly slower.
  24.  
  25. I agree that an invalid zero page stops you from pulling this
  26. specific optimization. However, the invalid page trick has several
  27. virtues: it has no impact on hardware cost or speed, and it can
  28. detect bugs _after_ debugging is thought to be over.
  29.  
  30. But this is just a specific optimization. The broader question is,
  31. waht about traps while executing speculatively? There seem to be two
  32. answers:
  33.  
  34. 1) Let the hardware do all the speculative execution. This puts it on
  35. the hardware's head to not trap until it knows it really should have.
  36.  
  37. 2) Allow compiled code a way to postpone consequences until it
  38. wants to know. This covers e.g.
  39.  
  40.     if( b != 0 ) c = a/b;
  41.  
  42. and an assortment of other cases.
  43.  
  44. The problem with (1) is that it makes for complex hardware. The
  45. problem with (2) is that instruction sets are generally not set
  46. up to allow such leeway.
  47. -- 
  48. Don        D.C.Lindsay     Carnegie Mellon Computer Science
  49.