Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!titan.rice.edu!preston From: preston@titan.rice.edu (Preston Briggs) Newsgroups: comp.arch Subject: Re: F.P. vs. arbitrary-precision Message-ID: <1990Sep10.170652.21454@rice.edu> Date: 10 Sep 90 17:06:52 GMT References: <6837.26e7ee92@vax1.tcd.ie> <1660@s6.Morgan.COM> <1990Sep10.162839.19226@cs.rochester.edu> Sender: news@rice.edu (News) Organization: Rice University, Houston Lines: 23 In article <1990Sep10.162839.19226@cs.rochester.edu> crowl@cs.rochester.edu (Lawrence Crowl) writes: >In article <1660@s6.Morgan.COM> amull@Morgan.COM (Andrew P. Mullhaupt) writes: >>Some machines (like i486, RS/6000) have integer multiplies and some (SPARC) >>do not. Now the compilers of the world can get rid of integer multiplies in >>address arithmetic _if_ they can figure out the sizes of the arrays. > >This is incorrect. Compilers can get rid of integer multiplies (actually >implement them as shifts and adds) when the sizes of the array ELEMENTS are >known. > >>This isn't trivial when the array may be a formal parameter (i.e. the size >>may not be fixed). A great deal of code uses this kind of function argument. >>(Nearly all of numerical linear algebra, a great deal of optimization...) It doesn't matter too much. Strength reduction will eliminate multiplies of loop induction variables by loop invariants (which include formal parameters and such). Generally, this is superior to the shift-and-add trick anyway. SR won't help so much outside of loops. -- Preston Briggs looking for the great leap forward preston@titan.rice.edu