Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!rbbb.Eng.Sun.COM!chased From: chased@rbbb.Eng.Sun.COM (David Chase) Newsgroups: comp.arch Subject: Re: What the compiler won't do you for you Message-ID: <8728@exodus.Eng.Sun.COM> Date: 27 Feb 91 02:02:26 GMT References: <10278@dog.ee.lbl.gov> <22605:Feb2608:04:5391@kramden.acf.nyu.edu> <8658@exodus.Eng.Sun.COM> <6521:Feb2621:31:1491@kramden.acf.nyu.edu> Sender: news@exodus.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 42 1) I prefer David, not Dave. 2) My time is still better spent doing general-purpose optimizations. 3) For hysterical reasons, an optimizer pre-mutilates the code, so idioms may get transformed beyond recognition in a context-dependent way. 4) There is ALREADY a tool that will do most of what you want. Say "man inline" on some nearby Sun machine running a recent rev of the operating system. "f77 -v -fast ..." might provide some guidance. Given that an 80% solution exists, that makes solving the problem again even less profitable. 5) Any "idiom" designed to trigger use of a specific instruction may be portable for correctness, but it will not be portable for speed in future releases of the compiler unless care is taken. Verifying that it continues to provide the same function originally promised to customers may well take more time than it took to add it in the first place. 6) Since we have a multi-language optimizer, we might choose to do it for some language other than C first. Fortran comes to mind. >> If you must (and some people must), >> then use something based on subroutine calls. > >That's fine. ``If you write the following routine: int sumones(x) int x; >{ int a; int b; } then our optimizer will convert any >call to sumones() into a CX instruction. 7) No, it is simpler to use the existing inliner tool to inline assembly language, and the results are more certain. If there tremendous demand, it goes into a library. Portable into the future, and not dependent on the behavior of the optimizer. 8) Need is demonstrated with dollars. Other people back up their requests (sometimes unreasonable requests) with dollars, so they get serious attention paid to them. David Chase Sun Brought to you by Super Global Mega Corp .com