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
  • When I use results compiled with -mcpu=cortex-a8 to run on A9 platform, will it cause some problems?

    It should "work" - i.e. it will run and produce the correct result - both are ARMv7-A architecture cores.

    It may not be "optimal" - the main function of setting a specific CPU core is to allow the compiler to schedule code to get the best performance. As Koumoto-san mentions, these two cores are quite different when it comes to their internal micro-architecture, so you may be reducing your peak performance if you don't compile for the right core.

    HTH,

    Pete

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

    It should "work" - i.e. it will run and produce the correct result - both are ARMv7-A architecture cores.

    It may not be "optimal" - the main function of setting a specific CPU core is to allow the compiler to schedule code to get the best performance. As Koumoto-san mentions, these two cores are quite different when it comes to their internal micro-architecture, so you may be reducing your peak performance if you don't compile for the right core.

    HTH,

    Pete

Children