ARM Cortex-A8:如何同时使用 NEON 和 vfpv3

发布于 2024-10-03 02:45:18 字数 548 浏览 1 评论 0原文

我正在使用 Cortex-A8 处理器,但我不明白如何使用 -mfpu 标志。

Cortex-A8 上有 vfpv3neon 协处理器。以前我不知道如何使用 neon,所以我只使用

gcc -marm -mfloat-abi=softfp -mfpu=vfpv3

现在我已经了解了 SIMD 处理器的运行方式,并且我已经使用 NEON 编写了某些代码内在函数。现在要使用 neon 协处理器,我的 -mfpu 标志必须更改为 -mfpu=neon,因此我的编译器命令行如下所示

gcc -marm -mfloat-abi=softfp -mfpu= neon

现在,这是否意味着我的 vfpv3 不再被使用?我有很多代码没有使用 NEON,这些部分是否没有使用 vfpv3

如果 neon 和 vfpv3 仍然使用,那么我没有问题,但如果只使用其中之一,我如何才能同时使用两者?

I'm using Cortex-A8 processor and I'm not understanding how to use the -mfpu flag.

On the Cortex-A8 there are both vfpv3 and neon co-processors. Previously I was not knowing how to use neon so I was only using

gcc -marm -mfloat-abi=softfp -mfpu=vfpv3

Now I have understood how SIMD processors run and I have written certain code using NEON intrinsics. To use neon co-processor now my -mfpu flag has to change to -mfpu=neon, so my compiler command line looks like this

gcc -marm -mfloat-abi=softfp -mfpu=neon

Now, does this mean that my vfpv3 is not used any more? I have lots of code which is not making use of NEON, do those parts not make use of vfpv3.

If both neon and vfpv3 are still used then I have no issues, but if only one of them is used how can I make use of both?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一个人的旅程 2024-10-10 02:45:18

NEON 意味着也有传统的 VFP 支持。 VFP 可用于“普通”(非矢量)浮点计算。另外,NEON 不支持双精度 FP,因此只能使用 VFP 指令。
你可以做的就是在 gcc 的命令行中添加 -S 并检查程序集。以V开头的指令(如vld1.32、vmla.f32)是NEON指令,以F开头的指令(fldd、fmacd)是VFP。 (尽管 ARM 文档现在更喜欢使用 V 前缀,甚至对于 VFP 指令也是如此,但 GCC 并没有这样做。)

NEON implies having the traditional VFP support too. VFP can be used for "normal" (non-vector) floating-point calculations. Also, NEON does not support double-precision FP so only VFP instructions can be used for that.
What you can do is add -S to gcc's command line and check the assembly. Instructions starting with V (e.g. vld1.32, vmla.f32) are NEON instructions, and those starting with F (fldd, fmacd) are VFP. (Although ARM docs now prefer using the V prefix even for VFP instructions, GCC does not do that.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文