Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!hc!lanl!beta!jlg From: jlg@beta.lanl.gov (Jim Giles) Newsgroups: comp.arch Subject: Compiler complexity (was: VAX Always Uses Fewer Instructions) Keywords: RISC CISC Message-ID: <20338@beta.lanl.gov> Date: 17 Jun 88 18:07:48 GMT References: <6921@cit-vax.Caltech.Edu> <28200161@urbsdc> <10595@sol.ARPA> <8717@lll-winken.llnl.gov> Organization: Los Alamos National Laboratory Lines: 35 In article <8717@lll-winken.llnl.gov>, brooks@maddog.llnl.gov (Eugene D. Brooks III) writes: > [...] > If main memory, and in particular shared memory in a multiprocessor, is > 20 to 40 clocks away having eighty or so registers with fully pipelined > memory access is really a whole lot faster. Any machine with fully pipelined memory access is faster (registers or not). This discussion brings up a question about the actual use of CISC instructions. It seems that RISC vs. CISC is probably about a draw for raw compute speed of special coded sequences. The question is: how many programs actually get full advantage from the large instruction sets offered by CISC? A few years back, I did site maintenance on a CFT compiler (Fortran on the Cray). I used the experience as a opportunity to learn about the present state of compiler technology (CFT is very archaic, but I wanted to learn the whole business). At that time, the technology simply wasn't able to automatically produce a good code generator (compiler 'backend'). This meant that code generators always had to be hand-made routines with lots of ad hoc ideas involved. The bottom line was: it was simply EASIER to write a code generator for a RISC-like machine than for a CISC. (To be sure, some source-level constructs could be turned directly into CISC instructions. But this simplistic approach produces very inefficient code. The famous case is the VAX polynomial instruction - a tight loop of simple instructions was ALWAYS faster than the sequence for the single instruction. A simplistic code generator might be easier to write, but it produces unacceptably bad code.) In more recent years, has the state of the compiler art improved so that good code generators for CISC machines can be built easily? Or is it still a hit or miss operation? Do modern compilers for CISC make good use of the variety in the instruction set? J. Giles Los Alamos