飞思卡尔 iMX6q ARM 处理器的 gcc 选项 [英] gcc options for a freescale iMX6q ARM processor

查看:17
本文介绍了飞思卡尔 iMX6q ARM 处理器的 gcc 选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出我正在为开发板设置的工具链的 gcc 选项:Sabre-lite 基于飞思卡尔的 iMX6q 四核处理器.

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.

现在我知道 iMX6 基本上是一个 cortex-a9 处理器,有协处理器 vfpv3 和 neon,还有矢量图形、2D 甚至 3D 引擎.

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.

然而,发行说明和使用指南文档并没有明确说明如何启用可以在 gcc 中启用的任何选项.

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.

我还应该启用其他选项吗?为什么工具链有以下默认选项来构建 linux 内核/uboot/packages:

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

感谢您的帮助

推荐答案

使用 -mthumb -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mvectorize-with-neon-quad -mfloat-abi=softfp.请注意,默认情况下,编译器不会使用 NEON 对浮点运算进行向量化,因为 NEON 不支持非正规数.如果您对精度有所损失没有问题,您可以通过添加 -ffast-math 开关使 gcc 使用 NEON 进行浮点运算.

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.

这篇关于飞思卡尔 iMX6q ARM 处理器的 gcc 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆