hartman@uiucdcsm.cs.uiuc.edu (06/17/88)
[Sorry, yet another tangent. Oh well...] chris@mimsy.UUCP writes: > /* ---------- "Re: The VAX Always Uses Fewer Instr" ---------- */ > In article <10595@sol.ARPA> crowl@cs.rochester.edu (Lawrence Crowl) writes: > >For example, the loop to add two vectors into a third on the VAX is: > > > > top: addl3 (rA)+, (rB)+, (rC)+ > > sobgeq rD, top > > > >which takes seven bytes for two instructions. > > True. An optimising compiler might expand the loop, however: > . . . > This drops off 9 bytes, down to 61 bytes. You can get rid of 5 more > bytes by changing the acbl into > > subl2 $8,rD > bgeq 0b > > but on non-pipelined VAXen that might be slower. Alternatively, if you ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I am not willing to speak for that imparticular example, but in general, the statement is quite plausible. For a (somewhat extreme) example of what architectual differences in VAXen can do to optimizations, etc., examine the following code fragments: INDEX SUB, LOW, HIGH, SIZE, IXIN, IXOUT vs. CMPL HIGH, SUB BLSSU ERROR CMPL SUB, LOW BLSSU ERROR ADDL3 IXIN, SUB, IXOUT MULL2 SIZE, IXOUT Instruction Execution Time (usec) Code Size MicroVAX II 11/785 8650 (bytes) ----------- ----------- ------ ---- --------- INDEX 9.62 6.86 1.67 13 series of 6 11.70 4.84 2.34 26 Relative -21.6% 29.4% -40.1% Difference A 40% slower sequence of instructions on the 8650 that runs almost 30% faster on a 11/785! This is an extreme example, which I ran about a year ago. Other, less striking diffences in architecture implementation can be seen with comparisons of SOBGTR vs DECL,BGTR or similar things. This particular example can probably be best examined by looking at the differences in the 11/785 and 8650 pipelines and how they handle the decoding of operands. > > All of this just goes to show that the VAX provides too many ways to > do things! Couldn't agree more! :-) Not only does the instruction set (architecture) provide a myriad of choices, but different implementations of the architecture can also vastly affect the space/time tradeoffs. (my sympathies to the compiler writers...) -- Mark Hartman hartman@a.cs.uiuc.edu ..ihnp4!uiucdcs!hartman