Marcus Meissner meissner@suse.de writes:
Hi,
The Win32 ABI has its stack arguments aligned at 4 (2^2) bytes. For MMX/SSE operations we however need to have the stack aligned to 16 (2^4).
So specify this explicitly.
(This should probably be even part of attribute((stdcall)) perhaps in gcc. Not sure though.)
It needs to be the default in gcc. It's not specific to stdcall or to Wine, there's plenty of Linux code that doesn't align the stack either. gcc can't start generating code that assumes 16-byte alignment on Linux.
On Mon, Apr 19, 2010 at 11:10:54AM +0200, Alexandre Julliard wrote:
Marcus Meissner meissner@suse.de writes:
Hi,
The Win32 ABI has its stack arguments aligned at 4 (2^2) bytes. For MMX/SSE operations we however need to have the stack aligned to 16 (2^4).
So specify this explicitly.
(This should probably be even part of attribute((stdcall)) perhaps in gcc. Not sure though.)
It needs to be the default in gcc. It's not specific to stdcall or to Wine, there's plenty of Linux code that doesn't align the stack either. gcc can't start generating code that assumes 16-byte alignment on Linux.
This is not going to fly, as I very much doubt we will be able to convince them.
Do we have examples of Linux code that doesn't do it?
They have their call chain adjusted to have 16 byte alignment and only ensure this for main() and so suggest to the developers to either use -mincoming/outgoing stack alignment or supply attribute if functions or code does not fulfil it.
Ciao, Marcus
Marcus Meissner meissner@suse.de writes:
This is not going to fly, as I very much doubt we will be able to convince them.
Do we have examples of Linux code that doesn't do it?
They have their call chain adjusted to have 16 byte alignment and only ensure this for main() and so suggest to the developers to either use -mincoming/outgoing stack alignment or supply attribute if functions or code does not fulfil it.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838#c11 demonstrates that even glibc doesn't always align to 16 bytes. Maybe 16-byte align is what the ABI should have been, but it's not what it is in practice.
Even if we force align the stack in Wine from now on, we can't do anything about existing binaries, which would break as soon as a distro rebuilds a system dll to use SSE. I don't see how that can be considered acceptable.