mcpu vs march

Kyrylo Tkachov kyrylo.tkachov@arm.com
Fri Aug 9 11:32:00 GMT 2013


> 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






More information about the Gcc-help mailing list