Skip to content

Commit 1ed7570

Browse files
committed
[sysvabi64] document TLSDESC resolver extension register reqs
Document the decision in the GCC mailing list thread TLSDESC clobber ABI stability/futureproofness? https://gcc.gnu.org/legacy-ml/gcc/2018-10/msg00112.html TLSDESC resolver functions assume that any registers added by an extension are caller saved for a TLSDESC call. A brief summary: Dynamic TLS may be lazy allocated upon the first use of a TLSDESC resolver. This may involve calls to heap allocation functions provided by the user, which may use registers from extensions like SVE and SME. As the resolver function can't know what is saved it would have to save all SVE and SME state. This would be way more expensive than a caller save, and an older libc written prior to the introduction of the extension would be unaware of them so the caller has to do the save. * The SVE and SME state is already
1 parent 4c1b198 commit 1ed7570

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sysvabi64/sysvabi64.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
.. _AAELF64: https://github.com/ARM-software/abi-aa/releases
1515
.. _CPPABI64: https://developer.arm.com/docs/ihi0059/latest
1616
.. _GCABI: https://itanium-cxx-abi.github.io/cxx-abi/abi.html
17+
.. _GCCML: https://gcc.gnu.org/legacy-ml/gcc/2018-10/msg00112.html
1718
.. _LINUX_ABI: https://github.com/hjl-tools/linux-abi/wiki
1819
.. _MemTagABIELF64: https://github.com/ARM-software/abi-aa/releases
1920
.. _PAuthABIELF64: https://github.com/ARM-software/abi-aa/releases
@@ -243,6 +244,8 @@ This document refers to, or is referred to by, the following documents.
243244
+-----------------+--------------------------------------------------------------+-----------------------------------------------------------------------------+
244245
| GCABI_ | https://itanium-cxx-abi.github.io/cxx-abi/abi.html | Generic C++ ABI |
245246
+-----------------+--------------------------------------------------------------+-----------------------------------------------------------------------------+
247+
| GCCML_ | https://gcc.gnu.org/legacy-ml/gcc/2018-10/msg00112.html | GCC Mailing list topic TLSDESC clobber ABI stability/futureproofness? |
248+
+-----------------+--------------------------------------------------------------+-----------------------------------------------------------------------------+
246249
| HWCAP_ | https://www.kernel.org/doc/html/latest/arm64/elf_hwcaps.html | Linux Kernel HWCAPs interface |
247250
+-----------------+--------------------------------------------------------------+-----------------------------------------------------------------------------+
248251
| LINUX_ABI_ | https://github.com/hjl-tools/linux-abi/wiki | Linux Extensions to gABI |
@@ -2364,8 +2367,13 @@ TLS resolver functions have one argument, the address of the TLS
23642367
descriptor, passed in ``x0``, they return the offset of the variable
23652368
from the thread pointer in ``x0``.
23662369

2367-
TLS resolver functions must save all registers that they modify with
2368-
the exception of ``x0``, ``x1``, ``x30`` and the processor flags.
2370+
TLS resolver functions must save all general-purpose and SIMD&FP
2371+
registers that they modify with the exception of ``x0``, ``x1``,
2372+
``x30`` and the processor flags.
2373+
2374+
TLS resolver functions are not required to save any register added by
2375+
an extension, such as the scalable vector registers or the SVE
2376+
predicate registers. See `GCCML`_ for details.
23692377

23702378
Example Resolver Functions
23712379
^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)