Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site uthub.UUCP Path: utzoo!utcsri!utai!uthub!thomson From: thomson@uthub.UUCP (Brian Thomson) Newsgroups: net.micro.68k,net.arch Subject: Re: FLAME!!! Re: EA orthogonality Message-ID: <210@uthub.UUCP> Date: Wed, 29-May-85 16:30:02 EDT Article-I.D.: uthub.210 Posted: Wed May 29 16:30:02 1985 Date-Received: Mon, 3-Jun-85 13:05:28 EDT References: <419@oakhill.UUCP> <6415@boring.UUCP> Organization: CSRG, University of Toronto Lines: 46 Xref: utai net.micro.68k:514 net.arch:868 Chris Shaw writes about orthogonality: >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. >On a general-purpose CPU, ... most programs will >be created by programs (compilers), so it makes sense to tailor the instruction >set to its intended programmers. In my experience, the difficulty of (decent) compiler construction is affected less by orthogonality than by the number of code sequences that must be considered when implementing a given source language construct. The C statement a = b * c + d + e; might, in different contexts be implemented on your 32032 as: movd _b,r0 muld _c,r0 addd _d,r0 addd _e,r0 movd r0,_a or, if c is the constant 2, d a stack local, and e the constant 4, movd _b,r0 addr 4(-4(fp))[r0:w],_a or even, if b, c, and d are all unsigned shorts, and e == b, movzwd _b,r0 indexw r0,_c,_d ; b * (c+1) + d movd r0,_a Does that last one look ridiculous? That's exactly my point: it's the best code sequence under the given set of assumptions, and no compiler would ever find it. If these fancy addressing modes and high-level language oriented instructions could be added without penalizing the performance of bread-and-butter instructions, I'd be all for it, but such is never the case. If a machine forces me to put something in a data register before I can add to it, and has no exceptions to this rule, it will be easy to generate code. It only gets tough when there are options. -- Brian Thomson, CSRI Univ. of Toronto {linus,ihnp4,uw-beaver,floyd,utzoo}!utcsrgv!uthub!thomson