Xref: utzoo comp.sys.mac:11249 comp.sys.amiga:13351 Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!nrl-cmf!ames!oliveb!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.mac,comp.sys.amiga Subject: Re: Code Optimization Message-ID: <39879@sun.uucp> Date: 25 Jan 88 18:08:18 GMT References: <4776@watdragon.waterloo.edu> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Distribution: comp Organization: Sun Microsystems, Mountain View Lines: 36 In article <4776@watdragon.waterloo.edu> (Paul Larson) writes: > Currently, single pass compilers are very popular, due to their speed. This > speed allows the development cycle to be shortened, sometimes by very > significant amounts. However, unless I'm very wrong, the speed of the > single pass compiler is gained at the expense of code quality. One > immediately obvious solution is a code optimizer, which could be used on a > compiled program once the critical debuggion is done. ... > ... Thus, if a > system is using the more advanced '020, it is using code which was written for > a more primitive, though similar, processor and thus the code does not take > proper advantage of the more advanced features of the more modern processors. > The same agrument applies for the math co-processors, the 68881 and its new > sibling the 68882, which are rapidly becoming more popular on home computers. Interesting point Paul, a couple of comments : On the Amiga the Lattice C compiler optimizes to use code that would be faster on the '010 - '020 by using instructions, like dbra, that take advantage of the caching aspects of these chips. Since this does not impose a penalty on the 68000 code it seems to be a good optimization choice. And yes, incremental and single pass compilers cannot implement some optimization schemes but they are fast at compiling. So they are really good for prototyping. Thus I think a more reasonable solution would be to have, in effect, two compilers living in the same executable. One the incremental compiler, the other a multipass optimizing compiler. Then you offer the user a choice of which mode to compile the program in. I believe this is the approach that Microsoft has taken with Quick-C. Claiming that it is 100% code compatible with their regular C compiler, so that once you have a working program you can recompile with their regular compiler to get optimized, space efficient code. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.