Changeset View
Changeset View
Standalone View
Standalone View
llvm/docs/LangRef.rst
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 15,402 Lines • ▼ Show 20 Lines | |||||
The '``llvm.cttz``' intrinsic counts the trailing (least significant) | The '``llvm.cttz``' intrinsic counts the trailing (least significant) | ||||
zeros in a variable, or within each element of a vector. If ``src == 0`` | zeros in a variable, or within each element of a vector. If ``src == 0`` | ||||
then the result is the size in bits of the type of ``src`` if | then the result is the size in bits of the type of ``src`` if | ||||
``is_zero_poison == 0`` and ``poison`` otherwise. For example, | ``is_zero_poison == 0`` and ``poison`` otherwise. For example, | ||||
``llvm.cttz(2) = 1``. | ``llvm.cttz(2) = 1``. | ||||
.. _int_overflow: | .. _int_overflow: | ||||
.. _int_fshl: | |||||
'``llvm.fshl.*``' Intrinsic | '``llvm.fshl.*``' Intrinsic | ||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||
Syntax: | Syntax: | ||||
""""""" | """"""" | ||||
This is an overloaded intrinsic. You can use ``llvm.fshl`` on any | This is an overloaded intrinsic. You can use ``llvm.fshl`` on any | ||||
integer bit width or any vector of integer elements. Not all targets | integer bit width or any vector of integer elements. Not all targets | ||||
Show All 30 Lines | |||||
.. code-block:: text | .. code-block:: text | ||||
%r = call i8 @llvm.fshl.i8(i8 %x, i8 %y, i8 %z) ; %r = i8: msb_extract((concat(x, y) << (z % 8)), 8) | %r = call i8 @llvm.fshl.i8(i8 %x, i8 %y, i8 %z) ; %r = i8: msb_extract((concat(x, y) << (z % 8)), 8) | ||||
%r = call i8 @llvm.fshl.i8(i8 255, i8 0, i8 15) ; %r = i8: 128 (0b10000000) | %r = call i8 @llvm.fshl.i8(i8 255, i8 0, i8 15) ; %r = i8: 128 (0b10000000) | ||||
%r = call i8 @llvm.fshl.i8(i8 15, i8 15, i8 11) ; %r = i8: 120 (0b01111000) | %r = call i8 @llvm.fshl.i8(i8 15, i8 15, i8 11) ; %r = i8: 120 (0b01111000) | ||||
%r = call i8 @llvm.fshl.i8(i8 0, i8 255, i8 8) ; %r = i8: 0 (0b00000000) | %r = call i8 @llvm.fshl.i8(i8 0, i8 255, i8 8) ; %r = i8: 0 (0b00000000) | ||||
.. _int_fshr: | |||||
'``llvm.fshr.*``' Intrinsic | '``llvm.fshr.*``' Intrinsic | ||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||
Syntax: | Syntax: | ||||
""""""" | """"""" | ||||
This is an overloaded intrinsic. You can use ``llvm.fshr`` on any | This is an overloaded intrinsic. You can use ``llvm.fshr`` on any | ||||
integer bit width or any vector of integer elements. Not all targets | integer bit width or any vector of integer elements. Not all targets | ||||
▲ Show 20 Lines • Show All 6,634 Lines • ▼ Show 20 Lines | .. code-block:: llvm | ||||
%r = call <4 x i32> @llvm.vp.bswap.v4i32(<4 x i32> %a, <4 x i1> %mask, i32 %evl) | %r = call <4 x i32> @llvm.vp.bswap.v4i32(<4 x i32> %a, <4 x i1> %mask, i32 %evl) | ||||
;; For all lanes below %evl, %r is lane-wise equivalent to %also.r | ;; For all lanes below %evl, %r is lane-wise equivalent to %also.r | ||||
%t = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %a) | %t = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %a) | ||||
%also.r = select <4 x i1> %mask, <4 x i32> %t, <4 x i32> poison | %also.r = select <4 x i1> %mask, <4 x i32> %t, <4 x i32> poison | ||||
.. _int_vp_fshl: | |||||
'``llvm.vp.fshl.*``' Intrinsics | |||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||||
Syntax: | |||||
""""""" | |||||
This is an overloaded intrinsic. | |||||
:: | |||||
declare <16 x i32> @llvm.vp.fshl.v16i32 (<16 x i32> <left_op>, <16 x i32> <middle_op>, <16 x i32> <right_op>, <16 x i1> <mask>, i32 <vector_length>) | |||||
declare <vscale x 4 x i32> @llvm.vp.fshl.nxv4i32 (<vscale x 4 x i32> <left_op>, <vscale x 4 x i32> <middle_op>, <vscale x 4 x i32> <right_op>, <vscale x 4 x i1> <mask>, i32 <vector_length>) | |||||
declare <256 x i64> @llvm.vp.fshl.v256i64 (<256 x i64> <left_op>, <256 x i64> <middle_op>, <256 x i64> <right_op>, <256 x i1> <mask>, i32 <vector_length>) | |||||
Overview: | |||||
""""""""" | |||||
Predicated fshl of three vectors of integers. | |||||
Arguments: | |||||
"""""""""" | |||||
The first three operand and the result have the same vector of integer type. The | |||||
fourth operand is the vector mask and has the same number of elements as the | |||||
result vector type. The fifth operand is the explicit vector length of the | |||||
operation. | |||||
Semantics: | |||||
"""""""""" | |||||
The '``llvm.vp.fshl``' intrinsic performs fshl (:ref:`fshl <int_fshl>`) of the first, second, and third | |||||
vector operand on each enabled lane. The result on disabled lanes is a :ref:`poison value <poisonvalues>`. | |||||
Examples: | |||||
""""""""" | |||||
.. code-block:: llvm | |||||
%r = call <4 x i32> @llvm.vp.fshl.v4i32(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, <4 x i1> %mask, i32 %evl) | |||||
;; For all lanes below %evl, %r is lane-wise equivalent to %also.r | |||||
%t = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) | |||||
%also.r = select <4 x i1> %mask, <4 x i32> %t, <4 x i32> poison | |||||
'``llvm.vp.fshr.*``' Intrinsics | |||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||||
Syntax: | |||||
""""""" | |||||
This is an overloaded intrinsic. | |||||
:: | |||||
declare <16 x i32> @llvm.vp.fshr.v16i32 (<16 x i32> <left_op>, <16 x i32> <middle_op>, <16 x i32> <right_op>, <16 x i1> <mask>, i32 <vector_length>) | |||||
declare <vscale x 4 x i32> @llvm.vp.fshr.nxv4i32 (<vscale x 4 x i32> <left_op>, <vscale x 4 x i32> <middle_op>, <vscale x 4 x i32> <right_op>, <vscale x 4 x i1> <mask>, i32 <vector_length>) | |||||
declare <256 x i64> @llvm.vp.fshr.v256i64 (<256 x i64> <left_op>, <256 x i64> <middle_op>, <256 x i64> <right_op>, <256 x i1> <mask>, i32 <vector_length>) | |||||
Overview: | |||||
""""""""" | |||||
Predicated fshr of three vectors of integers. | |||||
Arguments: | |||||
"""""""""" | |||||
The first three operand and the result have the same vector of integer type. The | |||||
fourth operand is the vector mask and has the same number of elements as the | |||||
result vector type. The fifth operand is the explicit vector length of the | |||||
operation. | |||||
Semantics: | |||||
"""""""""" | |||||
The '``llvm.vp.fshr``' intrinsic performs fshr (:ref:`fshr <int_fshr>`) of the first, second, and third | |||||
vector operand on each enabled lane. The result on disabled lanes is a :ref:`poison value <poisonvalues>`. | |||||
Examples: | |||||
""""""""" | |||||
.. code-block:: llvm | |||||
%r = call <4 x i32> @llvm.vp.fshr.v4i32(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, <4 x i1> %mask, i32 %evl) | |||||
;; For all lanes below %evl, %r is lane-wise equivalent to %also.r | |||||
%t = call <4 x i32> @llvm.fshr.v4i32(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) | |||||
%also.r = select <4 x i1> %mask, <4 x i32> %t, <4 x i32> poison | |||||
.. _int_mload_mstore: | .. _int_mload_mstore: | ||||
Masked Vector Load and Store Intrinsics | Masked Vector Load and Store Intrinsics | ||||
--------------------------------------- | --------------------------------------- | ||||
LLVM provides intrinsics for predicated vector load and store operations. The predicate is specified by a mask operand, which holds one bit per vector element, switching the associated vector lane on or off. The memory addresses corresponding to the "off" lanes are not accessed. When all bits of the mask are on, the intrinsic is identical to a regular vector load or store. When all bits are off, no memory is accessed. | LLVM provides intrinsics for predicated vector load and store operations. The predicate is specified by a mask operand, which holds one bit per vector element, switching the associated vector lane on or off. The memory addresses corresponding to the "off" lanes are not accessed. When all bits of the mask are on, the intrinsic is identical to a regular vector load or store. When all bits are off, no memory is accessed. | ||||
.. _int_mload: | .. _int_mload: | ||||
▲ Show 20 Lines • Show All 4,143 Lines • Show Last 20 Lines |