This patch adds a new target-independent calling convention for C++ TLS access functions.
The target-specific implementation for X86-64 is defined as following:
- Arguments are passed as for the default C calling convention
- The same applies for the return value(s)
- the callee preserves all GPRs - except RAX and RDI
It attempts to make the code in the caller as little intrusive as possible. The access function makes C-style TLS function calls in the entry and exit block, C-style TLS functions save a lot more registers than normal calls. The added calling convention ties into the existing implementation of the C-style TLS functions, so we can't simply use existing calling conventions such as preserve_mostcc.
Cheers,
Manman
I think this should be "...attempts to make the code as non-intrusive as possible." or "This calling convention aims to minimize overhead in the caller by preserving as many registers as possible".