ARM指令集中的缩写(Rn, Rd, ...)是什么意思? [英] What do the abbriviations (Rn, Rd, ...) in the instruction set of ARM mean?

查看:23
本文介绍了ARM指令集中的缩写(Rn, Rd, ...)是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我检查了 ARM Cortex-M3 处理器的指令集.例如:

recently i checked the Instruction Set for an ARM Cortex-M3 processor. For example:

ADD <Rd>, <Rn>, <Rm>

这些缩写的确切含义是什么?我猜他们的意思是不同类型的地址,比如直接寻址、相对寻址等等.但究竟是什么?

What do those abbriviations mean exactly? I guess they mean different kinds of addresses, like directely addressed, relatively addressed or so. But what exactly?

谢谢!

推荐答案

基础知识:

  • Rd 是目的地,RnRm 是来源.它们都是通用整数寄存器;FP 将使用 Sd/Sn/SmDd/Dn/Dm 单人或双人.
    ARM 语法将目标放在左侧,在只读源操作数之前.
  • Rd is the destination, Rn and Rm are sources. They're all general-purpose integer registers; FP would use Sd / Sn / Sm or Dd / Dn / Dm for single or double.
    ARM syntax puts the destination(s) on the left, before read-only source operands.

有关更多信息,请参阅 Notlikethat 的答案.一些小的补充:

See Notlikethat's answer for more. Some small additions to that:

  • t:在 这篇文章,一名 ARM 员工评论说t"可能意味着转移";而不是目标".

  • t: in this post, an ARM employee comments that "t" might mean "transfer" instead of "target".

由于 t 通常出现在 LDR 和 STR 等内存指令中,我理解这意味着向/从内存传输",例如在 ARMARMv8-fa 上:

Since t generally appears in memory instructions like LDR and STR, I understand that that means "transfer to/from memory", e.g. on ARMARMv8-fa:

LDR <Xt>, [<Xn|SP>, (<Wm>|<Xm>){, <extend> {<amount>}}]
STR <Xt>, [<Xn|SP>, (<Wm>|<Xm>){, <extend> {<amount>}}]

t 是内存读写的源/目标.

where the t is the source/destination of memory reads and writes.

这在STR和LDXR指令寄存器的描述中也有进一步的建议:

This is also further suggested in the description of the STR and LDXR instruction registers:

<Xt> 是要传输的通用寄存器的 64 位名称,编码在Rt"中.字段.

<Xt> Is the 64-bit name of the general-purpose register to be transferred, encoded in the "Rt" field.

然而,LDR 指令说已加载":

The LDR instruction however says "loaded":

<Xt> 是要加载的通用寄存器的 64 位名称,编码在Rt"中.字段.

<Xt> Is the 64-bit name of the general-purpose register to be loaded, encoded in the "Rt" field.

这个术语特别有意义,因为 ARM 是 RISC-y,因此执行内存 IO 的指令相对较少,而且它们倾向于这样做(不像 x86 中常见的添加和存储到内存).

This terminology is especially meaningful because ARM is RISC-y and so there are relatively few instructions that do memory IO, and they tend to do just that (unlike say add and store to memory as is common in x86).

t1t2:这些用于一次加载/存储两个值的内存指令,例如ARMv8 LDP/STP:

t1 and t2: these are used for memory instructions that load/store two values at once, e.g. the ARMv8 LDP/STP:

LDP <Xt1>, <Xt2>, [<Xn|SP>], #<imm>
STP <Xt1>, <Xt2>, [<Xn|SP>, #<imm>]!

  • nm 只是数学中常用的整数变量/索引名称

  • n and m are just commonly used integer variable/index names in mathematics

    s:

    • STXR 指令存储到 Xt 的内存中(类似于 STR),但它也会获得第二个返回值(写入是否成功)到 Ws:

    • the STXR instruction stores to memory fom Xt (like STR), but it also gets a second return value (did the write succeed) to Ws:

    STXR <Ws>, <Xt>, [<Xn|SP>{,#0}]
    

    所以大概选择 s 是因为它出现在 t 之前,就像 mn 之前一样.

    so presumably s was chosen because it comes before t like m comes before n.

    一些 ARMv7/aarch32 指令可以在寄存器中进行移位,而 Rs 是该寄存器的名称,例如:

    Some ARMv7/aarch32 instructions could take a shift in a register, and Rs is the name given to that register, e.g.:

    ORR{<c>}{<q>} {<Rd>,} <Rn>, <Rm>, <shift> <Rs> 
    

    我很难找到 aarch64 的.

    I couldn't easily find aarch64 ones.

    如果有文档,C2 章关于 A64 指令描述"可能是获取信息的好位置,但它不在那里

    if it were documented, "Chapter C2 About the A64 Instruction Descriptions" might have been a good location for the information, but it's not there

    这篇关于ARM指令集中的缩写(Rn, Rd, ...)是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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