From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public From: michael.williams@arm-sponge.com (Michael Williams) Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/13 Message-ID: <61tfaa$9fr@sis.cambridge.arm.com>#1/1 X-Deja-AN: 280155697 X-Disclaimer: This posting does not express the views of Advanced RISC Machines Limited, unless explicitly stated. References: <61g30t$o2n@news-rocq.inria.fr> <343C34A7.B715A348@tonys.ecology.umn.edu> <3440F805.C98BB347@tonys.ecology.umn.edu> X-Address: 90 Fulbourn Road, Cherry Hinton, Cambridge, CB1 4JN, UK Organization: Advanced RISC Machines Ltd X-Note: Remove the word "sponge" from my email address before replying Reply-To: michael.williams@arm-sponge.com Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec In article <3440F805.C98BB347@tonys.ecology.umn.edu>, boo wrote: >I did not say there was ONE efficient way. If you are just looking >for ONE efficient way, then perhaps you should stick with Fortran. >As I said before, Fortran is for the lazy, the feeble-minded, >the incompetent, and for those who aren't doing anything beyond >simple-minded number crunching. I've tried to read both sides of the argument in this thread so far. As far as I can tell, the argument is that, whereas it is possible to do multi-dimensional arrays in C, it's not possible to deal with them efficiently, if you write the 'natural' code. In fact, my reading of it - and I have to admit it's not something I'd considered before - is that the problem is largely to do with arrays in general, rather than multidimensional. The problem with using a construct such as array[i*(x*y) + j*y + k] (via, say, a macro), compared to array[i][j][k] is the latter is undefined if i, j, or k is out of range, whereas the former isn't. (It may be in your application, but the compiler can't assume this.) The compiler could use that information to improve the dataflow through your program. Without it you have to jump through hoops, in C, to get a similar result. Hoops which probably vary from machine to machine. The other part of the argument probably centers around the way the various Fortran advocates[1] seem to know what they're talking about, whilst being insulted and derided by their opponents. I don't know about the intel and dec groups, but it's a bit out of place on comp.arch. Mike[2]. [1] Actually, I suspect many of them are just experienced programmers. [2] Never written a large numerical processing program in his life; C programmer; managed to avoid Fortran completely for the past 6 1/2 years.