Index: docs/LangRef.rst =================================================================== --- docs/LangRef.rst +++ docs/LangRef.rst @@ -406,6 +406,12 @@ This calling convention, like the `PreserveMost` calling convention, will be used by a future version of the ObjectiveC runtime and should be considered experimental at this time. + +"``explicitcc``" - A calling convention which allows function argument + register assignments and callee save registers to be explicitly + specified using the hwreg() parameter- and noclobber() + function-attributes. + "``cc ``" - Numbered convention Any calling convention may be specified by number, allowing target-specific calling conventions to be used. Target specific @@ -1012,6 +1018,12 @@ array), however ``dereferenceable()`` does imply ``nonnull`` in ``addrspace(0)`` (which is the default address space). +``hwreg()`` + This indicates that the parameter is located in a particular + physical register. This attribute may only be applied to + parameters of a function using the ``explicitcc`` calling + convention or to argments to llvm.experimental.retwr. + .. _gc: Garbage Collector Strategy Names @@ -1380,6 +1392,9 @@ show that no exceptions passes by it. This is normally the case for the ELF x86-64 abi, but it can be disabled for some compilation units. +``noclobber(,...)`` + This attribute is valid for functions using the ``explicitcc`` + calling convention. It specifies a list of callee save registers. .. _moduleasm: @@ -10377,3 +10392,39 @@ LLVM provides experimental intrinsics to support runtime patching mechanisms commonly desired in dynamic language JITs. These intrinsics are described in :doc:`StackMaps`. + +Explicitcc Intrinsics +--------------------- + +'``llvm.experimental.retwr``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare void @llvm.experimental.retwr(...) noreturn + +Overview: +""""""""" + +The ``llvm.`experimental.retwr` allows a function declared with the +explicitcc calling convention to return to the caller while +simultaneously loading values into registers. + +Arguments: +"""""""""" + +The values to return. The destination register is given by a hwreg() +parameter attribute. + +Semantics: +"""""""""" + +The current function is terminated and execution is transferred to the +caller. Before control is transferred, the values given in the +argument list are loaded into the physical registers as specified by +the hwreg() attributes. It is an error to provide an argument without +a hwreg() attribute or use ``@llvm.experimental.retwr`` in a function +which is not using the explicitcc calling convention.