Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: cekim@ix.netcom.com
To: cekim@ix.netcom.com
Subject: Re: gcc vs Dec Unix c
Date: 1998/01/14	[thread overview]
Message-ID: <884827264.1906966540@dejanews.com> (raw)
In-Reply-To: 69h2g1$s4t@milo.mcs.anl.gov


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



  parent reply	other threads:[~1998-01-14  5:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-08  5:00 gcc vs Dec Unix c fonte
1998-01-09  5:00 ` Toon Moene
1998-01-09  5:00 ` Jaap Schellekens
1998-01-09  5:00   ` cekim
1998-01-09  5:00     ` Peter Mardahl
1998-01-09  5:00       ` Craig Burley
1998-01-10  5:00       ` cekim
1998-01-10  5:00         ` Craig Burley
1998-01-13  5:00           ` cekim
1998-01-13  5:00             ` Craig Burley
1998-01-13  5:00               ` James Van Buskirk
1998-01-14  5:00                 ` brianh
1998-01-14  5:00                   ` James Van Buskirk
1998-01-13  5:00               ` [++] x86 FCOS (Was: Re: gcc vs Dec Unix c) Terje Mathisen
1998-01-13  5:00                 ` Andy Glew
1998-01-14  5:00                   ` Terje Mathisen
1998-01-13  5:00             ` gcc vs Dec Unix c Yan-Song Chen
1998-01-13  5:00               ` Greg Lindahl
1998-01-15  5:00               ` Lupo LeBoucher
1998-01-15  5:00                 ` Greg Lindahl
1998-01-13  5:00             ` Rob Komar
1998-01-14  5:00             ` bmeyer
1998-01-15  5:00               ` cekim
1998-01-14  5:00     ` Donald K.Sinclair
1998-01-14  5:00       ` Rob Komar
1998-01-16  5:00         ` Torbjorn Lindgren
1998-01-17  5:00           ` Rob Komar
1998-01-14  5:00       ` cekim [this message]
1998-01-09  5:00 ` Toon Moene
1998-01-09  5:00 ` Toon Moene
  -- strict thread matches above, loose matches on Subject: below --
1998-01-13  5:00 Robert Harley
1998-01-14  5:00 ` cekim
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox