[Gllug] arch & cpu number confusion

Daniel P. Berrange dan at berrange.com
Mon Jan 2 18:40:37 UTC 2006


On Mon, Jan 02, 2006 at 06:18:24PM +0000, Emon wrote:
> 
> Hi all
> 
> I am a newbie
> 
> I read some where that Slackware packages are compiled with the
> following options..
> 
> arch=486,cpu=686
> 
> I am very confused about the architecture & CPU number, where
> can I read more to clear up my concept??

Checkout the GCC info pages

 -mtune=NAME
     This option is very similar to the `-mcpu=' option, except that
     instead of specifying the actual target processor type, and hence
     restricting which instructions can be used, it specifies that GCC
     should tune the performance of the code as if the target were of
     the type specified in this option, but still choosing the
     instructions that it will generate based on the cpu specified by a
     `-mcpu=' option.  For some ARM implementations better performance
     can be obtained by using this option.

 -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'.


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.

Dan.
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20060102/4fb5120b/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list