This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Register 'names' in instruction descriptions

The registers in the instructions are usually 'named' Rn, Rm, Rd, ...

Is there some deeper meaning in the names?

Usually Rd seems to mean 'destination register'

Sometimes Rn is the only operand, sometimes it's Rm. Also the place in the instruction changes.

SMLALD: Rm is in bits 8 - 11 and Rn in bits 0 - 3.

ADD:       Rm is in bits 0 - 3 and Rn in bits 16 - 19

Rd is mostly in bits 12 - 15 but not always:

in USADA8 Rd is in bits 16 - 19, Ra in bits 12 - 15, Rm in bits 8 - 11 and Rn in bits 0 - 3.

It would be a lot easier if there was some convention. When you see some R<x> you'd know either

what it is or where it is. Maybe even both (as bits in instruction, role in operation or role in HW dependencies).

It matters which is Rn and which is Rm if they are subtracted from one another like in SSUB16.

(SSUB16{<c>}{<q>} {<Rd>,} <Rn>, <Rm> where half words are subtracted: Rn - Rm)

If there is a convention, I'd like to know what kind.

Oh and sometimes there is no Rd. The result goes to Rt instead ('t' as 'target' I presume)?

This (Rd in bits 12 - 15 or 16 - 19) also makes me wonder if ARM is RISC at all.

It's hard to find anything reduced in the instruction set as such, and Rd wandering about instruction bits

makes one suspect that microcode is used.

Parents
  • These names are largely meaningless, although:

    * 'Rd' usually refers to the 'destination' (sometimes 'RdLo' and 'RdHi').

    * 'Ra' usually refers to the accumulator in instructions that accumulate results.

    * 'Rs' usually refers to the shift amount in register-specified shifts.

    * 'Rt' and 'Rt2' usually refer to the 'transfer' register(s).

    Rn and Rm just mean two input registers; as others state above, "n" and "m" being common variable names for arbitrary integers.

    I say usually because in some cases the name comes not from the role that register has in that instruction, but the usual role that register field plays in other instructions. This was largely tidied up for the Thumb-2 syntax as part of the ARMv7 ARM. In older documentation you might see "Rd" being used as the register that is *stored* (i.e. a source register) by a STR instruction; this became "Rt" in newer documentation.

Reply
  • These names are largely meaningless, although:

    * 'Rd' usually refers to the 'destination' (sometimes 'RdLo' and 'RdHi').

    * 'Ra' usually refers to the accumulator in instructions that accumulate results.

    * 'Rs' usually refers to the shift amount in register-specified shifts.

    * 'Rt' and 'Rt2' usually refer to the 'transfer' register(s).

    Rn and Rm just mean two input registers; as others state above, "n" and "m" being common variable names for arbitrary integers.

    I say usually because in some cases the name comes not from the role that register has in that instruction, but the usual role that register field plays in other instructions. This was largely tidied up for the Thumb-2 syntax as part of the ARMv7 ARM. In older documentation you might see "Rd" being used as the register that is *stored* (i.e. a source register) by a STR instruction; this became "Rt" in newer documentation.

Children
No data