From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110292,3e10dbc776740ba1 X-Google-Attributes: gid110292,public X-Google-Thread: fb9cd,3e10dbc776740ba1 X-Google-Attributes: gidfb9cd,public X-Google-Thread: f57db,3e10dbc776740ba1 X-Google-Attributes: gidf57db,public X-Google-Thread: 1164f8,3e10dbc776740ba1 X-Google-Attributes: gid1164f8,public From: gwelsh@insystems.com.remove-this (Geoffrey Welsh) Subject: Re: A portable benchmark for ANSI C compilers, Windows NT and MPP supercomputers. Date: 1997/03/13 Message-ID: <5g9die$oa3@news1.pritel.net>#1/1 X-Deja-AN: 225236047 References: <5g120v$312@news-rocq.inria.fr> Organization: InSystems Technologies Inc. Reply-To: gwelsh@insystems.com Newsgroups: comp.benchmarks,comp.sys.intel,comp.sys.dec,comp.os.ms-windows.nt.misc (posted and mailed) On 10 Mar 1997 13:23:43 GMT, in comp.os.ms-windows.nt.misc, harley@pauillac.inria.fr (Robert Harley) wrote: >Why do people so frequently write code with an Intel model (or >whatever) in mind, then compile it on Alpha without even putting in >the slightest effort to adapt it and then claim that their CPU can >beat an Alpha? I have seen this several times and in each case that >source was available it was trivial to make even a medium Alpha win by >a wide margin. > >Presumably this happens to other way around too i.e., people write >code assuming that lots of big registers are available and then it >crawls when naively ported to an Intel processor. Because the compiler is supposed to take care of those details. If you want to control every last detail of the machine code, write in assembler... or just accept that this is a compromise of writing in a 'portable' high-level language! The default variable qualifier in C is "auto", i.e. put it in a register if you can; even "register" is only a recommendation and, if I take code with too many "register" definitions, an Intel-based compiler should 'demote' as many of them as necessary... only the "volatile" qualifier should have absolutely guaranteed performance (the fact that older MS compilers ignored the keyword entirely notwithstanding). Similarly, how frequently accessed constants (which is what I think you tweaked) are best handled on any given architecture should also be up to the compiler. These days programmers seem to be in such a rush to bring features to market that they don't have time to remove the bugs first; how many have the time to figure out whether they're saving cycles or wasting them on umpteen different architectures when using more registers and increasing the number that must be saved in entry/exit code?!? --- Geoffrey Welsh, MIS Co-ordinator, InSystems Technologies Inc.: gwelsh@insystems.com UNSOLICITED ADVERTISING TO THIS ADDRESS IS STRICTLY FORBIDDEN.