Aligned and unaligned memory accesses?

前端 未结 6 1663
长情又很酷
长情又很酷 2020-12-13 20:33

What is the difference between aligned and unaligned memory access?

I work on an TMS320C64x DSP, and I want to use the intrinsic functions (C functions for assembly

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 21:08

    _mem2 is more general. It'll work if ptr is aligned or not. _amem2 is more strict: it requires that ptr be aligned (though is presumably slightly more efficient). So use _mem2 unless you can guarantee that ptr is always aligned.

提交回复
热议问题