Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmum.UUCP Path: utzoo!watmath!watnot!watmum!cdshaw From: cdshaw@watmum.UUCP (Chris Shaw) Newsgroups: net.micro.68k,net.arch Subject: Re: FLAME!!! Re: EA orthogonality Message-ID: <135@watmum.UUCP> Date: Mon, 27-May-85 05:11:38 EDT Article-I.D.: watmum.135 Posted: Mon May 27 05:11:38 1985 Date-Received: Wed, 29-May-85 01:33:44 EDT References: <419@oakhill.UUCP> <6415@boring.UUCP> <557@terak.UUCP> <6417@boring.UUCP> <572@terak.UUCP> Reply-To: cdshaw@watmum.UUCP (Chris Shaw) Organization: U of Waterloo, Ontario Lines: 64 Xref: watmath net.micro.68k:806 net.arch:1259 >The purpose of a CPU is *NOT* to be as easy to write a compiler for as >possible. > All right then, what IS the purpose of a CPU?? It would seem to me that the purpose of a CPU is to run programs. The purpose of a well-designed instruction set is to make it as easy to program as possible without sacri- ficing performance. Now, it also seems to me that an intelligent CPU design takes into account the types of programs that will run on it. Thus, it's obvious that the 8035 was never designed to be anything more than a controller. When designing the 32032 then, the kind of programs the designers of the chip had in mind were those that would be created by high-level languages. Thus, they made the instruction set as easy as possible to write compilers for. Obviously, orthogonality doesn't matter quite so much on a controller, where the programmer is a human, not a program. On a general-purpose CPU, however, most programs will be created by programs (compilers), so it makes sense to tailor the instruction set to its intended programmers. Anybody who has written a compiler will tell you that ortho machines are easier to write compilers for. It's a simple fact that has been true since day 1. The benefits of programs that are easy to write vs hard to write are as follows: 1) Productivity of the programmer is much higher. Despite Mr. Trissel's comments, compiler writers are harder to come by than (say) COBOL programmers, and are therfore more expensive. Simply asking for better programmers doesn't solve this problem. Therefore, the more productive your programmers, the better. Of course, if the market for 8035 C compilers is twice that for 68000 C compilers, then maybe start writing 8035 stuff, but that's another matter entirely. 2) Program correctness (lack of compiler bugs). All things being equal (which they aren't), a compiler for a weird machine produced from N man-months of labour will be generally less right than that for an ortho machine. This point is really an outgrowth of productivity. Almost as importantly, an ortho compiler will be easier to maintain and fix bugs for than for a non-ortho machine, since there is no complicated register-assignment algorithm, etc... 3) Object code speed. Given that a CPUs x and y have the same hardware, but different instruction sets (2 microcode sets, say), compiler code produced for the ortho version is most likely going to be faster, since special-purpose register decisions are not reflected in the code. In other words, non-orthogonality generates superfluous moves that would probably not be necessary in an ortho machine. This point is true whether the code is compiler or human produced. The lack of a general reg-to-reg add on the Z80 is cause for much wasted reg-to-reg MOVs, (or worse) reg-to-memory MOVs, for example. >I think it makes more sense to take compiler-writing seriously, rather >than try to kludge the CPU so that every basement hacker can write what >he calls a "compiler". >-- >Doug Pardee -- Terak Corp. -- !{ihnp4,seismo,decvax}!noao!terak!doug I think this point is ripe nonsense. The bit which grabs me worse, of course, is the twisted use of the word "kludge". And as for this garbage about basement hackers, well.... (I guess it's time to go upstairs for a beer & mellow out :-) Chris Shaw watmath!watmum!cdshaw or cdshaw@watmath University of Waterloo In doubt? Eat hot high-speed death -- the experts' choice in gastric vileness !