# march=Athlon on a Duron?

## MindFlayer

My cpu is (supposedly) a 700 Mhz Duron.  Lastnight while I was reinstalling Gentoo on my system I decided to do some optimization.  As part of that I did 'march=duron -03 -pipe' ...and nothing would compile.  So I tried mcpu=duron, same thing.  Being in a mood to play around I then tried 'march=athlon -03 -pipe' and to my great surprise everything compiled flawlessly.

  Now, correct me if I'm wrong, but does that not infer that my cpu is in reality an athlon?  Since 'march=foobar' should cause it to ONLY work with cpu's of type 'foobar' with no backward compatability, correct?

----------

## bpkri

There is no specific target called "duron" for gcc 3.2.x

-mcpu=cpu-type 

Tune to cpu-type everything applicable about the generated code, except for the ABI and the set of available instructions. The choices for cpu-type are i386, i486, i586, i686, pentium, pentium-mmx, pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-4, athlon-xp and athlon-mp. While picking a specific cpu-type will schedule things appropriately for that particular chip, the compiler will not generate any code that does not run on the i386 without the -march=cpu-type option being used. i586 is equivalent to pentium and i686 is equivalent to pentiumpro. k6 and athlon are the AMD chips as opposed to the Intel ones. 

-march=cpu-type 

Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mcpu. Moreover, specifying -march=cpu-type implies -mcpu=cpu-type. 

Find this at http://gcc.gnu.org/onlinedocs/gcc-3.2.1/gcc/i386-and-x86-64-Options.html#i386%20and%20x86-64%20Options

----------

## MindFlayer

Ok, thanks for the clarification and info.  The comments section of my /etc/make.conf file said that 'duron' was an option for gcc 3.2.x but not for gcc 2.9.x.

----------

## bpkri

Umm - if this is really in the comments of /etc/make.conf it is a obviously wrong...

----------

## wrc1944

MindFlayer,

It's my understanding that Durons 900mhz or below are actually equivalent to Athlon T-birds (just less cache on the chip), and use the same compiler optimizations. The "athlon" specification is for the original older Athlon chips.

Likewise, the newer Durons, 1.2mhz.1.3mhz, are the same as the Athlon XP series chips, again, just less cache.

wrc1944

----------

## sOuLjA

I have a duron 800 and I use "-march=athlon ...." and it works without problems

----------

## wrc1944

I'm not saying it won't work, as it will also work with i686 or below optimizations. I'm just saying that the first durons are actually Athlon t-birds with a smaller cache- they are in fact based on exactly the same architecture, thus will accept the t-bird opts. The newer 1.3GB durons are supposedly of the Athlon XP architecture. 

If I'm not mistaken, the plain "athlon" optimizations are specifically meant for the older slot type original Athlon chips. I suppose it would be better than i686, but not as good as t-bird opts. This is assuming, of course, that any of this really makes any difference in real world applications. I'd like to see some serious benchmark comparisons before I'm convinced one way or the other- the fact is, I don't really know, and lacking any evidence based on that, it's just subjective judgments about "speed," "feel," or "performance." That said, I'm all for great performance, and if it seems "faster," of course I'll go for it big time.

wrc1944

----------

