VST/VLD 命令中的 ARM 汇编语法 [英] ARM assembly syntax in VST/VLD commands

查看:47
本文介绍了VST/VLD 命令中的 ARM 汇编语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 arm-none-linux-gnueabi-gcc 工具链来构建一个项目,该项目涉及将一些程序集文件链接在一起.

I'm using the arm-none-linux-gnueabi-gcc toolchain to build a project which involves linking some assembly files together.

其中一个程序集文件包含多个命令,如下所示:

One of the assembly files contains multiple commands as this:

vst1.64 {q4}, [r0:64]        @offload A[0..1][4]

据我所知,根据ARM Assembler Reference 该命令假设将寄存器 q4 的内容存储在按 64 位对齐的内存部分中,并且 At 符号后面的文本只是一个注释.但是,当我想构建项目时,会给出以下消息:

As far as I know, according to the ARM Assembler Reference the command is suppose to store the contents of register q4 in a part of a memory which is aligned by 64 bits and the text after the At-sign is just a comment. However, when I want to build the project the below message is given:

Error: ']' expected -- `vst1.64 {q4},[r0:64]'

这意味着存在某种语法错误.修改如下行后,错误消失了:

Which means there is some sort of syntax error. After modifying the line as below the error is gone:

vst1.64 {q4}, [r0,:64]        @offload A[0..1][4]

我想知道这种修改是否会导致生产线做一些不同的事情.有没有其他方法可以解决这个错误?

I wanted to know if this modification causes the line to do some thing different or not. Is there any other way to fix this error?

推荐答案

您的修复似乎正确.对齐的正确语法确实包含逗号,但某些版本的 binutils 也支持省略逗号.两者在含义上没有区别,只是解析器的严格程度不同.两者都组装成完全相同的指令.

Your fix seems correct. The correct syntax for alignment does contain the comma, but some versions of binutils do support leaving out the comma as well. There's no difference in meaning between the two, just different strictness of the parser. Both assemble into the exact same instruction.

GNU binutils 2.25 和 2.30 似乎接受这两种形式.

GNU binutils 2.25 and 2.30 seem to accept both forms.

$ cat test.s
        .text
        .syntax unified
        vst1.64 {q4}, [r0:64]
        vst1.64 {q4}, [r0,:64]
$ arm-linux-gnueabihf-as -c test.s -o test.o -mfpu=neon
$ arm-linux-gnueabihf-objdump -d test.o

test.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <.text>:
   0:   f4008adf        vst1.64 {d8-d9}, [r0 :64]
   4:   f4008adf        vst1.64 {d8-d9}, [r0 :64]

这篇关于VST/VLD 命令中的 ARM 汇编语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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