* Performance measurements
@ 1998-06-24 8:51 Martin Kahlert
1998-06-24 9:34 ` Robert Wilhelm
0 siblings, 1 reply; 4+ messages in thread
From: Martin Kahlert @ 1998-06-24 8:51 UTC (permalink / raw)
To: egcs; +Cc: axp-list
Hi,
i tried to compare different compilers on my numerical code.
Therefore i extracted a FPU intensive function and surrounded
it with a loop while measuring the execution time.
I will provide the source and the Makefile at the end of this mail.
I work on a Linux 2.0.34 SMP Kernel (libc5). My hardware is a
dual Pentium Pro 200MHz system with 128MB RAM.
pgcc is the portland group compiler and
tcc the free Tendra compiler system
(from http://alph.dera.gov.uk/TenDRA/)
Here are my results:
%> make
pgcc:
90.11 MFLOPS
gcc-2.7.2.1:
95.46 MFLOPS
gcc-without double align:
23.52 MFLOPS
egcs-2.91.42:
69.96 MFLOPS
tcc:
92.33 MFLOPS
- The difference -malign-double makes on gcc-2.7.2.1 is very
impressive. On egcs it doesn't change the result.
- egcs seems to produce worse code than gcc-2.7.2.1
- During my experience, pgcc produces very good code and is very
reliable. The code usually runs about 25% faster than egcs-code.
- For tcc i have to say, that the result is very dependent on the
order, you declare the variables:
If you put the declarations int i,j; and double *wksph=wksp+n/2;
in front of the one for c[], the result drops down to 24.70 MFLOPS.
For all other compilers, this doesn't make much difference.
Could anybody comment on that?
If anyone is interested in the asm code that pgcc produces, i
can send it offline (388 lines of asm statements are too
long for the list)
For the axp list: It would be very kind, if anybody could provide
some values for a Linux Alpha (e.g. 533MHz) for comparison.
Thanks in advance,
Martin
Here is the testfile m.c:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#define N 1024
void trafo(double *a,const int n,double *wksp,double *const ops)
{
double c[]={ 3.52262918857095333469e-02,
-8.54412738820266443041e-02,
-1.35011020010254584323e-01,
4.59877502118491543470e-01,
8.06891509311092547385e-01,
3.32670552950082631938e-01 };
int i,j;
double *wksph=wksp+n/2;
if(n<6)
return;
for(i=j=0;i<n/2-2;i++,j+=2)
{wksph[i]= c[0]*a[j]+c[1]*a[j+1]
+c[2]*a[j+2]+c[3]*a[j+3]
+c[4]*a[j+4]+c[5]*a[j+5];
wksp[i] = c[5]*a[j]-c[4]*a[j+1]
+c[3]*a[j+2]-c[2]*a[j+3]
+c[1]*a[j+4]-c[0]*a[j+5];
}
wksph[i]= c[0]*a[j]+c[1]*a[j+1]
+c[2]*a[j+2]+c[3]*a[j+3]
+c[4]*a[0]+c[5]*a[1];
wksp[i] = c[5]*a[j]-c[4]*a[j+1]
+c[3]*a[j+2]-c[2]*a[j+3]
+c[1]*a[0]-c[0]*a[1];
i++;j+=2;
wksph[i]= c[0]*a[j]+c[1]*a[j+1]
+c[2]*a[0]+c[3]*a[1]
+c[4]*a[2]+c[5]*a[3];
wksp[i] = c[5]*a[j]-c[4]*a[j+1]
+c[3]*a[0]-c[2]*a[1]
+c[1]*a[2]-c[0]*a[3];
memcpy(a,wksp,sizeof(double)*n);
(*ops)+=((double)11)*n;
return;
}
int main(int argc,const char *argv[])
{
double *x,h,ops=0;
int i;
clock_t start;
if(!(x=malloc(2*N*sizeof(double))))
{
fputs("out of memory\n",stderr);
return EXIT_FAILURE;
}
for(i=0;i<N;i++)
{
h=(double)i;
x[i]=sin(h*PI/(double)N);
}
start=clock();
for(i=0;i<10000;i++)
trafo(x,N,x+N,&ops);
h=(double)(clock()-start)/(double)CLOCKS_PER_SEC;
printf("%.2f MFLOPS\n",1.0e-6*ops/h);
free(x);
return 0;
}
And here is the Makefile:
EXECUTABLES = m.pgcc m.egcs-2.91.42 m.gcc-2.7.2.1 m.not_aligned m.tcc
GCC_OPTS = -O3 -malign-double -fomit-frame-pointer -Wall -malign-loops=2 -malign-jumps=2 -malign-functions=2
all: $(EXECUTABLES) test
clean:
rm -f $(EXECUTABLES)
test:
@echo "pgcc:"
@m.pgcc
@echo "gcc-2.7.2.1:"
@m.gcc-2.7.2.1
@echo "gcc-without double align:"
@m.not_aligned
@echo "egcs-2.91.42:"
@m.egcs-2.91.42
@echo "tcc:"
@m.tcc
m.pgcc: m.c
pgcc -O2 -tp p6 -Mnoframe -o $@ $< -lm
m.gcc-2.7.2.1: m.c
/usr/bin/gcc $(GCC_OPTS) -o $@ $< -lm
m.not_aligned: m.c
/usr/bin/gcc -O3 -fomit-frame-pointer -Wall -malign-loops=2 -malign-jumps=2 -malign-functions=2 -o $@ $< -lm
m.egcs-2.91.42: m.c
/sw/egcs/bin/gcc $(GCC_OPTS) -o $@ $< -lm
m.tcc: m.c
tcc -Ysystem -O2 -o $@ $< -lm
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Performance measurements
1998-06-24 8:51 Performance measurements Martin Kahlert
@ 1998-06-24 9:34 ` Robert Wilhelm
1998-06-24 19:54 ` Xsuse (Gloria X Server) Gavin
0 siblings, 1 reply; 4+ messages in thread
From: Robert Wilhelm @ 1998-06-24 9:34 UTC (permalink / raw)
To: axp-list; +Cc: martin.kahlert
> For the axp list: It would be very kind, if anybody could provide
> some values for a Linux Alpha (e.g. 533MHz) for comparison.
>
FWIW:
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
on a 533MHz LX Board:
$gcc -mcpu=ev56 -O3 -fomit-frame-pointer f.c -lm
$./a.out
163.47 MFLOPS
Robert
^ permalink raw reply [flat|nested] 4+ messages in thread
* Xsuse (Gloria X Server)
1998-06-24 9:34 ` Robert Wilhelm
@ 1998-06-24 19:54 ` Gavin
1998-06-24 20:50 ` B. James Phillippe
0 siblings, 1 reply; 4+ messages in thread
From: Gavin @ 1998-06-24 19:54 UTC (permalink / raw)
To: axp-list
Hi ,
i have the Gloria X Server up on my (erm well something like) homepage
Its called XF86_GLINT.gz on http://space4u.com/gavin/
regards
G. Woodhatch ..
PS And yes it should be an Alpha Linux Binary .. (but is un tested by
me)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Xsuse (Gloria X Server)
1998-06-24 19:54 ` Xsuse (Gloria X Server) Gavin
@ 1998-06-24 20:50 ` B. James Phillippe
1998-06-24 23:29 ` Chris Ingrassia
0 siblings, 1 reply; 4+ messages in thread
From: B. James Phillippe @ 1998-06-24 20:50 UTC (permalink / raw)
To: Gavin; +Cc: axp-list
On Wed, 24 Jun 1998, Gavin wrote:
> Hi ,
>
> i have the Gloria X Server up on my (erm well something like) homepage
Hello, I missed the start of this thread. What is the Gloria X Server and
how is it better/different than XFree86?
thanks,
-bp
--
B. James Phillippe <bryan@terran.org>
Linux Software Engineer, WGT Inc.
http://earth.terran.org/~bryan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Xsuse (Gloria X Server)
1998-06-24 20:50 ` B. James Phillippe
@ 1998-06-24 23:29 ` Chris Ingrassia
0 siblings, 0 replies; 4+ messages in thread
From: Chris Ingrassia @ 1998-06-24 23:29 UTC (permalink / raw)
To: axp-list; +Cc: Gavin
On Wed, 24 Jun 1998, B. James Phillippe wrote:
> On Wed, 24 Jun 1998, Gavin wrote:
>
> > Hi ,
> >
> > i have the Gloria X Server up on my (erm well something like) homepage
>
> Hello, I missed the start of this thread. What is the Gloria X Server and
> how is it better/different than XFree86?
Well, I was interested in it because it has support for the FireGL
1000 Pro, which XFree86 Does not.
And thank you everyone, it works like a charm :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-06-24 23:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.OSF.3.96.980624162614.2153O-100000@gchildstoy.unx.dec.com>
1998-06-24 21:33 ` Xsuse (Gloria X Server) Gavin
1998-06-24 8:51 Performance measurements Martin Kahlert
1998-06-24 9:34 ` Robert Wilhelm
1998-06-24 19:54 ` Xsuse (Gloria X Server) Gavin
1998-06-24 20:50 ` B. James Phillippe
1998-06-24 23:29 ` Chris Ingrassia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox