[Gllug] arch & cpu number confusion

Nix nix at esperi.org.uk
Fri Jan 6 10:52:28 UTC 2006


On Mon, 2 Jan 2006, Daniel P. Berrange stipulated:
>  -march=NAME
>      This specifies the name of the target ARM architecture.  GCC uses
>      this name to determine what kind of instructions it can emit when
>      generating assembly code.  This option can be used in conjunction
>      with or instead of the `-mcpu=' option.  Permissible names are:
>      `armv2', `armv2a', `armv3', `armv3m', `armv4', `armv4t', `armv5',
>      `armv5t', `armv5te', `armv6', `armv6j', `iwmmxt', `ep9312'.

I think you got that from the wrong submodel options info page somehow,
unless Intel have come out with some very different chips recently ;)

> Basically -mtune (was -mcpu in older gcc) changes the code so that it 
> runs best on a particular CPU type, while -march explicitly uses CPU 
> instructions available on the specified CPU or later. So, changing 
> mtune just impacts performance without hurting compatability, while
> changing -march impacts performance *and* compatability.

... but it may speed things up more, because it can use new
instructions: -march={pentiumpro,athlon,pentium4} has significant
speedups under some circumstances because we can use CMOV, and of course
-march=sparcv8 and above has huge advantages for some loads on SPARCs
because SPARCv7 didn't have integer multiply or divide
operations. (There is an enormous speedup to SSH negotiation when
OpenSSL is compiled for SPARCv8, for instance.)

In general the effects of -march aren't that much bigger than -mtune,
though, and of course they do restrict the CPUs you can run on.

-- 
`I must caution that dipping fingers into molten lead
 presents several serious dangers.' --- Jearl Walker
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list