Mail Archives: pgcc/1999/05/10/15:43:08
On Mon, May 10, 1999 at 12:50:56AM -0700, David Whysong wrote:
>
> /usr/local/bin/gcc dynamics_exact.c -c -O6 -mcpu=pentiumpro -Wall
> -ffast-math -mstack-align-double -mpentiumpro -mieee-fp -fstrength-reduce
> -malign-double -funroll-loops -funroll-all-loops -fomit-frame-pointer
> -DNDEBUG -DARCRANDOM -DDOUBLEPREC -I../..//include
>
> My question is, how well does the compiler optimize code that looks like
> this:
How about if you benchmark it? ;)
In theory, it should get rid of most if not all common subexpressions
automatically, however, the x86 does not have much fp registers to store the
intermediate values...
> Can I do anything so that the compiler produces a faster binary?
You could try out -fschedule-insns, which improves floating point
scheduling unless you have high register pressure. You should benchmark
it. In general you should play around with the switches a bit (-mno-ieee
often helps while improving the accuracy as well).
The only other option is to try some algebraic simplifications that the
compiler doesn't do (Ibecause its too dumb) or that the compiler is not
allowed to do in C (use fortran instead).
--
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg AT goof DOT com |e|
-=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE --+
The choice of a GNU generation |
|
- Raw text -