nanogui: Thread: How to get the smallest code size with mipsel-linux-gcc


[<<] [<] Page 1 of 1 [>] [>>]
Subject: How to get the smallest code size with mipsel-linux-gcc
From: Robert Hartley ####@####.####
Date: 22 Feb 2001 14:09:43 -0000
Message-Id: <3A951E4C.2E04E672@ics.com>

Hi,

I am wondering how to get the smallest code size with mipsel-linux-gcc.

My current command line looks something like this:
mipsel-linux-gcc -c -ansi -pedantic -O6 -fno-strength-reduce somefile.c

Is there some other option I can use to shrink it more?

I am thinking of the way the Intel CPU line is always a super set of the
predecessor, so that in theory, a PIII can run code snippets of an old
8080.  I am hoping that the same can be done for the MIPS processor,
regardless of other performance issues like speed,

Thanks!

Rob

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=  Robert Hartley                 Mail:         201 Broadway        =
=  Central Region Systems Engineer              Cambridge, MA 02139 =
=  Integrated Computer            Email:        ####@####.####    =
=  Solutions, Inc.                Web Site:     www.ics.com         =
=  Tech Support: ####@####.####  Phone:        800-800-4271        =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Visit the MotifZone (www.motifzone.org) for info on Motif!



Subject: Re: How to get the smallest code size with mipsel-linux-gcc
From: Alex Holden ####@####.####
Date: 22 Feb 2001 20:03:34 -0000
Message-Id: <Pine.LNX.4.04.10102222001480.627-100000@hyperspace.linuxhacker.org>

On Thu, 22 Feb 2001, Robert Hartley wrote:
> mipsel-linux-gcc -c -ansi -pedantic -O6 -fno-strength-reduce somefile.c
> Is there some other option I can use to shrink it more?

-O3 (and greater) enables automatic loop unrolling, which can increase the
code size quite a bit. Try -O2 or -Os instead. I've found experimentally
that on x86 -O2 is probably the best compromise of speed and code size,
whilst -Os is slightly smaller and quite a bit slower. I would guess
the Mips GCC probably behaves similarly.

-- 
------- Alex Holden -------
http://www.linuxhacker.org/
 http://www.robogeeks.org/

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.