From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,b79a29863eb727e7 X-Google-Attributes: gid111c93,public From: cekim@ix.netcom.com Subject: Re: gcc vs Dec Unix c Date: 1998/01/14 Message-ID: <884827264.1906966540@dejanews.com>#1/1 X-Deja-AN: 316073897 References: 884291935.1575288842@dejanews.com> <694nm1$74c$1@news2.xs4all.nl> <884364975.2133262340@dejanews.com> <69h2g1$s4t@milo.mcs.anl.gov> To: cekim@ix.netcom.com X-Http-User-Agent: Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i686) X-Originating-IP-Addr: 207.93.163.71 (nas-nh3-07.ix.netcom.com) Organization: Deja News Posting Service X-Authenticated-Sender: cekim@ix.netcom.com X-Article-Creation-Date: Thu Jan 15 01:21:05 1998 GMT Newsgroups: comp.os.linux.alpha In article <69h2g1$s4t@milo.mcs.anl.gov>, Donald K.Sinclair wrote: > I decided to try your test on my 600Mhz Alpha PC164LX in fortran rather than > C. I performed the test in both 32 and 64 bit precision. The 64 bit version of > the code I ran (costest.f) was: > real*8 x,y > x=1.2345d0 > y=0.567d0 > do 1 n=1,100000000 > x=x+0.001d0 > y=y+dcos(x) > The egcs/g77 code took 50.7 seconds to execute in 32bit arithmetic and 51.4 > seconds in 64 bit arithmetic (does this mean that their 32bit cos routine > actually uses the 64bit routine?). > Perhaps the suggestion made by others that fortran is the language of choice > is correct. just for kicks (533LX): #include #include main() { long i=0; float X,Y; int min=0,sec=0; X=1.9088848; Y=.354256; time_t tyme1,tyme2; printf("\nSTART\n"); time(&tyme1); for(i=0;i<100000000;i++){ X=X+0.00464; Y=(Y)+cos(X); } time(&tyme2); printf("X=%f Y=%f",X,Y); printf("\nTotal loops %d",i); min=(tyme2-tyme1)/60; //Why waste time figuring out a more elegant way?? sec=(tyme2-tyme1)-(min*60); printf("\n%d Min, %d sec\n",min,sec); printf("\nDone\n"); } *********** START X=131072.000000 Y=1048576.000000 Total loops 100000000 1 Min, 0 sec DONE *********** Obviously the above is not meant to be the pinnacle of pretty C code, nore am I concerned that I chopped off the fractional portion of the answer in the printout. :) When competing against an intel chip(the original intention of this bench) accuracy is not the most important thing ;) So, with ECGS/G77 we have a marginal improvement when using 1:1(at least close to 1:1) code in Fortran. How much of that is 533 vs 600MHz?? I am guessing something less than 10%, but that puts it very close. Note that we have large numbers here again with respect to the exponent of the floating point number. It would seem that the performance hit of keeping track of your 2*pi's and keeping the numbers in small radians is well worth it with long repetative use of the cos() The microway compiler does show some very interesting results in Fortran :) /Mike -------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to Usenet