1

1.I am working on implementing memset in assembly for cortex r52(32-bit architecture). 2.In the memset implementation, I am using vstm to zero out a memory region using this operation vstm r0!, {q0-q7} // r0 (destination array), q0 - q7 : initialized to zero 3.I went through the documents but I am not able to find if I need any alignment requirement for incoming address i.e. r0. 4.I have used trace32 simulator and gave unaligned access(r0 points to unalgined access like 0x08048FE1) and it seems to work.

Can you let me know if there is any concern or point me to some document? Please let me know if you have any questions.

Thanks, Omkar

fuz
  • 88,405
  • 25
  • 200
  • 352
omkar kale
  • 53
  • 7
  • 1. Depending upon memory type, load/store operations can be allowed or not. So for normal memory type(used typically for sram: task data, task code, rtos) which is weakly ordered allows unaligned accesses. While device memory type(peripherals) does not allow the unaligned accesses as it is strongly ordered. Although all instructions do not support unaligned access and will fault. – omkar kale Jul 28 '21 at 19:12
  • 1
    The document you want is the architecture reference manual (https://developer.arm.com/documentation/ddi0406/latest). Note that even if misaligned accesses are allowed, you will get very poor performance if you use them. – Tom V Jul 28 '21 at 22:02
  • @TomV Thank you so much!. I checked the Alignment section or Section 3.2.1. It says it will be an alignment fault if it is unaligned access. Also VLDM/VSTM needs a word check. – omkar kale Jul 28 '21 at 22:38

0 Answers0