[PATCH] kernel32: Save xmm0 - 3 to work around a Delphi bug on x86_64.
Marcus Meissner
meissner at suse.de
Tue Feb 6 06:07:04 CST 2018
On Tue, Feb 06, 2018 at 11:29:46AM +0000, Huw Davies wrote:
> On Tue, Feb 06, 2018 at 11:45:32AM +0100, Stefan Dösinger wrote:
> > > Am 06.02.2018 um 11:26 schrieb Huw Davies <huw at codeweavers.com>:
> > >
> > > When delay loading a symbol, Delphi saves rcx, rdx, r8 and r9 to the
> > > stack. It then calls GetProcAddress(), pops the saved registers and
> > > calls the function. This works fine if all of the parameters are
> > > ints. However, since it does not save xmm0 - 3, it relies on
> > > GetProcAddress() preserving these registers if the function takes
> > > floating point parameters.
> > This is mostly for me trying to understand things: What would make
> > changes to those registers inside GetProcAddress? Afaics this
> > function shouldn’t do anything floating point related.
>
> It doesn't need to be floating point operations. The compiler can
> used them as 128-bit registers, possibly for string-type operations.
>
> Indeed a quick grep through ntdll shows that clang uses them in
> RtlIsTextUnicode(), for example.
Inlined memset and memcpy for instance translate to xmm usage these days.
Ciao, Marcus
More information about the wine-devel
mailing list