Subject: Re: sparc/sparc64 gcc CFLAGS for optimization
To: Brian A. Seklecki <lavalamp@burghcom.com>
From: David Brownlee <abs@netbsd.org>
List: port-sparc
Date: 11/27/2001 02:32:28
	I believe sparc64 automatically sets -mcpu=v9. For other boxes
	you might want to look at the devel/cpuflags package. It takes
	a look at sysctl hw.model and tries to pick a good set of
	optimisation flags. If you find any CPU values it doesn't
	recognise, please let me know :)

	-msupersparc gets you the int multiply and divide which should
	be a win :)

-- 
		David/absolute		-- www.netbsd.org: No hype required --


On Mon, 26 Nov 2001, Brian A. Seklecki wrote:

>
> On some other operating systems that run on sparc but use gcc 3 for a
> compiler (that we won't mention here for posterity), you can export your
> CFLAG environmental to obtain optimizations on a per-cpu class basis. How
> would these flags affect egcs-2.91.66/egcs-1.1.2, and are they truly worth
> the wait at compile time?  i.e.:
>
> export CFLAGS="-O9 -mcpu=ultrasparc -mtune=ultrasparc"
> export CFLAGS="-O9 -mcpu=v8 -mtune=supersparc"
>
> >From the GCC docs:
>
> -mcpu=cpu_type
>               Set architecture type and instruction scheduling parameters
> for machine type cpu_type. Supported values for cpu_type are common,
> cypress, v8, supersparc, sparclite, f930, f934, sparclet, 90c701, v8plus,
> v9, and ultrasparc. Specifying ?v9? is only supported on true 64-bit
> targets.  Default instruction scheduling parameters are used for values
> that select an architecture and not an implementation. These are v7, v8,
> sparclite, sparclet, v9.  The following list shows each supported
> architecture and their supported implementations.
>
>                       v7: cypress
>                       v8: supersparc
>               sparclite: f930, f934
>                sparclet: tsc701
>                       v9: ultrasparc
>
>
> -mtune=cpu_type
>
> Set the instruction scheduling parameters for machine type, cpu_type,
> but do not set the architecture type like -mcpu=cpu_type would. The same
> values for -mcpu=cpu_type are used for -mtune=cpu_type, although the only
> useful values for those that select a particular CPU implementation:
> cypress, supersparc, f930, f934, tsc701, and ultrasparc.
>
> --Brian
>
>  ----
>
> "GNU/Linux: About as stable as the elements at the bottom of the periodic
> table"
>
>