Search code examples
rustarm64neon

store neon vector register to memory


This seems like a stupid question, but I can't for the life work out how to do it.

I have a buffer like;

let result_buff: &[u8]

and I have some code like

let anded_value: uint8x16_t = unsafe { vandq_u8(sa1, sa2) };

I just want to copy this result from the vector register to result_buff[x..16], probably via an intrinsic?

basically it's 16 bytes long and I need to work out the syntax to copy it to a particular position in the [u8] / Vec<u8>.


Solution

  • Just use the intrinsic vst1q_u8:

    vst1q_u8(result_buff.as_mut_ptr(), anded_value);