Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!ico!rcd From: rcd@ico.isc.com (Dick Dunn) Newsgroups: comp.arch Subject: 386 and ugliness Summary: ugly, yes, but... Message-ID: <1990May30.063658.11595@ico.isc.com> Date: 30 May 90 06:36:58 GMT References: <639@sibyl.eleceng.ua.OZ> Organization: Interactive Systems Corporation, Boulder, CO Lines: 46 ian@sibyl.eleceng.ua.OZ (Ian Dall) writes: >...Raises an interesting point. Mightn't the 386 lack of (many) registers > limit the potential gains from a global optimiser? This is sort of shooting-from-the-hip, but I think the few registers on the 386 and the many special-purpose uses of registers and special rules for registers tend to offer more possible gains from "serious" optimization. (Here, "serious" == "makes your stomach hurt to think about debugging the optimizer.":-) The straightforward approach to compilation for the 386 is to treat it as a single-accumulator machine, with (e)ax and (e)dx being of most interest. You either ignore the other registers or only use them in particular code sequences where definition and use are bounded by the particular chunk of code you're emitting; you consider them dead outside these little chunks. Relative to this simplistic approach, what a global optimizer might do with a lot more work is take account of the special uses of various registers and try to use them for intermediate/scratch values where possible. It's appealing because you can stay out of memory or off the stack more often. It's unappealing because it's hard to make a nice general model out of all the special cases. Also, gut reaction is that it's a lot of stuff that's only interesting for the 386. A more regular architecture doesn't need it. > ... I think it is the duty of > every knowledgable person to give Adam whatsisname's hand a little > nudge in the right direction when we can... Adam Smith's hand is moved by money! > ... People that > design elegantly deserve encouragement! Sure...all else being equal (which it never is). If I can buy a little elegance with a little more money, I'll buy it. Who knows; things might even work better in the long run. But if the 386 is so inelegant (which I don't question, BTW) and clumsy to work with, why is it so cost-effective? Why can't there be systems based on other processors that have something comparable to offer at the low end? (Yeah, we've been through all the stuff about marketing and IBM and DOS...but does elegance give an edge somewhere?) -- Dick Dunn rcd@ico.isc.com uucp: {ncar,nbires}!ico!rcd (303)449-2870 ...Simpler is better.