This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Use aligned SSE movs for re-aligned MS ABI pro/epilogues


Hello!

> According to the Microsoft 64-bit ABI specification, registers RDI, RSI and XMM6-15 are
> non-volatile and the stack alignment is 16 bytes. In practice, the Windows implementation
> appears to not be so picky about the 16-byte alignment requirement, probably because it never
> to save SSE registers and instead just never uses them. This led to a large list
> (https://bugs.winehq.org/show_bug.cgi?id=27680) of Win64 programs violating the ABI with
> impunity, but crashing in Wine until force_align_arg_pointer was added to gcc and used in Wine.
>
> Stack re-alignment was originally done prior to int register saves, but was moved to after SSE
> saves in 2010 to better facilitate parallelization, and for simplicity's sake, the stack pointer was
> considered invalid after stack re-alignment and SSE movs were emitted unaligned relative to the
> frame pointer. But now that forced stack re-alignment is the new normal for Wine64, it means that
> it always gets the unaligned movs in Wine. This patch set fixes the problem while preserving the
> improved parallelization of int register saves of Richard Henderson's patch in 2010.

I have looked briefly through the patchset, and the approach looks good to me.

However, this patch is touching somehow delicate part of the compiler,
where lots of code-paths cross each other (and we have had quite some
hard-to-fix bugs in this area).

IMO, the patch is not appropriate for inclusion at the current stage
of the compiler development, and should wait for early stage 1. Please
resubmit it later for inclusion.

Thanks,
Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]