File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -12428,12 +12428,15 @@ Semantics:
1242812428""""""""""
1242912429
1243012430The '``ptrtoint``' instruction converts ``value`` to integer type
12431- ``ty2`` by interpreting the pointer value as an integer and either
12432- truncating or zero extending that value to the size of the integer type.
12431+ ``ty2`` by interpreting the all pointer representation bits as an integer
12432+ (equivalent to a ``bitcast``) and either truncating or zero extending that value
12433+ to the size of the integer type.
1243312434If ``value`` is smaller than ``ty2`` then a zero extension is done. If
1243412435``value`` is larger than ``ty2`` then a truncation is done. If they are
1243512436the same size, then nothing is done (*no-op cast*) other than a type
1243612437change.
12438+ The ``ptrtoint`` always :ref:`captures address and provenance <pointercapture>`
12439+ of the pointer argument.
1243712440
1243812441Example:
1243912442""""""""
@@ -12488,6 +12491,9 @@ of the integer ``value``. If ``value`` is larger than the size of a
1248812491pointer then a truncation is done. If ``value`` is smaller than the size
1248912492of a pointer then a zero extension is done. If they are the same size,
1249012493nothing is done (*no-op cast*).
12494+ The behavior is equivalent to a ``bitcast``, however, the resulting value is not
12495+ guaranteed to be dereferenceable (e.g. if the result type is a
12496+ :ref:`non-integral pointers <nointptrtype>`).
1249112497
1249212498Example:
1249312499""""""""
You can’t perform that action at this time.
0 commit comments