Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Jun 1998 22:46:28 -0700
From:      Mike Smith <mike@smith.net.au>
To:        Donn Miller <dmm125@bellatlantic.net>
Cc:        "John S. Dyson" <dyson@FreeBSD.ORG>, Mike Smith <mike@smith.net.au>, hackers@FreeBSD.ORG
Subject:   Re: Recompiling sources with "-O2 -m486 -pipe" 
Message-ID:  <199806040546.WAA00663@antipodes.cdrom.com>
In-Reply-To: Your message of "Thu, 04 Jun 1998 01:31:26 -0000." <Pine.NEB.3.96.980604011707.720A-100000@myname.my.domain> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > About the -m486 option -- I use -m486 -O3 -pipe all the time; does it slow
> > > > down the execution somewhat?  I noticed the Mozilla sources defined
> > > > -mno-486.  Do you know if compiling with -mno-486 gives better results
> > > > than -m486 as far as speed, etc.?  I figured that -m486 generated 486
> > > > instructions, which would make a pentium run faster.
> > > 
> > > There are no 486 instructions to generate, and anything over -O runs 
> > > the risk of exposing bugs in the gcc optimiser it seems.
> > > 
> > -m486 expands the code somewhat, with larger alignment boundaries.  Netscape
> > is already very big :-).
> 
> Some postings in DejaNews claim that the -mno-486 runs faster on a Pentium
> (than -m486).  Other postings say just the opposite.

-m486 optimises alignment for the '486 by padding.  On the Pentium and 
above alignment is not so significant, and the padding wastes space in 
the cache and time for fetching and discarding.  Unless you intend to 
only run on a 486, it is generally wrong to use it.

> The -m486 option, from what I understand, benefits the 486 more than a Pentium.
>   I thought that the Pentium architecture was a ``superset'' more or less
> of the 486, so I figured whatever makes a 486 run faster will make a
> Pentium run faster.

Wrong. 8)

> I figure that:
> 
>     use:  CFLAGS -m486 -O3 for small to medium-sized code.
>     use:  CFLAGS -mno-486 -O3 for large code (ex. - Mozilla, compiling
>        entire XFree86 dist. from source).

I would still advise against anything over -O.  I have certainly seen 
strange (bad) problems with code built with -O2 and above, and I can do 
without the grief.
-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806040546.WAA00663>