[PLUG] code optimization with gcc
Paul Heinlein
heinlein at attbi.com
Wed Jun 5 03:39:17 UTC 2002
On Tue, 4 Jun 2002, Rich Shepard wrote:
> On Tue, 4 Jun 2002, Carla Schroder wrote:
>
> > Any gcc gurus out there? I'm going around in circles on targeting
> > specific CPUs. For example, optimize for k6 or i686 instead of
> > i386. Is this a compiler option? make/config option? Do you need
> > to wade through manufacturer specs and tailor your code itself?
>
> From info gcc:
>
> i386 Options
> -m486 -mno-486 -msoft-float -mno-fp-ret-in-387
> Could probably do -m686, too.
>
> Most of the time there's a configure option that's accessed by
> specifying --target=ix86.
Ah, here's the rub. The optimization switches have changed slightly
between gcc 2.x and 3.x (the uniquely Red Hat 2.96 release is a 3.x in
disguise).
The -m486 option has been retired. The new way of doing things is, as
Felix mentioned, -march=<whatever> or, to a lesser extent,
-mcpu=<whatever>.
I haven't really looked to see what changes the recently released gcc
3.1 introduced.
--Paul Heinlein <heinlein at attbi.com>
More information about the PLUG
mailing list