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

Bit 22 in some LD/ST instructions (Cortex-A7)

I wonder if the bit 22 has some function in instructions like LDRH, STRH, LDRSBT, LDRD, ... (bits 27, 26, 25 = 0, 0, 0)?

                           22
c c c c 0 0 0  0  U 1  1  0 n n n n t t t t x x x x 1 0 1 1 x x x x STRHT<c> <Rt>,[<Rn>],{,#+/-<imm8>}  A1  A8.8.219
c c c c 0 0 0  0  U 1  1  1 n n n n t t t t x x x x 1 0 1 1 x x x x LDRHT<c> <Rt>,[<Rn>],{,#+/-<imm8>}  A1  A8.8.83
c c c c 0 0 0  0  U 1  1  1 n n n n t t t t x x x x 1 1 0 1 x x x x LDRSBT<c> <Rt>,[<Rn>],{,#+/-<imm8>}  A1  A8.8.87
c c c c 0 0 0 (1) U 1 (0) 0 1 1 1 1 t t t t x x x x 1 1 0 1 x x x xLDRD<c> <Rt>,<Rt2>,<label> LDRD<c> <Rt>,<Rt2>,[PC,#-0]  A1  A8.8.73
c c c c 0 0 0  P  U 0  W  0 n n n n t t t t (0) (0) (0) (0) 1 1 0 1 m m m m> LDRD<c> <Rt>,<Rt2>,[<Rn>,+/-<Rm>]{!} LDRD<c> <Rt>,<Rt2>,[<Rn>],+/-<Rm>  A1  A8.8.74

In some instructions, like LDR, STR, LDRB (bits 27, 26, 25 = 0, 1, 1) , I understand, it chooses between byte and word access.

Parents
  • Hello,

    in legacy (or so called CISC) processors, the load or the move instruction included all addressing modes.

    However, at RISC processors, it have come that the load and the move are thought different functions.

    The move is used for the immediate or the register addressing.

    The load (or store) is used for the memory addressing.

    This would come from the load/store architecture.

    The memory addressing will form "base register + immediate index" or "base register + (index register with shift)".

    From the RISC view point, it would not be strange and it would be even normal.

    The ARM specific feature would be that the memory addressing had the pre-indexed or post-indexed mode".

    I am sorry but I cannot understand the meaning of "add r1, [r2], #imm".

    ldr r1, [r2], #imm

    would mean the following sequence because it was the post-indexed.

    1) load a memory contents of [r2] into r1

    2) add #imm to r2.

    This would be simllar to the legacy processer's notation of "ldr r1,[r2++]".

    In the "[r2++]" case, the incremented value is only the access size (i.e. 1 for byte, 2 for half-word and 4 for word).

    In the ARM case, the indexing is generalized to be able to add any value specified by #imm.

    Best regards,

    Yasuhiko Koumoto.

Reply
  • Hello,

    in legacy (or so called CISC) processors, the load or the move instruction included all addressing modes.

    However, at RISC processors, it have come that the load and the move are thought different functions.

    The move is used for the immediate or the register addressing.

    The load (or store) is used for the memory addressing.

    This would come from the load/store architecture.

    The memory addressing will form "base register + immediate index" or "base register + (index register with shift)".

    From the RISC view point, it would not be strange and it would be even normal.

    The ARM specific feature would be that the memory addressing had the pre-indexed or post-indexed mode".

    I am sorry but I cannot understand the meaning of "add r1, [r2], #imm".

    ldr r1, [r2], #imm

    would mean the following sequence because it was the post-indexed.

    1) load a memory contents of [r2] into r1

    2) add #imm to r2.

    This would be simllar to the legacy processer's notation of "ldr r1,[r2++]".

    In the "[r2++]" case, the incremented value is only the access size (i.e. 1 for byte, 2 for half-word and 4 for word).

    In the ARM case, the indexing is generalized to be able to add any value specified by #imm.

    Best regards,

    Yasuhiko Koumoto.

Children