About the 16byte alignment, of 4floats, its mostlikely for SSE :)

On 18 October 2010 04:16, Denis Koroskin <2korden@gmail.com> wrote:
On Mon, 18 Oct 2010 06:00:49 +0400, Walter Bright <newshound2@digitalmars.com> wrote:

http://www.digitalmars.com/d/2.0/attribute.html#align

Over time, it has become clear to me that there are only two useful alignments:

  align     // set to whatever the C ABI alignment is
  align(1)  // pack everything in, no alignment padding

I think any other alignments should be deprecated. Note that with align(1), any alignment is achievable simply by adding in byte fields where desired.

On some platforms it is desired to align struct Vec { float[4] data; } on 16 bytes. I don't recall why now, but I know for sure we do that for all platforms (other than PC maybe). I guess that has something to do with vector operations.

Bikeshed note: how about align(C) to be consistent with both align(1) and extern(C)?



--
// Yours sincerely
// Emil 'Skeen' Madsen