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:
12428
12428
""""""""""
12429
12429
12430
12430
The '``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.
12433
12434
If ``value`` is smaller than ``ty2`` then a zero extension is done. If
12434
12435
``value`` is larger than ``ty2`` then a truncation is done. If they are
12435
12436
the same size, then nothing is done (*no-op cast*) other than a type
12436
12437
change.
12438
+ The ``ptrtoint`` always :ref:`captures address and provenance <pointercapture>`
12439
+ of the pointer argument.
12437
12440
12438
12441
Example:
12439
12442
""""""""
@@ -12488,6 +12491,9 @@ of the integer ``value``. If ``value`` is larger than the size of a
12488
12491
pointer then a truncation is done. If ``value`` is smaller than the size
12489
12492
of a pointer then a zero extension is done. If they are the same size,
12490
12493
nothing 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>`).
12491
12497
12492
12498
Example:
12493
12499
""""""""
You can’t perform that action at this time.
0 commit comments