Subject: Re: LC040 mk.conf tuning
To: Joshua Coombs <jcoombs@gwi.net>
From: Frederick Bruckman <fredb@immanent.net>
List: port-mac68k
Date: 07/06/2003 08:43:26
On Sun, 6 Jul 2003, Joshua Coombs wrote:

> I've got my LC575 setup with a clean install of the LC040 distro, and
> would like to both torture test it as well as squeeze it for speed.  To
> that end I'm going to rebuild world.  I know I need at least the following
> in /etc/mk.conf;
>
> CXXFLAGS+=-msoft-float
> CFLAGS+=-msoft-float
> MKSOFTFLOAT=YES

The preferred way is to set COPTS, not CFLAGS. The COPTS will be added
to the CFLAGS. On current, you can put -msoft-float in CPUFLAGS, which
will be added as well.

> Is throwing -m68040 ok?  Should I be adding COPTS+=-msoft-float -m68040 ?
> I'll be rebuilding world and then throwing mysql of all things on this box
> so the more speed I can squeeze, the merrier.

"-m68040" isn't a good idea. It doesn't do much, anyway, if you
also have "-msoft-float", as the main thing it would do, is to emit
instructions for the 68040's included floating point unit, which is
slightly different than the 68881's. (For non-soft-float I often use
"-m68020-40 or "m68020-60", so that it doesn't incur the default
"-m68020"'s penalty on 68040's, but the binaries are still shareable.

My favorite optimizations are "-finline-functions" and
"-fomit-frame-pointer". The last time I tried to build the whole world
with "-O3" on m68k, though, which implied "-finline-functions", it
failed to compiled "groff", but that was an old compiler, before even
EGCS. With gcc-3.3* (not yet in current), "-maccumulate-outgoing-args"
and "-momit-leaf-frame-pointer" also look promising.

What I suggest you do, is build once, first, with just "-msoft-float",
and only then experiment with optimizing binaries that might really
make a difference, such as "libm", "libssl", or "sh". Run "time"
with and without over some slow operation, such as "make" or "ssh",
and see if it makes any difference. (Back up the old binary.) Rebuild
the whole world only after you've come up with a winning combination.

Frederick