On Wed, 27 Sep 2000, Dan Nelson wrote:

> In the last episode (Sep 28), Mark Powell said:
> > BTW The gcc 2.95.2 options are perfectly valid for FreeBSD as well as
> > Linux. Obviously :) Can they be copied into the FBSD section too?
> > 
> > # these options for gcc-2.95.2 to produce fast code
> > #   CC_OPTS = \
> > #       -Wall -O9 -fomit-frame-pointer -march=pentium \
> > #       -finline-functions -fexpensive-optimizations \
> > #       -funroll-loops -funroll-all-loops -pipe -fschedule-insns2 \
> > #       -fstrength-reduce \
> > #       -malign-double -mfancy-math-387 -ffast-math 
> 
> I object to half of these options because whoever added obviously never
> tested his additions one at a time to verify that they actually help.
> 
> 1) There is no -O level above 3

I thought that was strange. I can only assume they were thinking of
putting it as high as possible for future extra gcc optimisation modes.
Afterall -O2 was the limit at one time.

> 2) You can't assume the user is compiling on a 586

Well they are commented out by default. It was just I'd not actually
noticed them before as they only appear in the Linux section.

> 3) Here is a list of the -f options listed, and which -O level
>     automatically enables them:
> 
>         -fomit-frame-pointer         -
>         -finline-functions           3
>       -fexpensive-optimizations    2
>         -funroll-all-loops           -
>         -funroll-loops               enabled by -funroll-all-loops
>         -fschedule-insns2            2
>         -fstrength-reduce            2
>         -ffast-math                  -
> 
> So at minimum, the CC_OPTS should read 
> 
>  -Wall -pipe -O3 -fomit-frame-pointer -funroll-all-loops -ffast-math
>  -malign-double mfancy-math-387 

Does -m486 still do anything useful or does -march=pentium include it?
I thought that particular optimisation was also valid for a i[56]86?

> And it's debatable whether unroll-all-loops is a win or not (depends on
> whether the unrolled code is larger than your CPU's cache).

True. Although caches are pretty large these days; 256KB, 512KB or even
large with the Xeon.
Cheers.

Mark Powell - UNIX System Administrator - The University of Salford
Academic Information Services, Clifford Whitworth Building,
Salford University, Manchester, M5 4WT, UK.
Tel: +44 161 295 5936  Fax: +44 161 295 5888  www.pgp.com for PGP key

--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to