Skip to content

Commit ecae8d0

Browse files
author
john-stuart2
authored
[Docs] Add more vector examples (#131887)
The order of parameters is derived from GenericOpcodes.td. I wanted to keep the examples separate from the fix.
1 parent fbc1038 commit ecae8d0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

llvm/docs/GlobalISel/GenericOpcode.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,16 +743,34 @@ same as all source operands)
743743
The _TRUNC version truncates the larger operand types to fit the
744744
destination vector elt type.
745745

746+
.. code-block:: none
747+
748+
%4:_(<4 x i32>) = G_BUILD_VECTOR %0:_(i32), %1:_(i32), %2:_(i32), %3:_(i32)
749+
750+
%4:_(<4 x i32>) = G_BUILD_VECTOR_TRUNC %0:_(i64), %1:_(i64), %2:_(i64), %3:_(i64)
751+
752+
746753
G_INSERT_VECTOR_ELT
747754
^^^^^^^^^^^^^^^^^^^
748755

749756
Insert an element into a vector
750757

758+
.. code-block:: none
759+
760+
%4:_(<16 x i32>) = G_INSERT_VECTOR_ELT %vec:_(<16 x i32>), %elt:_(i32), %idx:_(s64)
761+
762+
763+
751764
G_EXTRACT_VECTOR_ELT
752765
^^^^^^^^^^^^^^^^^^^^
753766

754767
Extract an element from a vector
755768

769+
.. code-block:: none
770+
771+
%elt:_(i32) = G_EXTRACT_VECTOR_ELT %vec:_(<16 x i32>), %idx:_(s64)
772+
773+
756774
G_SHUFFLE_VECTOR
757775
^^^^^^^^^^^^^^^^
758776

0 commit comments

Comments
 (0)