LDM to LTP Reason

Hi all,

The LDM and STM instruction is no more supported in ARMv8 and instead LTP and STP is used.

What is the key difference between the same why the instruction is loaded and stored in pair.

Parents
  • I think the differences are:

    (1) LDP and STP can only have 2 destination registers.

    (2) LDP and STP can have an signed offset + base as address. LDM and STM don't have offset.

    (3) LDP and STP have pre-index and post-index. such as "ldp w3, w1, [x0, #4]!" (pre-index) and "ldp w3, w1, [x0], #4" (post-index).

    LDM and STM usually need ADD instructions to get the right address. So I think may be the reason to use LDP and STP is that they are agiler.

    I think LDM with 2 destination registers is slower than LDP (as it usually needs ADD instructions to get the address). And LDM with 4 destination registers may not faster than 2 LDPs (I'm not sure).

Reply
  • I think the differences are:

    (1) LDP and STP can only have 2 destination registers.

    (2) LDP and STP can have an signed offset + base as address. LDM and STM don't have offset.

    (3) LDP and STP have pre-index and post-index. such as "ldp w3, w1, [x0, #4]!" (pre-index) and "ldp w3, w1, [x0], #4" (post-index).

    LDM and STM usually need ADD instructions to get the right address. So I think may be the reason to use LDP and STP is that they are agiler.

    I think LDM with 2 destination registers is slower than LDP (as it usually needs ADD instructions to get the address). And LDM with 4 destination registers may not faster than 2 LDPs (I'm not sure).

Children
More questions in this forum