This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: compiler performance
- From: Gareth McCaughan <gmccaughan at synaptics-uk dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 12 Feb 2004 14:30:08 +0000
- Subject: Re: compiler performance
Danny Angelo wrote:
> Hi, anybody at GCC can study and say anything about this article?
>
> http://www.osnews.com/story.php?news_id=5602&page=3
Everyone seems to agree that it's a lousy benchmark,
but it does seem to show up a performance regression
between gcc 2.95.4 and gcc 3.3.2, the two versions
I have on this machine (which is a FreeBSD/Athlon box,
running at 1.4GHz).
The "doubleArithmetic" test, which doesn't look too
hopelessly designed to me (apart from the fact that
it's way atypical of real-world calculations, of course),
takes 5.7s to run when compiled with g++ 2.95.4,
and 6.5s when compiled with g++ 3.3.2. In each case
the compiler flags were
-O3 -fomit-frame-pointer -ffast-math -funroll-loops
Here's the inner loop as compiled by 2.95.4:
.L68:
fxch %st(2)
fxch %st(1)
.p2align 2,0x90
.L16:
fxch %st(1)
fsub %st(2),%st
fxch %st(2)
fadd %st(1),%st
fadd %st,%st(2)
fadd %st(1),%st
fmul %st,%st(2)
fadd %st(1),%st
fdivr %st,%st(2)
fadd %st(1),%st
fcoml 88(%esp)
fnstsw %ax
andb $69,%ah
cmpb $1,%ah
je .L68
and as compiled by 3.3.2:
.p2align 2,,3
.L33:
fldl 24(%esp)
fsub %st(2), %st
fxch %st(2)
fadd %st(1), %st
fadd %st, %st(2)
fadd %st(1), %st
fmul %st, %st(2)
fxch %st(2)
fstpl 24(%esp)
fadd %st, %st(1)
fld %st(0)
fdiv %st(2), %st
fxch %st(2)
fadd %st(1), %st
fcoml 40(%esp)
fnstsw %ax
fxch %st(2)
fmull 24(%esp)
testb $1, %ah
fstpl 24(%esp)
jne .L33
--
Gareth McCaughan