is correct to use alignas(16) for an array[8] of m128?
It's not technically wrong, but according to documentation __m128
is aligned to 16 bytes, so it's unnecessary to use alignas
.
But maybe ... I should write: alignas(128)
If your goal is to align to 128 bytes, then you can achieve it like that.
Or "since the first 16 byte are aligned" in the first example, the rest will be automatically aligned in memory?
This question confuses me. If the integer is aligned, then the first byte is aligned. Rest of the bytes are offset from the first byte. In case the size is larger than alignment, some of the subsequent bytes would be aligned at offsets equal to the alignment.
Note that there is no __m128
in standard C++.