gcc options for a freescale iMX6q ARM processor

纵然是瞬间 提交于 2019-12-03 07:38:10

问题


I am trying to figure out gcc options for a toolchain I am setting up, for development board: Sabre-lite which is based around the Freescale's iMX6q quad processor.

Now I know that iMX6 is basically a cortex-a9 processor that has co-processors vfpv3 and neon, and also vector graphics, 2D and even 3D engines.

However, the release notes and use guide docs haven't been too clear on how to enable any options that can be enabled in gcc.

In fact the options that I can 'play' with are the following.

-march= armv7-a                - ok this one is pretty obvious.
-mfpu= vfpv3/neon              - i can use only the vfpv3 co-processor, or both (respectively, depends on option)
-mfloat-abi=softfp/soft/hard   - I guess I can choose hard here, as there is hardware for fp operations
-mcpu=cortex-a9                - is it option even necessary? it is not clear if it just an alias for -march or something else.

Are there other options I should enable? Why does the toolchain have as default options to build the linux kernel/uboot/packages the following:

-march= armv7-a -mfpu= vfpv3 -mfloat-abi=softfp

Thank you for your help


回答1:


Use -mthumb -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mvectorize-with-neon-quad -mfloat-abi=softfp. Note that by default the compiler will not vectorize floating-point operating using NEON because NEON does not support denormal numbers. If you are fine with some loss of precision you can make gcc use NEON for floating-point by adding -ffast-math switch.




回答2:


I can't answer everything, but that '--softfp' means to use the FPU, but maintain compatibility with code that doesn't.

Slightly outdated ARM FP document



来源:https://stackoverflow.com/questions/14962447/gcc-options-for-a-freescale-imx6q-arm-processor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!