This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

code compile using -mcpu for ARM platform

When using gcc to compile c code for ARM platform, we set object platform by using:

     -mcpu = xxxxxx

To what extent will that affect results of compiling ?

For example:

     -mcpu = cortex-a8

and

     -mcpu = cortex-a9

When I use results compiled with -mcpu=cortex-a8 to run on A9 platform, will it cause some problems?

Parents
  • Hello jayzhao,


    I am not sure whether the differences are documented or not.

    For example, I compared the generated codes of dhrystone benchmark by using GCC4.9.3.

    I observed the following 3 points.

    1) Immediates are redundantly used by -mcpu=cortex-a9, and Immediates are re-used via registers by -mcpu=cortex-a8.

    2) For the same registers, interval (i.e. the number of independent instructions) between the modifying and referring is wider at -mcpu=cortex-a9.

    3) Much more registers are used by -mcpu=cortex-a9.

    I think these points seem to come from the pipleline features. Cortex-A8 is in-order and Cortex-A9 is out-of-order.

    I hope this helps you.

    Best regards,

    Yasuhiko Koumoto.

Reply
  • Hello jayzhao,


    I am not sure whether the differences are documented or not.

    For example, I compared the generated codes of dhrystone benchmark by using GCC4.9.3.

    I observed the following 3 points.

    1) Immediates are redundantly used by -mcpu=cortex-a9, and Immediates are re-used via registers by -mcpu=cortex-a8.

    2) For the same registers, interval (i.e. the number of independent instructions) between the modifying and referring is wider at -mcpu=cortex-a9.

    3) Much more registers are used by -mcpu=cortex-a9.

    I think these points seem to come from the pipleline features. Cortex-A8 is in-order and Cortex-A9 is out-of-order.

    I hope this helps you.

    Best regards,

    Yasuhiko Koumoto.

Children