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

Loads and Stores for unaligned memory addresses

Hi,

I am trying to write a code using Neon instructions for an iOS app, based on a previous code that has been optimized with SSE instructions for a desktop app.

The SSE code has memory alignment checks throughout the code, based on which it invokes the aligned or unaligned load / store instruction. Basically the SSE has the following instructions for loads - 

__mm_storeu_si128 - the pointer address need not be 16-byte aligned

__mm_store_si128 - the pointer address needs to be 16-byte aligned

And the following instructions for store - 

__mm_loadu_si128 - the pointer address need not be 16-byte aligned

__mm_load_si128 - the pointer address needs to be 16-byte aligned.

From the ARM Neon instructions documentation, I was not able to find separate load / store instructions for the aligned or unaligned memory addresses. I could only find generic vldq_s16 for loads and vstq_s16 for stores. Do these instructions handle the memory alignment under the hood? How should I handle cases where memory addresses might not be aligned?