home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!rbbb.Eng.Sun.COM!chased
- From: chased@rbbb.Eng.Sun.COM (David Chase)
- Newsgroups: comp.arch
- Subject: Re: 32 => 64 Transition
- Message-ID: <l8j0qkINNikb@exodus.Eng.Sun.COM>
- Date: 12 Aug 92 21:32:04 GMT
- References: <342@moene.indiv.nluug.nl> <1992Aug10.220711.38122@cs.cmu.edu> <l8gi9jINNaad@exodus.Eng.Sun.COM> <1992Aug12.155317.27437@bcars64a.bnr.ca>
- Organization: Sun Microsystems, Mt. View, Ca.
- Lines: 56
- NNTP-Posting-Host: rbbb
-
- chased@rbbb.Eng.Sun.COM (David Chase) writes:
-
- >>Howsabout the *debuggers* do it [map page zero not readable],
- >>not the OS? (I don't see anyone clamoring to have the OS check
- >>all array indices for validity. What's the difference?)
- >>There are some completely dandy optimizations that
- >>rely on being able to read zeros from page zero.
-
- schow@bqneh3.bnr.ca (Stanley T.H. Chow) writes:
-
- >Is there a language standard that specifies this (zeros from page zero)?
- >Seems like a rather curious spec.
-
- No, it's not a language spec, it's an implementation technique. Sort
- of like have an "add" instruction on your machine -- helpful, but not
- required. This lets you do a slightly better job of pipelining loops
- of the form
-
- while (p != 0 && p -> data != K) p = p -> next;
-
- Again, see the paper by Hendren and Hummel in this year's PLDI.
-
- >Even if you specify that only the compiler is allowed to make this
- >assumption, how do you prevent user code from doing this?
-
- You don't. Compilers compile all manner of stupid buggy programs
- without complaint -- why should an exception be made for this bug?
-
- >How about user code that inadverdently do this?
-
- You don't. See above.
-
- >Don't you want the user code to trap?
-
- No, not if it makes the code run significantly slower. Again, compare
- this with array indexing tests (which, by-the-way, can often be nicely
- optimized in the compiler to reduce their cost). If I want tests, I
- ask for them, and I expect them to be done. If I want speed, I ask
- for it, and I expect to get it. If I want both, I expect to get some
- compromise. In practice, most of the programs that I run don't
- indirect through zero, so I'd rather that they ran faster. Even when
- they do indirect through zero, my first reaction is not
-
- "Wow, I'm sure glad my window-system fell over."
-
- (Yes, I'm aware of the dangers of continuing to run in a damaged
- state. Which is, of course, why we all write programs in C, right?
- :-) Checking is important, but we have clearly chosen to compromise
- some amount of checking for speed and convenience.)
-
- I'd much rather that the people writing the program use better tools
- and take more care; after that, I'm not really interested in
- discovering their bugs.
-
- David Chase
- Sun
-