https://bugs.winehq.org/show_bug.cgi?id=38780
--- Comment #16 from Zebediah Figura z.figura12@gmail.com --- (In reply to Martin Storsjö from comment #15)
I guess it could be doable to back it up in the prologue and restore it the epilogue in functions on non-windows that are marked with the ms_abi attribute. For restoring/setting it up around WINAPI callbacks, where would the compiler get the value to set into x18?
From the spilled location?
I'm not sure how far in the compiler WINAPI is visible on non-i386 platforms where stdcall is a no-op.
Well, it'd be part of the ms_abi attribute, presumably.
I don't quite follow what was suggested to be done in point (2) above though.
Essentially, to treat it as a caller-saved register (even though it's not being used as a scratch register).