* Performance measurements
@ 1998-06-24 8:51 Martin Kahlert
1998-06-24 9:34 ` Robert Wilhelm
` (4 more replies)
0 siblings, 5 replies; 35+ 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] 35+ 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
1998-06-24 10:32 ` Performance measurements Stefan Schroepfer
` (3 subsequent siblings)
4 siblings, 1 reply; 35+ 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] 35+ 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; 35+ 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] 35+ 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; 35+ 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] 35+ 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; 35+ 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] 35+ 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 10:32 ` Stefan Schroepfer
1998-06-24 10:48 ` Martin Kahlert
1998-06-24 15:49 ` David S. Miller
` (2 subsequent siblings)
4 siblings, 1 reply; 35+ messages in thread
From: Stefan Schroepfer @ 1998-06-24 10:32 UTC (permalink / raw)
To: axp-list
Martin Kahlert wrote:
> [...]
>
> I work on a Linux 2.0.34 SMP Kernel (libc5). My hardware is a
> dual Pentium Pro 200MHz system with 128MB RAM.
My results are for Kernel 2.0.30, glibc 1.99 (RedHat 4.2),
gcc 2.7.2.1, PC164LX (2MB Cache), 21164 @ 600MHz, 256MB RAM.
> [...]
> Here are my results:
> %> make
> gcc-2.7.2.1:
> 95.46 MFLOPS
> [...]
$ make
/usr/bin/gcc -O3 -Wall -o m.gcc m.c -lm
gcc-2.7.2.1:
187.86 MFLOPS
Hmmm, only twice as fast as a PPro 200. Most of my floating
point stuff shows a bigger difference in performance.
Remarks:
1) These -malign-xxx options are Intel only.
2) I had to patch your sources (where is 'PI' defined in
your headers ?):
66c66
< x[i]=sin(h*PI/(double)N);
---
> x[i]=sin(h*M_PI/(double)N);
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-24 10:32 ` Performance measurements Stefan Schroepfer
@ 1998-06-24 10:48 ` Martin Kahlert
1998-06-24 11:06 ` Martin Høy
` (3 more replies)
0 siblings, 4 replies; 35+ messages in thread
From: Martin Kahlert @ 1998-06-24 10:48 UTC (permalink / raw)
To: axp-list; +Cc: scr
Quoting Stefan Schroepfer (scr@iis.fhg.de):
> Martin Kahlert wrote:
> > [...]
> >
> > I work on a Linux 2.0.34 SMP Kernel (libc5). My hardware is a
> > dual Pentium Pro 200MHz system with 128MB RAM.
>
> My results are for Kernel 2.0.30, glibc 1.99 (RedHat 4.2),
> gcc 2.7.2.1, PC164LX (2MB Cache), 21164 @ 600MHz, 256MB RAM.
>
> > [...]
> > Here are my results:
> > %> make
> > gcc-2.7.2.1:
> > 95.46 MFLOPS
> > [...]
>
> $ make
> /usr/bin/gcc -O3 -Wall -o m.gcc m.c -lm
> gcc-2.7.2.1:
> 187.86 MFLOPS
>
> Hmmm, only twice as fast as a PPro 200. Most of my floating
> point stuff shows a bigger difference in performance.
All the other helpful people, who provided info so far have
similar values.
Thanks a lot!
I thought, these convolution stuff should run like a champ
on Alpha. But since even Digital's Compiler can't do much
here, i think it's not egcs/gcc's fault.
(Alex Rhomberg reported for a 500MHz Alpha:
"DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564) 168.97 MFLOPS")
Perhaps there could be done some tuning for memory
access on Alphas? But: all arrays should fit in the cache -
don't they?
There should be higher MFlops possible on these machines.
Perhaps the factor two results from the fact, that there can't
be done much more improvement on Intel chips any more.
100MFLOP are one mult/add every second cpu cycle on a 200MHz
machine.
>
> Remarks:
> 1) These -malign-xxx options are Intel only.
> 2) I had to patch your sources (where is 'PI' defined in
> your headers ?):
> 66c66
> < x[i]=sin(h*PI/(double)N);
> ---
> > x[i]=sin(h*M_PI/(double)N);
You caught me! It should have been M_PI of course. My math.h
file provides PI, too.
Thanks,
Martin.
--
What is the difference between Jurassic Park and Microsoft?
One is an over-rated high tech theme park based on prehistoric
information and populated mostly by dinosaurs,
the other is a Steven Spielberg movie.
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-24 10:48 ` Martin Kahlert
@ 1998-06-24 11:06 ` Martin Høy
1998-06-24 13:46 ` Stefan Schroepfer
` (2 subsequent siblings)
3 siblings, 0 replies; 35+ messages in thread
From: Martin Høy @ 1998-06-24 11:06 UTC (permalink / raw)
To: martin.kahlert; +Cc: axp-list, scr
[Martin Kahlert <martin.kahlert@mchp.siemens.de>]
|
| I thought, these convolution stuff should run like a champ on Alpha.
| But since even Digital's Compiler can't do much here, i think it's
| not egcs/gcc's fault.
I have a fortran77-program that simulates non-equilibrium molecular
dynamics, and have compared running times on:
1) PII-266, linux 2.0.34, egcs-g77-1.0.2-8
2) DEC PWS433a, linux 2.0.34, egcs-g77-1.0.3a-2
3) Same as 2), but compiled the program statically under Digital UNIX
with Digital Fortran 77 V4.0-1-3231 and ran it on the PWS433a.
The running times (calculated by "time ./nemd") was:
1) 108 sec
2) 49 sec
3) 34 sec
It seems that egcs has a lot to catch up with compared with Digital's
own compiler.
Martin
--
"The system required Windows 95 or better, so I installed Linux"
Mail: gunde@pvv.ntnu.no
Web: http://www.stud.ntnu.no/~gunde/
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-24 10:48 ` Martin Kahlert
1998-06-24 11:06 ` Martin Høy
@ 1998-06-24 13:46 ` Stefan Schroepfer
1998-06-24 15:00 ` Robert Wilhelm
1998-06-24 15:25 ` Performance measurements Fabio Perroni
1998-06-24 15:28 ` Jeff Sturm
1998-06-24 16:58 ` Wes Bauske
3 siblings, 2 replies; 35+ messages in thread
From: Stefan Schroepfer @ 1998-06-24 13:46 UTC (permalink / raw)
To: axp-list; +Cc: martin.kahlert, robert
Martin Kahlert wrote:
>
> I thought, these convolution stuff should run like a champ
> on Alpha. But since even Digital's Compiler can't do much
> here, i think it's not egcs/gcc's fault.
> (Alex Rhomberg reported for a 500MHz Alpha:
> "DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564) 168.97 MFLOPS")
That's right. As this convolution consists of floating point
arithmetics only (besides loading / stroring), it should be
fast on the Alpha.
> Perhaps there could be done some tuning for memory
> access on Alphas? But: all arrays should fit in the cache -
> don't they?
I see only a single array in yout code, whose size is
2*1024*sizeof(double) = 16k. Note that the 21164 has a
L1 data cache of 8k. MFLOPS numbers from your code stay
the same with N=512 instead of 1024.
> There should be higher MFlops possible on these machines.
> Perhaps the factor two results from the fact, that there can't
> be done much more improvement on Intel chips any more.
> 100MFLOP are one mult/add every second cpu cycle on a 200MHz
> machine.
Improvement is possible, at least on Alphas. As a general rule
try to avoid superfluous array accesses, use more local variables
instead (which can more easily be mapped to registers by the
compiler).
I played around with your code and got a version which achives
324.00 MFLOPS now (compared to 187.86 MFLOPS with your code).
Note that in my version memcpy () takes 22.5 percent of total
computying time on my Alpha, so that your MFLOPS numbers are
too low as run time is measured overall.
I is now your part
- to verify that my version gives right results
- to let me know how my version performes on the PPro (especially
gcc and egcs compiled)
[Robert: could you please compile my code on your Alpha using
egcs and report your results to me]
Stefan Schroepfer
scr@iis.fhg.de
-----------------
#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 c0 = 3.52262918857095333469e-02;
double c1 = -8.54412738820266443041e-02;
double c2 = -1.35011020010254584323e-01;
double c3 = 4.59877502118491543470e-01;
double c4 = 8.06891509311092547385e-01;
double c5 = 3.32670552950082631938e-01;
int i,j;
double *wksph=wksp+n/2;
double lfT1, lfT2;
double lfA0, lfA1;
if(n<6)
return;
for(i=j=0;i<n/2-2;i++,j+=2)
{
/* 324.00 MFLOPS (reduced a[] - accesses) */
lfA0 = a[j]; lfA1 = a[j+1];
lfT1 = c0*lfA0 + c1*lfA1;
lfT2 = c5*lfA0 - c4*lfA1;
lfA0 = a[j+2]; lfA1 = a[j+3];
lfT1 += c2*lfA0 + c3*lfA1;
lfT2 += c3*lfA0 - c2*lfA1;
lfA0 = a[j+4]; lfA1 = a[j+5];
lfT1 += c4*lfA0 + c5*lfA1;
lfT2 += c1*lfA0 - c0*lfA1;
wksph[i] = lfT1;
wksp[i] = lfT2;
/* 191.28 MFLOPS (cx variables instead of array c[]) */
/*
wksph[i] = (c0*a[j] + c1*a[j+1] +
c2*a[j+2] + c3*a[j+3] +
c4*a[j+4] + c5*a[j+5]);
wksp[i] = (c5*a[j] - c4*a[j+1] +
c3*a[j+2] - c2*a[j+3] +
c1*a[j+4] - c0*a[j+5]);
*/
}
wksph[i] = (c0*a[j] + c1*a[j+1] +
c2*a[j+2] + c3*a[j+3] +
c4*a[0] + c5*a[1]);
wksp[i] = (c5*a[j] - c4*a[j+1] +
c3*a[j+2] - c2*a[j+3] +
c1*a[0] - c0*a[1]);
i++;j+=2;
wksph[i] = (c0*a[j] + c1*a[j+1] +
c2*a[0] + c3*a[1] +
c4*a[2] + c5*a[3]);
wksp[i] = (c5*a[j] - c4*a[j+1] +
c3*a[0] - c2*a[1] +
c1*a[2] - c0*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*M_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;
}
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-24 13:46 ` Stefan Schroepfer
@ 1998-06-24 15:00 ` Robert Wilhelm
1998-06-24 15:16 ` Stefan Schroepfer
1998-06-25 7:46 ` Performance measurements (thanks and conclusion) Martin Kahlert
1998-06-24 15:25 ` Performance measurements Fabio Perroni
1 sibling, 2 replies; 35+ messages in thread
From: Robert Wilhelm @ 1998-06-24 15:00 UTC (permalink / raw)
To: Stefan Schroepfer; +Cc: axp-list, martin.kahlert
> [Robert: could you please compile my code on your Alpha using
> egcs and report your results to me]
I get about 275 MFLOPS for my 533MHz 21164a for both egcs 1.0 and
egcs-current with haifa enabled.
If I use different local variables lfA*, egcs seems to shedule a bit
better and I get 290 MFLOPS.
Robert
--- f2.c Wed Jun 24 15:49:05 1998
+++ f3.c Wed Jun 24 16:29:05 1998
@@ -17,7 +17,7 @@
int i,j;
double *wksph=wksp+n/2;
double lfT1, lfT2;
- double lfA0, lfA1;
+ double lfA0, lfA1, lfA2, lfA3, lfA4, lfA5;
if(n<6)
return;
@@ -28,12 +28,12 @@
lfA0 = a[j]; lfA1 = a[j+1];
lfT1 = c0*lfA0 + c1*lfA1;
lfT2 = c5*lfA0 - c4*lfA1;
- lfA0 = a[j+2]; lfA1 = a[j+3];
- lfT1 += c2*lfA0 + c3*lfA1;
- lfT2 += c3*lfA0 - c2*lfA1;
- lfA0 = a[j+4]; lfA1 = a[j+5];
- lfT1 += c4*lfA0 + c5*lfA1;
- lfT2 += c1*lfA0 - c0*lfA1;
+ lfA2 = a[j+2]; lfA3 = a[j+3];
+ lfT1 += c2*lfA2 + c3*lfA3;
+ lfT2 += c3*lfA2 - c2*lfA3;
+ lfA4 = a[j+4]; lfA5 = a[j+5];
+ lfT1 += c4*lfA4 + c5*lfA5;
+ lfT2 += c1*lfA4 - c0*lfA5;
wksph[i] = lfT1;
wksp[i] = lfT2;
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-24 15:00 ` Robert Wilhelm
@ 1998-06-24 15:16 ` Stefan Schroepfer
1998-06-25 7:46 ` Performance measurements (thanks and conclusion) Martin Kahlert
1 sibling, 0 replies; 35+ messages in thread
From: Stefan Schroepfer @ 1998-06-24 15:16 UTC (permalink / raw)
To: Robert Wilhelm; +Cc: axp-list
Robert Wilhelm wrote:
>
> I get about 275 MFLOPS for my 533MHz 21164a for both egcs 1.0 and
> egcs-current with haifa enabled.
>
> If I use different local variables lfA*, egcs seems to shedule a bit
> better and I get 290 MFLOPS.
That's what I wanted to know (although I did not ask for it).
Using six local variables lfA* instead of two gave me worse
results using gcc, which is an indicator that gcc doesn't use
all registers.
scr@iis.fhg.de
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements (thanks and conclusion)
1998-06-24 15:00 ` Robert Wilhelm
1998-06-24 15:16 ` Stefan Schroepfer
@ 1998-06-25 7:46 ` Martin Kahlert
1 sibling, 0 replies; 35+ messages in thread
From: Martin Kahlert @ 1998-06-25 7:46 UTC (permalink / raw)
To: axp-list; +Cc: scr, robert, egcs
Quoting Robert Wilhelm (robert@physiol.med.tu-muenchen.de):
> > [Robert: could you please compile my code on your Alpha using
> > egcs and report your results to me]
>
> I get about 275 MFLOPS for my 533MHz 21164a for both egcs 1.0 and
> egcs-current with haifa enabled.
>
> If I use different local variables lfA*, egcs seems to shedule a bit
> better and I get 290 MFLOPS.
>
> Robert
I was really overwhelmed with the repsonse to this thread on
axp-list. Thanks a lot for all people who tried my source
and even tried to get more out of the compilers.
I tried both versions on my PPro 200:
Stefan Schroepfer's version:
pgcc:
85.98 MFLOPS
gcc-2.7.2.1:
97.10 MFLOPS
gcc-without double align:
95.46 MFLOPS
egcs-2.91.42:
84.06 MFLOPS
tcc:
17.20 MFLOPS
Robert Wilhelm's version:
pgcc:
81.62 MFLOPS
gcc-2.7.2.1:
98.81 MFLOPS
gcc-without double align:
98.81 MFLOPS
egcs-2.91.42:
83.44 MFLOPS
tcc:
16.44 MFLOPS
It seems that tcc is not the fastest and the most reliable
under the sun...
Can i conclude, that it's a good idea to insert as many local
vars as possible to get good results from compilers?
Now i have two questions:
-Why is it so difficult for gcc to transform the code
for(i=0;i<n;i++)
result[i]=a[i]+2*a[i+1]+3*a[i+2];
into something like
_tmp0=a[0];_tmp1=a[1];_tmp2=a[2];
for(i=0;i<n;i++)
{
result[i]=_tmp0+2*_tmp1+3*_tmp2;
_tmp0=_tmp1;
_tmp1=_tmp2;
_tmp2=a[i+2];
}
for itself? I think, especially in Fortran such things are a
common task.
-What's the reason for the performace loss between gcc-2.7.2.1
and egcs-2.91.42 - it's nearly 20%, that gcc-2.7.2.1 is better?
Thanks a lot,
Martin.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 13:46 ` Stefan Schroepfer
1998-06-24 15:00 ` Robert Wilhelm
@ 1998-06-24 15:25 ` Fabio Perroni
1 sibling, 0 replies; 35+ messages in thread
From: Fabio Perroni @ 1998-06-24 15:25 UTC (permalink / raw)
To: axp-list
Stefan Schroepfer wrote:
> I is now your part
> - to verify that my version gives right results
> - to let me know how my version performes on the PPro (especially
> gcc and egcs compiled)
>
Here is my test:
"single" PPro 200MHz (256k) 128MB Ram
I tried several different compiler options. I report the best results:
-----------------------------
Martin Kahlert's code:
pgcc-2.91.04 980115 (gcc-2.8.0)
70.84 MFLOPS
egcs-2.90.23 980102 (egcs-1.0.1)
70.40 MFLOPS
-----------------------------
Stefan Schroepfer's code:
pgcc-2.91.04 980115 (gcc-2.8.0)
84.06 MFLOPS
egcs-2.90.23 980102 (egcs-1.0.1)
74.11 MFLOPS
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 10:48 ` Martin Kahlert
1998-06-24 11:06 ` Martin Høy
1998-06-24 13:46 ` Stefan Schroepfer
@ 1998-06-24 15:28 ` Jeff Sturm
1998-06-24 15:59 ` Christopher C Chimelis
1998-06-24 16:05 ` Stefan Schroepfer
1998-06-24 16:58 ` Wes Bauske
3 siblings, 2 replies; 35+ messages in thread
From: Jeff Sturm @ 1998-06-24 15:28 UTC (permalink / raw)
To: Martin Kahlert; +Cc: axp-list
On Wed, 24 Jun 1998, Martin Kahlert wrote:
>
> Perhaps the factor two results from the fact, that there can't
> be done much more improvement on Intel chips any more.
> 100MFLOP are one mult/add every second cpu cycle on a 200MHz
> machine.
Results vary widely from one benchmark to another. I once tried the
BYTEmark integer and fp tests on a few of my machines... on a PPro 200
I got around 2.7 integer and 2.6 fp. My 533MHz 164SX did 7.8 on integer
and died with a SIGFPE on fp (why?). Running NT it completed with ~6.8 on
both tests.
Anyway, a factor of nearly three is nothing to sneeze at. An LX should
do better.
Comparing these results to yours, and the published SPECint95 and
SPECfp95, I don't see much consistency though. It's a mistake to put too
much faith in any single benchmark.
Jeff
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 15:28 ` Jeff Sturm
@ 1998-06-24 15:59 ` Christopher C Chimelis
1998-06-24 17:19 ` Jeff Sturm
1998-06-24 16:05 ` Stefan Schroepfer
1 sibling, 1 reply; 35+ messages in thread
From: Christopher C Chimelis @ 1998-06-24 15:59 UTC (permalink / raw)
To: axp-list; +Cc: Martin Kahlert
On Wed, 24 Jun 1998, Jeff Sturm wrote:
> I got around 2.7 integer and 2.6 fp. My 533MHz 164SX did 7.8 on integer
> and died with a SIGFPE on fp (why?). Running NT it completed with ~6.8 on
Try recompiling the Alpha version with the -mieee flag. Chances are, you
have a condition (ie div by zero) that triggers a floating point
exception. That flag should force egcs to include FPE handling code and
will (or should) allow it to run without dying with an FPE.
C
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 15:59 ` Christopher C Chimelis
@ 1998-06-24 17:19 ` Jeff Sturm
1998-06-24 18:12 ` Christopher C Chimelis
0 siblings, 1 reply; 35+ messages in thread
From: Jeff Sturm @ 1998-06-24 17:19 UTC (permalink / raw)
To: axp-list
On Wed, 24 Jun 1998, Christopher C Chimelis wrote:>
> On Wed, 24 Jun 1998, Jeff Sturm wrote:
> > I got around 2.7 integer and 2.6 fp. My 533MHz 164SX did 7.8 on integer
> > and died with a SIGFPE on fp (why?). Running NT it completed with ~6.8 on
>
> Try recompiling the Alpha version with the -mieee flag. Chances are, you
> have a condition (ie div by zero) that triggers a floating point
> exception. That flag should force egcs to include FPE handling code and
> will (or should) allow it to run without dying with an FPE.
I'm aware of -mieee and have used it for many applications that would
otherwise die on SIGFPE. But it is hardly ideal--it seems to slow down
the benchmark code by a ratio of 3-4. I'm not exactly sure what it does,
but it seems to add a lot of fp value-checking code. I can do much the
same by inserting statements in my source code, all at the expense of
runtime performance.
My real question is why do these programs run on x86 w/o -mieee? GCC on
x86 just returns NaN or Inf. Trapping errors in hardware sounds a lot
more efficient to me. I can write a signal handler, but it's hard to
recover. I'd rather not get the signal at all.
BTW I have no problem with MS Visual C++. Code from gcc causes SIGFPE,
both on Linux and OpenNT. What is it doing differently?
Jeff
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 17:19 ` Jeff Sturm
@ 1998-06-24 18:12 ` Christopher C Chimelis
1998-06-24 19:05 ` Jeff Sturm
` (3 more replies)
0 siblings, 4 replies; 35+ messages in thread
From: Christopher C Chimelis @ 1998-06-24 18:12 UTC (permalink / raw)
To: axp-list
On Wed, 24 Jun 1998, Jeff Sturm wrote:
> I'm aware of -mieee and have used it for many applications that would
> otherwise die on SIGFPE. But it is hardly ideal--it seems to slow down
> the benchmark code by a ratio of 3-4. I'm not exactly sure what it does,
> but it seems to add a lot of fp value-checking code. I can do much the
> same by inserting statements in my source code, all at the expense of
> runtime performance.
Yeah, runtime performance is killed by -mieee. My only guess would be to
implement a kernel-level handler for this (is this covered in the new math
code in later 2.1 kernels?).
> My real question is why do these programs run on x86 w/o -mieee? GCC on
> x86 just returns NaN or Inf. Trapping errors in hardware sounds a lot
> more efficient to me. I can write a signal handler, but it's hard to
> recover. I'd rather not get the signal at all.
The x86's handle the exception via hardware, whereas the Alphas apparently
don't (not sure of this...I haven't read the architecture manual in over a
year).
> BTW I have no problem with MS Visual C++. Code from gcc causes SIGFPE,
> both on Linux and OpenNT. What is it doing differently?
MSVC++ may have something that it links in to handle these exceptions. I,
personally, would like to see that kinda code added to our kernel if it
isn't there. There was talk of a SIGFPE signal handler being added to the
kernel, but I'm not sure where that went after discussion.
C
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-24 18:12 ` Christopher C Chimelis
@ 1998-06-24 19:05 ` Jeff Sturm
1998-06-24 20:38 ` Wes Bauske
` (2 subsequent siblings)
3 siblings, 0 replies; 35+ messages in thread
From: Jeff Sturm @ 1998-06-24 19:05 UTC (permalink / raw)
To: axp-list
On Wed, 24 Jun 1998, Christopher C Chimelis wrote:
>
> On Wed, 24 Jun 1998, Jeff Sturm wrote:
>
> > I'm aware of -mieee and have used it for many applications that would
> > otherwise die on SIGFPE. But it is hardly ideal--it seems to slow down
> > the benchmark code by a ratio of 3-4. I'm not exactly sure what it does,
> > but it seems to add a lot of fp value-checking code. I can do much the
> > same by inserting statements in my source code, all at the expense of
> > runtime performance.
>
> Yeah, runtime performance is killed by -mieee. My only guess would be to
> implement a kernel-level handler for this (is this covered in the new math
> code in later 2.1 kernels?).
Not sure, but I'm running 2.1.105 and it doesn't seem to help. In
arch/alpha/math-emu there is some fp emulation code; I'm not real sure
yet why it is there. I'll have to do some research I guess...
> MSVC++ may have something that it links in to handle these exceptions. I,
> personally, would like to see that kinda code added to our kernel if it
> isn't there. There was talk of a SIGFPE signal handler being added to the
> kernel, but I'm not sure where that went after discussion.
Yup. I see the code in arch/alpha/kernel/traps.c and a funny comment
about a summary bit. I wish I understood what it's doing.
I used to feel comfortable doing this kind of hacking on my x86 machine.
The alpha makes me feel stupid again...
Jeff
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-24 18:12 ` Christopher C Chimelis
1998-06-24 19:05 ` Jeff Sturm
@ 1998-06-24 20:38 ` Wes Bauske
1998-06-24 22:30 ` Jeff Sturm
1998-06-25 1:42 ` Richard Henderson
1998-06-25 1:48 ` Richard Henderson
1998-06-27 14:30 ` Volker Barthelmann
3 siblings, 2 replies; 35+ messages in thread
From: Wes Bauske @ 1998-06-24 20:38 UTC (permalink / raw)
To: axp-list
Christopher C Chimelis wrote:
>
> On Wed, 24 Jun 1998, Jeff Sturm wrote:
>
> > I'm aware of -mieee and have used it for many applications that would
> > otherwise die on SIGFPE. But it is hardly ideal--it seems to slow down
> > the benchmark code by a ratio of 3-4. I'm not exactly sure what it does,
> > but it seems to add a lot of fp value-checking code. I can do much the
> > same by inserting statements in my source code, all at the expense of
> > runtime performance.
>
> Yeah, runtime performance is killed by -mieee. My only guess would be to
> implement a kernel-level handler for this (is this covered in the new math
> code in later 2.1 kernels?).
>
> > My real question is why do these programs run on x86 w/o -mieee? GCC on
> > x86 just returns NaN or Inf. Trapping errors in hardware sounds a lot
> > more efficient to me. I can write a signal handler, but it's hard to
> > recover. I'd rather not get the signal at all.
>
> The x86's handle the exception via hardware, whereas the Alphas apparently
> don't (not sure of this...I haven't read the architecture manual in over a
> year).
>
> > BTW I have no problem with MS Visual C++. Code from gcc causes SIGFPE,
> > both on Linux and OpenNT. What is it doing differently?
>
> MSVC++ may have something that it links in to handle these exceptions. I,
> personally, would like to see that kinda code added to our kernel if it
> isn't there. There was talk of a SIGFPE signal handler being added to the
> kernel, but I'm not sure where that went after discussion.
>
From what I remember, the Alpha has floating point configuration
registers that can be set to do HW traps/fixes but I don't know
how to set them. Maybe someone else does?? (Richard or Jay??)
Wes
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 20:38 ` Wes Bauske
@ 1998-06-24 22:30 ` Jeff Sturm
1998-06-25 1:42 ` Richard Henderson
1 sibling, 0 replies; 35+ messages in thread
From: Jeff Sturm @ 1998-06-24 22:30 UTC (permalink / raw)
To: Wes Bauske; +Cc: axp-list
On Wed, 24 Jun 1998, Wes Bauske wrote:
> >From what I remember, the Alpha has floating point configuration
> registers that can be set to do HW traps/fixes but I don't know
> how to set them. Maybe someone else does?? (Richard or Jay??)
Looks like that would be the FPCR register... I've been browsing through
the Alpha Architecture Handbook, section "4.7.6 Floating-Point Trapping
Modes" seems to cover this..
Looks like some of the code's in place now. In the 2.1.103 kernel, the
CONFIG_MATHEMU experimental configuration option turns it on.. this can
be had by answering 'Y' to "Kernel FP software completion". I have no
idea if this code is ready, I'm going to try it tonite and see what happens.
Jeff
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 20:38 ` Wes Bauske
1998-06-24 22:30 ` Jeff Sturm
@ 1998-06-25 1:42 ` Richard Henderson
1 sibling, 0 replies; 35+ messages in thread
From: Richard Henderson @ 1998-06-25 1:42 UTC (permalink / raw)
To: axp-list
On Wed, Jun 24, 1998 at 08:38:53PM +0000, Wes Bauske wrote:
> From what I remember, the Alpha has floating point configuration
> registers that can be set to do HW traps/fixes ...
Nope.
r~
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 18:12 ` Christopher C Chimelis
1998-06-24 19:05 ` Jeff Sturm
1998-06-24 20:38 ` Wes Bauske
@ 1998-06-25 1:48 ` Richard Henderson
1998-06-25 14:00 ` Jeff Sturm
1998-06-27 14:30 ` Volker Barthelmann
3 siblings, 1 reply; 35+ messages in thread
From: Richard Henderson @ 1998-06-25 1:48 UTC (permalink / raw)
To: axp-list
On Wed, Jun 24, 1998 at 02:12:40PM -0400, Christopher C Chimelis wrote:
> Yeah, runtime performance is killed by -mieee. My only guess would be to
> implement a kernel-level handler for this (is this covered in the new math
> code in later 2.1 kernels?).
No, that bit in the kernel is what fixes up the exceptions raised
by -mieee. For non -mieee code there is no hope of fixing up the
exception.
> > BTW I have no problem with MS Visual C++. Code from gcc causes SIGFPE,
> > both on Linux and OpenNT. What is it doing differently?
5 gets you 10 the problem is with the byte benchmarks not initiallizing
its variables properly, and you are getting a NaN or denormal signalled.
It may not be showing up w/ MSVC++ because it randomly had different
initial data.
r~
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-25 1:48 ` Richard Henderson
@ 1998-06-25 14:00 ` Jeff Sturm
1998-06-25 16:17 ` Richard Henderson
0 siblings, 1 reply; 35+ messages in thread
From: Jeff Sturm @ 1998-06-25 14:00 UTC (permalink / raw)
To: axp-list
On Wed, 24 Jun 1998, Richard Henderson wrote:
> On Wed, Jun 24, 1998 at 02:12:40PM -0400, Christopher C Chimelis wrote:
> > Yeah, runtime performance is killed by -mieee. My only guess would be to
> > implement a kernel-level handler for this (is this covered in the new math
> > code in later 2.1 kernels?).
>
> No, that bit in the kernel is what fixes up the exceptions raised
> by -mieee. For non -mieee code there is no hope of fixing up the
> exception.
So what good is -mieee? Is it really intended for ill-behaved fp code?
(Sorry if this has been covered before. I've seen a lot of comments
about programs that must be compiled with -mieee without explaining WHY...)
> > > BTW I have no problem with MS Visual C++. Code from gcc causes SIGFPE,
> > > both on Linux and OpenNT. What is it doing differently?
>
> 5 gets you 10 the problem is with the byte benchmarks not initiallizing
> its variables properly, and you are getting a NaN or denormal signalled.
> It may not be showing up w/ MSVC++ because it randomly had different
> initial data.
Indeed. I discovered a float array heap-allocated and not initialized.
Setting the array to zeros solved the problem.
Jeff
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-25 14:00 ` Jeff Sturm
@ 1998-06-25 16:17 ` Richard Henderson
0 siblings, 0 replies; 35+ messages in thread
From: Richard Henderson @ 1998-06-25 16:17 UTC (permalink / raw)
To: Jeff Sturm, axp-list
On Thu, Jun 25, 1998 at 10:00:49AM -0400, Jeff Sturm wrote:
> So what good is -mieee? Is it really intended for ill-behaved fp code?
> (Sorry if this has been covered before. I've seen a lot of comments
> about programs that must be compiled with -mieee without explaining WHY...)
The Alpha does not handle the trickier end-cases of strict IEEE arithmetic
in hardware, so as to streamline the pipeline. So if any of the inputs or
the expected result of an operation are one of Inf, NaN, or denormal, the
processor will signal an arithmetic exception.
If the insn that trapped had the software completion bit set (/s) this fact
will be reported to the kernel. Which then knows that the code was written
respecting trap shadow rules and that the operation may be emulated and
restarted.
If /s was not set, we know right away there is no hope and send sigfpe.
What -mieee does is to set /s and insert trapb insns as necessary to
follow trap shadow rules.
r~
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 18:12 ` Christopher C Chimelis
` (2 preceding siblings ...)
1998-06-25 1:48 ` Richard Henderson
@ 1998-06-27 14:30 ` Volker Barthelmann
1998-06-28 16:41 ` Jeff Sturm
3 siblings, 1 reply; 35+ messages in thread
From: Volker Barthelmann @ 1998-06-27 14:30 UTC (permalink / raw)
To: axp-list
On Wed, 24 Jun 1998, Christopher C Chimelis wrote:
> On Wed, 24 Jun 1998, Jeff Sturm wrote:
>
> > I'm aware of -mieee and have used it for many applications that would
> > otherwise die on SIGFPE. But it is hardly ideal--it seems to slow down
> > the benchmark code by a ratio of 3-4. I'm not exactly sure what it does,
> > but it seems to add a lot of fp value-checking code. I can do much the
> > same by inserting statements in my source code, all at the expense of
> > runtime performance.
>
> Yeah, runtime performance is killed by -mieee. My only guess would be to
> implement a kernel-level handler for this (is this covered in the new math
> code in later 2.1 kernels?).
This should basically be a compiler-problem. AFAIK gcc currently just
inserts trap-barriers directly after every instruction that might cause an
exception therefore stalling the pipelines.
By trying to avoid reusing of the registers involved for some time and
moving the trap-barrier or eliminating it, the speed-penalty could
probably be reduced for the most part.
Volker
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-27 14:30 ` Volker Barthelmann
@ 1998-06-28 16:41 ` Jeff Sturm
1998-06-28 23:01 ` Volker Barthelmann
1998-06-29 5:14 ` jrp
0 siblings, 2 replies; 35+ messages in thread
From: Jeff Sturm @ 1998-06-28 16:41 UTC (permalink / raw)
To: axp-list
On Sat, 27 Jun 1998, Volker Barthelmann wrote:
> On Wed, 24 Jun 1998, Christopher C Chimelis wrote:
> > On Wed, 24 Jun 1998, Jeff Sturm wrote:
> >
> > > I'm aware of -mieee and have used it for many applications that would
> > > otherwise die on SIGFPE. But it is hardly ideal--it seems to slow down
> > > the benchmark code by a ratio of 3-4. I'm not exactly sure what it does,
> > > but it seems to add a lot of fp value-checking code. I can do much the
> > > same by inserting statements in my source code, all at the expense of
> > > runtime performance.
> >
> > Yeah, runtime performance is killed by -mieee. My only guess would be to
> > implement a kernel-level handler for this (is this covered in the new math
> > code in later 2.1 kernels?).
>
> This should basically be a compiler-problem. AFAIK gcc currently just
> inserts trap-barriers directly after every instruction that might cause an
> exception therefore stalling the pipelines.
>
> By trying to avoid reusing of the registers involved for some time and
> moving the trap-barrier or eliminating it, the speed-penalty could
> probably be reduced for the most part.
From what I understand the real problem is parallel instruction issue,
not register usage. The kernel cannot tell which instruction caused a
trap if -mieee is not used. So -mieee must reduce floating-point to a
single CPU pipeline, there's the performance penalty.
So on Alpha we must live with not-quite-IEEE arithmetic at very fast
speeds, or true IEEE at somewhat slower speeds.
Jeff
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-28 16:41 ` Jeff Sturm
@ 1998-06-28 23:01 ` Volker Barthelmann
1998-06-29 18:11 ` Jim Paradis
1998-06-29 5:14 ` jrp
1 sibling, 1 reply; 35+ messages in thread
From: Volker Barthelmann @ 1998-06-28 23:01 UTC (permalink / raw)
To: axp-list
On Sun, 28 Jun 1998, Jeff Sturm wrote:
> On Sat, 27 Jun 1998, Volker Barthelmann wrote:
> > On Wed, 24 Jun 1998, Christopher C Chimelis wrote:
> > >
> > > Yeah, runtime performance is killed by -mieee. My only guess would be to
> > > implement a kernel-level handler for this (is this covered in the new math
> > > code in later 2.1 kernels?).
> >
> > This should basically be a compiler-problem. AFAIK gcc currently just
> > inserts trap-barriers directly after every instruction that might cause an
> > exception therefore stalling the pipelines.
> >
> > By trying to avoid reusing of the registers involved for some time and
> > moving the trap-barrier or eliminating it, the speed-penalty could
> > probably be reduced for the most part.
>
> >From what I understand the real problem is parallel instruction issue,
> not register usage. The kernel cannot tell which instruction caused a
> trap if -mieee is not used.
Alpha offers several versions of fp-instructions. When you want full
IEEE-compliance you have to choose the ones that trap on certain
situations, so that the trap-handler can emulate it in software.
If you compile with gcc without -mieee it simply uses instructions that
don't trap, AFAIK.
But even if you use the ones that trap you have the problem of imprecise
exceptions. The exception is not caused immediately but at some later
stage in the pipeline. Now if an instruction after the one causing an
exception modifies registers used by that one before the trap is
effectively executed, the handler cannot correctly emulate the
instruction.
Therefore gcc inserts trap-barriers immediately after every instruction
that might cause a trap. This barrier ensures that no further instructions
are executed before possible traps are executed, therefore stalling the
pipeline.
If you're not reusing registers of such an instructions you could omit the
trap-barrier and decrease the penalty.
> So -mieee must reduce floating-point to a
> single CPU pipeline, there's the performance penalty.
It's not that simple.
> So on Alpha we must live with not-quite-IEEE arithmetic at very fast
> speeds, or true IEEE at somewhat slower speeds.
Yes. The question is how much slower.
Volker
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-28 23:01 ` Volker Barthelmann
@ 1998-06-29 18:11 ` Jim Paradis
0 siblings, 0 replies; 35+ messages in thread
From: Jim Paradis @ 1998-06-29 18:11 UTC (permalink / raw)
To: axp-list
> Alpha offers several versions of fp-instructions. When you want full
> IEEE-compliance you have to choose the ones that trap on certain
> situations, so that the trap-handler can emulate it in software.
>
> If you compile with gcc without -mieee it simply uses instructions that
> don't trap, AFAIK.
Not entirely true. Some exceptions (e.g. underflow, inexact) can be
enabled or disabled on a per-instruction basis. Others (e.g. overflow,
invalid operation) cannot; they're always enabled.
In fact, the vast majority of the problems that require -mieee involve
"invalid operation" traps. These occur when you attempt to perform an
arithmetic operation involving a NaN ("Not a Number"), a denormal
number, or an infinity. The IEEE spec provides mechanisms whereby
these can be handled "quietly"; rather than signalling a program
exception, they can indicate the exception in their results. So, for
example, if you do an "add" operation and one of the operands is a
NaN, the floating-point implementation can produce a NaN in the result
rather than interrupting program execution.
If an architecture (e.g. MIPS) provides precise floating-point traps,
then it's fairly cheap to trap the exception and either pass it up
as a SIGFPE or handle it quietly according to the IEEE spec. The
imprecise traps on Alpha make this somewhat more costly.
Often, I find I have to resort to -mieee when porting sloppy code.
For example, a denorm is used where the programmer really meant to
use zero. Since IEEE's quiet behavior is to treat the denorm as zero,
this code "works" on other architectures even if it's technically
incorrect. Because it causes no failure, the programmer is not
inclined to fix it.
--
Jim Paradis (paradis@linux01.hlo.dec.com) "The early bird gets the worm.
Digital Equipment Corporation If you want something else for
(508)841-3243 breakfast, get up later."
http://www.tiac.net/users/jrp/index.html
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-28 16:41 ` Jeff Sturm
1998-06-28 23:01 ` Volker Barthelmann
@ 1998-06-29 5:14 ` jrp
1 sibling, 0 replies; 35+ messages in thread
From: jrp @ 1998-06-29 5:14 UTC (permalink / raw)
To: axp-list
>> By trying to avoid reusing of the registers involved for some time and
>> moving the trap-barrier or eliminating it, the speed-penalty could
>> probably be reduced for the most part.
>
>>From what I understand the real problem is parallel instruction issue,
> not register usage. The kernel cannot tell which instruction caused a
> trap if -mieee is not used. So -mieee must reduce floating-point to a
> single CPU pipeline, there's the performance penalty.
Actually, it's not so much parallel instruction *issue* as it is
parallel instruction *execution*. In other words, you can have several
instructions "in the pipeline" when a floating exception occurs. The
current Alpha architecture does not provide for precise floating point
traps; depending on where in the pipeline the fault occurs, the PC
reported may be an arbitrary number of instructions *after* the PC of
the actual faulting instruction.
The trivial solution to this, of course, is as you described: reduce
the effective "pipeline" length to one by issuing trapb's after every
floating-point instruction. This provides a significant performance
penalty.
That's why the Alpha architecture provides the "register write mask"
and the register re-use rules, along with a fairly large number of
floating-point registers. This way, a sophisticated compiler can
try to keep the pipeline full by issuing several floating-point
instructions before issuing a trapb...
--
Jim Paradis jrp@jrp.tiac.net "The early bird gets the worm.
http://www.tiac.net/users/jrp/index.html If you want something else for
breakfast, get up later."
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 15:28 ` Jeff Sturm
1998-06-24 15:59 ` Christopher C Chimelis
@ 1998-06-24 16:05 ` Stefan Schroepfer
1 sibling, 0 replies; 35+ messages in thread
From: Stefan Schroepfer @ 1998-06-24 16:05 UTC (permalink / raw)
To: axp-list
Jeff Sturm wrote:
>
> Comparing these results to yours, and the published SPECint95 and
> SPECfp95, I don't see much consistency though. It's a mistake to put too
> much faith in any single benchmark.
I hope no one puts any faith in our little benchmark as a
general performance comparision PPro / Alpha 21164.
Looking at the code provided by martin.kahlert@mchp.siemens.de
I simply got curious how a modified version of this code would
perform on
- a 21164 using gcc
- a 21164 using egcs
- a PPro using various compilers.
The best benchmark (for a specific application) is always running
the code that actually is to be executed in a specific application.
So all the traffic in this thread can be seen as a private benchmark
for martin.kahlert@mchp.siemens.de. You will gain nothing if your
code runs on a machine 'X' that has twice the SPECfp95 than a
machine 'Y', but your own code achives --- let's say --- only
half the performance on 'X'.
scr@iis.fhg.de
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 10:48 ` Martin Kahlert
` (2 preceding siblings ...)
1998-06-24 15:28 ` Jeff Sturm
@ 1998-06-24 16:58 ` Wes Bauske
3 siblings, 0 replies; 35+ messages in thread
From: Wes Bauske @ 1998-06-24 16:58 UTC (permalink / raw)
To: axp-list@redhat.com
Martin Kahlert wrote:
>
> Quoting Stefan Schroepfer (scr@iis.fhg.de):
> > Martin Kahlert wrote:
> > > [...]
> > >
> > > I work on a Linux 2.0.34 SMP Kernel (libc5). My hardware is a
> > > dual Pentium Pro 200MHz system with 128MB RAM.
> >
> > My results are for Kernel 2.0.30, glibc 1.99 (RedHat 4.2),
> > gcc 2.7.2.1, PC164LX (2MB Cache), 21164 @ 600MHz, 256MB RAM.
> >
> > > [...]
> > > Here are my results:
> > > %> make
> > > gcc-2.7.2.1:
> > > 95.46 MFLOPS
> > > [...]
> >
> > $ make
> > /usr/bin/gcc -O3 -Wall -o m.gcc m.c -lm
> > gcc-2.7.2.1:
> > 187.86 MFLOPS
> >
> > Hmmm, only twice as fast as a PPro 200. Most of my floating
> > point stuff shows a bigger difference in performance.
> All the other helpful people, who provided info so far have
> similar values.
> Thanks a lot!
>
> I thought, these convolution stuff should run like a champ
> on Alpha. But since even Digital's Compiler can't do much
> here, i think it's not egcs/gcc's fault.
> (Alex Rhomberg reported for a 500MHz Alpha:
> "DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564) 168.97 MFLOPS")
>
> Perhaps there could be done some tuning for memory
> access on Alphas? But: all arrays should fit in the cache -
> don't they?
> There should be higher MFlops possible on these machines.
>
> Perhaps the factor two results from the fact, that there can't
> be done much more improvement on Intel chips any more.
> 100MFLOP are one mult/add every second cpu cycle on a 200MHz
> machine.
>
I have FORTRAN filter applies that do 110MFLOPS
on PPro 200, 150MFLOPS on PII400, 300MFLOPS on Alpha 533
with egcs and 500MFLOPS with DEC FORTRAN on Alpha 533.
Your code needs a little tuning. The x86 egcs code
is pretty well tuned I think but I'm not happy the
PII400 only improved performance 40MFLOPS over a PPro 200.
Also, that same code runs 618MFLOPS on an RS/6000, 64 bit
enabled for those folks in that other thread on AIX.
YMMV.
If you're interested in the FORTRAN code, send me a note
privately and I'll send a copy...
Wes
^ permalink raw reply [flat|nested] 35+ 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 10:32 ` Performance measurements Stefan Schroepfer
@ 1998-06-24 15:49 ` David S. Miller
[not found] ` <Pine.GSO.3.96.980624190510.27225p-100000@markab.dbai.tuwien.ac.at>
1998-06-26 1:26 ` Ryan Kirkpatrick
4 siblings, 0 replies; 35+ messages in thread
From: David S. Miller @ 1998-06-24 15:49 UTC (permalink / raw)
To: martin.kahlert; +Cc: egcs, axp-list
Date: Wed, 24 Jun 1998 10:51:03 +0200
From: Martin Kahlert <martin.kahlert@mchp.siemens.de>
For the axp list: It would be very kind, if anybody could provide
some values for a Linux Alpha (e.g. 533MHz) for comparison.
I couldn't resist, with current CVS egcs sources, on a 300Mhz
UltraSparc w/512K L2 cache running Linux:
? ./fpubench
142.58 MFLOPS
Later,
David S. Miller
davem@dm.cobaltmicro.com
^ permalink raw reply [flat|nested] 35+ messages in thread[parent not found: <Pine.GSO.3.96.980624190510.27225p-100000@markab.dbai.tuwien.ac.at>]
* Re: Performance measurements
[not found] ` <Pine.GSO.3.96.980624190510.27225p-100000@markab.dbai.tuwien.ac.at>
@ 1998-06-25 7:59 ` Martin Kahlert
0 siblings, 0 replies; 35+ messages in thread
From: Martin Kahlert @ 1998-06-25 7:59 UTC (permalink / raw)
To: Gerald Pfeifer; +Cc: axp-list
Quoting Gerald Pfeifer (pfeifer@dbai.tuwien.ac.at):
> On Wed, 24 Jun 1998, Martin Kahlert wrote:
> > 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
>
> Do you happen to have a copy of egcs-1.0.3a available? I'd be rather
> curious whether that one performs that bad, too.
Sorry, but that's not the case. I must use snapshots, because i
have to cross-compile for winnt (mingw32). Only the snapshots
seem to have support for that during the build process.
Thanks,
Martin.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: Performance measurements
1998-06-24 8:51 Performance measurements Martin Kahlert
` (3 preceding siblings ...)
[not found] ` <Pine.GSO.3.96.980624190510.27225p-100000@markab.dbai.tuwien.ac.at>
@ 1998-06-26 1:26 ` Ryan Kirkpatrick
1998-06-26 14:45 ` Chris Ingrassia
4 siblings, 1 reply; 35+ messages in thread
From: Ryan Kirkpatrick @ 1998-06-26 1:26 UTC (permalink / raw)
To: axp-list
In case anyone is interested, here are some measurements I made on
my old, slow machines. Hopefully the provide a bit of perspective of how
fast modern Alphas are.
Pentium 100MHz w/64MB RAM and RH4.0/Linux 2.0.32
16.05 MFLOPS
Alpha UDB 166MHZ w/64MB RAM and RH4.0/Linux 2.0.32
25.79 MFLOPS
If any one wants the performance of this little benchmark on a Mac IIci
running Linux, just ask. ;)
----------------------------------------------------------------------------
| "For to me to live is Christ, and to die is gain." |
| --- Philippians 1:21 (KJV) |
----------------------------------------------------------------------------
| Ryan Kirkpatrick | Boulder, Colorado | rkirkpat@nag.cs.colorado.edu |
----------------------------------------------------------------------------
| http://www-ugrad.cs.colorado.edu/~rkirkpat/ |
----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: Performance measurements
1998-06-26 1:26 ` Ryan Kirkpatrick
@ 1998-06-26 14:45 ` Chris Ingrassia
0 siblings, 0 replies; 35+ messages in thread
From: Chris Ingrassia @ 1998-06-26 14:45 UTC (permalink / raw)
To: axp-list
On Thu, 25 Jun 1998, Ryan Kirkpatrick wrote:
>
> In case anyone is interested, here are some measurements I made on
> my old, slow machines. Hopefully the provide a bit of perspective of how
> fast modern Alphas are.
>
> Pentium 100MHz w/64MB RAM and RH4.0/Linux 2.0.32
> 16.05 MFLOPS
>
> Alpha UDB 166MHZ w/64MB RAM and RH4.0/Linux 2.0.32
> 25.79 MFLOPS
>
> If any one wants the performance of this little benchmark on a Mac IIci
> running Linux, just ask. ;)
>
I've got a Powermac 7200/75 running Linux :)
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~1998-06-29 18:16 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
1998-06-24 10:32 ` Performance measurements Stefan Schroepfer
1998-06-24 10:48 ` Martin Kahlert
1998-06-24 11:06 ` Martin Høy
1998-06-24 13:46 ` Stefan Schroepfer
1998-06-24 15:00 ` Robert Wilhelm
1998-06-24 15:16 ` Stefan Schroepfer
1998-06-25 7:46 ` Performance measurements (thanks and conclusion) Martin Kahlert
1998-06-24 15:25 ` Performance measurements Fabio Perroni
1998-06-24 15:28 ` Jeff Sturm
1998-06-24 15:59 ` Christopher C Chimelis
1998-06-24 17:19 ` Jeff Sturm
1998-06-24 18:12 ` Christopher C Chimelis
1998-06-24 19:05 ` Jeff Sturm
1998-06-24 20:38 ` Wes Bauske
1998-06-24 22:30 ` Jeff Sturm
1998-06-25 1:42 ` Richard Henderson
1998-06-25 1:48 ` Richard Henderson
1998-06-25 14:00 ` Jeff Sturm
1998-06-25 16:17 ` Richard Henderson
1998-06-27 14:30 ` Volker Barthelmann
1998-06-28 16:41 ` Jeff Sturm
1998-06-28 23:01 ` Volker Barthelmann
1998-06-29 18:11 ` Jim Paradis
1998-06-29 5:14 ` jrp
1998-06-24 16:05 ` Stefan Schroepfer
1998-06-24 16:58 ` Wes Bauske
1998-06-24 15:49 ` David S. Miller
[not found] ` <Pine.GSO.3.96.980624190510.27225p-100000@markab.dbai.tuwien.ac.at>
1998-06-25 7:59 ` Martin Kahlert
1998-06-26 1:26 ` Ryan Kirkpatrick
1998-06-26 14:45 ` Chris Ingrassia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox