Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!pur-ee!mentor.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.arch Subject: Re: RISC vs. CISC Summary: Silicon is cheap, subroutines are expensive. Message-ID: <1359@l.cc.purdue.edu> Date: 25 Jun 89 11:01:28 GMT References: <57125@linus.UUCP> <1989Jun24.230056.27774@utzoo.uucp> Followup-To: comp.arch. Organization: Purdue University Statistics Department Lines: 53 In article <1989Jun24.230056.27774@utzoo.uucp>, henry@utzoo.uucp (Henry Spencer) writes: > In article <57125@linus.UUCP> bs@gauss.UUCP (Robert D. Silverman) writes: > >This, in my opinion is one of the major faults of RISC processors. They > >do not provide basic arithmetic instructions. > > When the list of "basic" arithmetic instructions is pages long, one starts > to wonder how many of them are really "basic". The instruction you ask > for -- divide double length by single length yielding single-length result -- > is not exactly frequently needed. Just how much silicon is it worth to make > it run faster than an implementation as a subroutine? The list of arithmetic instructions is pages long only if the documentation is stupid enough not to put lots of instructions on one page. What is used heavily in his work, reported in sci.math., is division of a double by a single getting simultaneously quotient and remainder. This takes about 6 or 7 instructions inline if some provisions are made. If they are not, it may very well take 20 instructions. One might reduce the number of division instructions by only having double/single yielding quotient and remainder for integer division, signed and unsigned, and floating point division similarly, signed only. This would give three division instructions with different argument sizes, and the only "waste" would be in the moving of unwanted results to an unused register. Even this could be avoided if there were read-only registers, which many machines have. Instead, many machines have separate quotient and remainder operations. Now Bob Silverman is one of the mathematicians who knows how to use the machine instructions efficiently, and absent the instruction, will modify the algorithm considerably to get around it. This is one of the things which does not show up on benchmarks. The presence or absence of a few "minor" instructions can make an algorithm efficient or horribly inefficient. Also, the cost of the entire ALU is typically dwarfed by the costs of memory, IO, etc. Silicon is cheap. Mathematicians have been rightly accused of not sufficient use of computers. It is not the case that fixed-length floating-point operations are what is needed. Multiple precision arithmetic requires good integer arithmetic. There are operation counts and there are operation counts. Is there essentiallyone integer sum, or are there several? I have advocated an integer quotient and remainder with the choice of truncation depending on the signs of the arguments. Is this one instruction or 2^n, where n is between 8 and 16? I consider it one; the tag field can be decoded by the arithmetic unit, not by the control unit. We can get much more at little extra cost, and flexibility is cheap. The same holds for languages. But once the instruction is omitted, it can be expensive to do anything about it. . -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)