Any chance of 128-bit alignment of static arrays?

Don Clugston dac at nospam.com.au
Mon Oct 29 07:20:41 PDT 2007


When using SSE/SSE2, it's necessary to have arrays aligned to 128-bit (16 byte) 
boundaries. For DMD Windows, this is satisfied for arrays allocated on the heap, 
but not for arrays on the stack, nor for static arrays.

There's no workaround that I know of; for example, you cannot put the array in a 
struct and specify an alignment, because the struct itself will only be aligned 
to a 8 byte boundary.

I recognize that there are major difficulties in aligning arrays on the stack, 
but could we get 16 byte -aligned double and float static arrays and array 
literals? Or is this an OPTLINK limitation?



More information about the Digitalmars-d mailing list