NEON 汇编手册/GNU 汇编器教程

发布于 2024-11-16 08:16:52 字数 1536 浏览 4 评论 0原文

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

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

发布评论

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

评论(3

好菇凉咱不稀罕他 2024-11-23 08:16:52

除了一个小细节之外,NEON 语法是相同的:对齐的加载/存储在 ARM 中使用 @,在 GAS 中使用 ,:。这是因为@是GAS中的注释符号。

手臂:

 vld1.32         {d0-d3},   [r1@128]!
 vld1.32         {d16-d19}, [r1@128]

气体:

 vld1.32         {d0-d3},   [r1,:128]!
 vld1.32         {d16-d19}, [r1,:128]

NEON syntax is the same besides one small detail: the aligned loads/stores use @ in ARM and ,: in GAS. This is because @ is a comment symbol in GAS.

ARM:

 vld1.32         {d0-d3},   [r1@128]!
 vld1.32         {d16-d19}, [r1@128]

GAS:

 vld1.32         {d0-d3},   [r1,:128]!
 vld1.32         {d16-d19}, [r1,:128]
一场信仰旅途 2024-11-23 08:16:52

I have written some info about ARM + NEON Assembly code for GCC (including an example NEON function implementation) at http://www.shervinemami.info/armAssembly.html

一身仙ぐ女味 2024-11-23 08:16:52

从 GAS 开始时,有一件不言自明的事情是定义符号的方式。它在 ARM 汇编器中的工作方式不适用于 GAS。

但在 GAS 中,您可以只使用 #define 为某些寄存器创建符号。如...

#define MyLoopCounter r0

#define MyLoopInc #32

这样...

add MyLoopCounter,MyLoopCounter,MyLoopInc

是一样的

add r0,r0,#32

否则,我发现几乎所有其他内容都是相同的,当然还有已经回答的对齐差异。

One thing that is not self explanatory when starting with GAS is the way to define a symbol. The way it works in ARM assembler will not work with GAS.

But in GAS you can just use #define to make a symbol for some register. Such as...

#define MyLoopCounter r0

#define MyLoopInc #32

Such that...

add MyLoopCounter,MyLoopCounter,MyLoopInc

is the same as

add r0,r0,#32

Otherwise I found that almost everything else was the same, and of course the alignment difference as already answered.

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