For the NEON coding for ARM Arch64,How do you push the registers to the stack??Seems like STMFD is not a part of the instruction set on Arch64?

StackOverflow https://stackoverflow.com/questions/21951170

  •  15-10-2022
  •  | 
  •  

Question

For the NEON coding for ARM Arch64,How do you push the registers to the stack??Seems like STMFD is not a part of the instruction set on Arch64?Do you just save the register pairs on to the stack one by one?

Was it helpful?

Solution

AArch64 designers deliberately removed the STM/LDM instructions, presumably to simplify instruction scheduling and fault handling.

3.5 Memory Load-Store
3.5.1 Bulk Transfers

The LDM, STM, PUSH and POP instructions do not exist in A64, however bulk transfers can be constructed using the LDP and STP instructions which load and store a pair of independent registers from consecutive memory locations, and which support unaligned addresses when accessing normal memory. The LDNP and STNP instructions additionally provide a “streaming” or ”non-temporal” hint that the data does not need to be retained in caches. The PRFM (prefetch memory) instructions also include hints for “streaming” or “non-temporal” accesses, and allow targeting of a prefetch to a specific cache level.

(from ARMv8 ISA Overview)

So yes, you're supposed to use multiple STP/LDP instructions instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top