RE: mcpu vs march

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi,
> I wanted to understand the difference of using march vs mcpu as argument
> to gcc.
> I am compiling my code for a cortex-A8 CPU,  what would be better to use:
> 
> -mcpu=cortex-a8 or -march=armv7-a

-mcpu=cortex-a8 will perform specific optimisations for the Cortex-A8 such as
instruction scheduling and will produce better performing code on that core.
-march=armv7-a just selects the ARMv7-a architecture which tells the compiler
that it can use the instructions in ARMv7-a, but it will not perform any
core-specific performance tuning.

If you know that you'll be running your code on a Cortex-A8 you should specify
-mcpu=cortex-a8, it also automatically implies -march=armv7-a.

For more information on the options available for ARM you can look at:
http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

HTH,
Kyrill

> 
> Thanks,
> Channa









[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux