I am reviewing the generated assembly for my code (using Visual Studio 2017) and noticed that _mm_load_ps is often (always?) Compiled for movups.
The data that I use _mm_load_ps is defined as follows:
struct alignas(16) Vector {
float v[4];
}
struct AABB {
Vector min;
Vector max;
bool intersection() const;
}
Now, when I use this construct, the following will happen:
// this code
__mm128 bb_min = _mm_load_ps(min.v);
// generates this
movups xmm4, XMMWORD PTR [r8]
I expect movaps due to alignas (16). Do I need anything else to convince the compiler to use movaps in this case?
EDIT: , . , . , , _mm_load_ps ( ) movups. , , *, movaps, ?