is correct to use alignas(16) for an array[8] of m128?

  alignas, c++, memory-alignment, vectorization

This is the code I usually write:

alignas(16) __m128 myBuffer[8];

But maybe (since the object-array is 128*8 bit = 128 byte) I should write:

alignas(128) __m128 myBuffer[8];

? Or "since the first 16 byte are aligned" in the first example, the rest will be automatically aligned in memory?

Source: Windows Questions C++

LEAVE A COMMENT