I'm doing several operations using SIMD instructions (SSE and AVX). As I understand, SSE instructions work best with 16-byte aligned memory, and AVX instructions work best with 32-byte aligned memory.
Would it be safe to always allocate memory aligned to 32-byte boundaries for optimal use with both SSE and AVX?
Are there ever any cases where 32-byte aligned memory is not also 16-byte aligned?
Are there ever any cases where 32-byte aligned memory is not also 16-byte aligned?
Alignment just means that the address is a multiple of 32. Any multiple of 32 is also a multiple of 16.
The first google hit for "alignment" is wikipedia, and you can follow the links to https://en.wikipedia.org/wiki/Data_structure_alignment#Definitions, which explains this in lots of detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With