new optimizations for lunar - part1

Auke Kok sofar at lunar-linux.org
Wed May 4 07:42:23 UTC 2005


Auke Kok wrote:

> Zbigniew Łuszpiński wrote:
>
>> -mcpu= makes code optimized for given processor but runable with 386. 
>> I think that nobody needs such crazy optimization. The -march= option 
>> implies -mcpu=. With gcc 3.4 you will even get ugly warning about 
>> deprecated -mcpu=.
>>
> - -mcpu in lunar is set to the same architecture as -march, we do that 
> so that no unoptimized i386 code is present in i686 optimized 
> programs, so it makes sense to use -mcpu to 'remove compatibility code 
> for slower cpus'.


okay here's the definitive answer on this, as I was wrong and mixed them 
around:

       -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, athlon-mp, winchip-c6,
           winchip2 and c3.

           While picking a specific cpu-type will schedule things appropri-
           ately 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.


what you said is that _if_ you use '-march=' _then _ '-mcpu' becomes 
obsolete. which is true.

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


as said. This may be a good time to clean up some wrong assumptions in 
our optimization choices ;^)

sofar



More information about the Lunar mailing list