飞思卡尔iMX6q ARM处理器的gcc选项

标签 gcc arm toolchain

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

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

但是,对于如何启用可以在gcc中启用的任何选项,发行说明和使用指南文档还不太清楚。

实际上,我可以“玩”的选项如下。

-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:
-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进行浮点运算。

关于飞思卡尔iMX6q ARM处理器的gcc选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14962447/

相关文章:

c++ - C 与 C++ 为什么这个宏不扩展为常量?

gcc - 使用 gccgo 构建 Go - fork/exec 没有这样的文件或目录

arm - ARM中r9寄存器的使用

c - 关于 RISC-V 编译器?

linux - 带有 TileGX 工具链和 LTO 的 LLVM 3.3 不工作

docker - 将 docker 与许多交叉构建工具链结合使用

c - 单行注释宏扼杀了 gcc

c - 为什么会出现 "cast from pointer to integer of different size"错误?

macos - 为什么 hello world 在 ARM mac 'invalid' 的汇编中?

c++ - ARM NEON : How to convert from uint8x16_t to uint8x8x2_t?