[Mono-list] Stack variable alignment on Windows

Rodrigo Kumpera kumpera at gmail.com
Mon Jun 21 09:34:58 EDT 2010


On Thu, Jun 17, 2010 at 6:47 PM, Adam Miles <amiles at gmail.com> wrote:

>
> The more I read what little documentation there is on variable alignment
> the
> more I realise I might have misunderstood what is guaranteed. The guarantee
> appears to be that the top of the stack frame is 16 byte aligned, not
> necessarily every variable on the stack. So the variable at the top (?) of
> the stack is 16 byte aligned however if the top variable is a float, the
> next variable will be on a 4 byte boundary, not 16.
>
> Where I've passed 3 Vector4f's by reference into a function it has pushed
> my
> stack allocated Vector4 12 bytes along (presumably a 'ref' variable is 4
> bytes on the stack, like a pointer). I could pass all Vector4f's by value,
> but even then you couldn't also pass a float as well.
>
> Assuming I've understood this correct (that's a big if), Mono.Simd is going
> to suffer quite poor performance with all the unavoidable unaligned loads
> and there's nothing that the user can do to work around it.
>
>
Support for 16bytes aligned locals/parameters is planned, but due to how
much work we have on our hands right now, it's hard to tell when it will
be done.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20100621/37030fd2/attachment.html 


More information about the Mono-list mailing list