Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!iuvax!news!liszt!przemek From: przemek@liszt.helios.nd.edu (Przemek Klosowski) Newsgroups: comp.arch Subject: Re: F.P. vs. arbitrary-precision Message-ID: <411@news.nd.edu> Date: 11 Sep 90 13:29:10 GMT References: <3755@osc.COM> <4513@taux01.nsc.com> <119244@linus.mitre.org> <6837.26e7ee92@vax1.tcd.ie> <1660@s6.Morgan.COM> <1990Sep10.162839.19226@cs.rochester.edu> Sender: news@news.nd.edu Organization: University of Notre Dame, Notre Dame Lines: 21 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: >>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. > Lawrence Crowl 716-275-9499 University of Rochester I think that Lawrence misunderstood Andrew. You DO need to know the size of array if you want to do multidimensional arrays (actually you need to know the all but the last dimensions of a matrix). For instance, assuming A as 10x10x10x10x10 matrix, stored 'column-first' with indices running from 0, address of A[1,2,3,4,5] is A+2*10*3*100+4*1000+5*10000 -- przemek klosowski (przemek@ndcva.cc.nd.edu) Physics Dept University of Notre Dame IN 46556