Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!unm-la!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.arch Subject: Re: In defense of the VAX Message-ID: <9620@lanl.gov> Date: 22 Feb 89 20:05:25 GMT References: <2324@scolex.sco.COM> Organization: Los Alamos National Laboratory Lines: 38 From article <2324@scolex.sco.COM>, by seanf@sco.COM (Sean Fagan): > [...] Not providing an instruction can > cause the compiler writers to throw their hands up in the air (watch me, > sometime, when I take a look at the 370 instruction set), while providing > excess instructions can (and usually do) slow the machine down. > I disagree here. A larger instruction set actually makes compiler writing HARDER - not easier. The back-end of a compiler on a RISC machine has only one function - register allocation. A 'pure' RISC machine executes all instructions in one cycle, so no pipelining optimizations are possible. In addition, instruction selection on a RISC machine is trivial - each high level construct maps onto a unique machine instruction sequence - a code skeleton. Suppose you have a RISC-like machine in which the instructions are not all one cycle, but different instructions use different functional units. Now the compiler back-end must do pipelining optimizations as well as register allocation. These two types of activity feed back into each other. Changing instruction order for pipelining may make the register allocation non-optimal. Changing register allocation can make pipelining non-optimal. But, at least the instruction selection is still easy. On a CISC, instruction selection is HARD!! Not only that, it feeds back into the other two problems in a complex way. Changing instructions almost always alters both the pipelining and the register allocation needs. Changing these others may make a different instruction selection desireable. In short, by introducing a larger instruction set, you have increased the code generation complexity in a significant way. To be sure, writing a 'simple' compiler presents none of these problems. A simple compiler doesn't bother to try to generate optimized code or to select the optimal instruction sequence or to use registers efficiently. In this case (and ONLY in this case) the addition of more instructions may be useful to the compiler writer (who may feel it's a waste of time creating code skeletons). J. Giles Los Alamos