I'm poking around in somebody else's code and currently trying to figure out why _mm_load_si128 exists.
Essentially, I tried replacing
_ra = _mm_load_si128(reinterpret_cast<__m128i*>(&cd->data[idx]));
with
_ra = *reinterpret_cast<__m128i*>(&cd->data[idx]);
and it works and performs exactly the same.
I figured that the load functions exist for smaller types just for the sake of convenience so people wouldn't have to pack them into continuous memory manually but for data that is already in the correct order, why bother?
Is there something else that _mm_load_si128 does? Or is it essentially just a roundabout way of assigning a value?