[llvm-dev] Automatically backing up and restoring x18 around function calls on AArch64?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 26 06:01:23 PDT 2019


On Fri, 26 Apr 2019 at 13:58, Kristof Beyls via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Doesn't implementing "always back up and restore x18 on any call to any other function" boil down to having a PCS (procedure call standard) variation where x18 is caller saved?

Not quite, that only requires the function to preserve it on return;
Martin wants it preserved on any call into a windows function too. And
possibly any call at all if he can't identify windows functions.

> Couldn't some functions on the windows/WINE side change the value of X18? In that case you'd want to see the new value of X18 after a function returns, not restore the value from before the function call?

I believe it's some equivalent of TPIDR_EL0 (i.e. a thread control
block). I'd be slightly concerned but hopeful it could be expected to
remain constant.

Cheers.

Tim.


More information about the llvm-dev mailing list