summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpooja2299 <pyadav2299@gmail.com>2021-10-20 21:50:28 +0530
committerpooja2299 <pyadav2299@gmail.com>2021-10-20 21:50:28 +0530
commit8cd7f34abd79e003525a8e1c522c3e6fe8e4e8ef (patch)
treed2d4a6371711b4eea6956d6b89f50f337ef20ad2
parent943ed5c6b95054c7efecf2b3d4b4df069907f4dc (diff)
downloadllvm-arcpatch-D108319.tar.gz
[doc][GlobalISel]Improving generic opcodes for memory operationsarcpatch-D108319
Adding examples for each of the generic opcodes involved in memory operations. Yet to add examples for some of the opcodes. Reviewed By: gandhi21299 Differential Revision: https://reviews.llvm.org/D108319
-rw-r--r--llvm/docs/GlobalISel/GenericOpcode.rst20
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/docs/GlobalISel/GenericOpcode.rst b/llvm/docs/GlobalISel/GenericOpcode.rst
index 899aa06fd069..2809c4b4a96c 100644
--- a/llvm/docs/GlobalISel/GenericOpcode.rst
+++ b/llvm/docs/GlobalISel/GenericOpcode.rst
@@ -657,6 +657,12 @@ Generic load. Expects a MachineMemOperand in addition to explicit
operands. If the result size is larger than the memory size, the
high bits are undefined, sign-extended, or zero-extended respectively.
+.. code-block:: none
+
+ %load:_(s64) = G_LOAD %ptr(p0) :: (load (s32)) ; High 32 bits are undefined.
+ %load:_(s64) = G_SEXTLOAD %ptr(p0) :: (load (s32)) ; High 32 bits are sign-extended.
+ %load:_(s64) = G_ZEXTLOAD %ptr(p0) :: (load (s32)) ; High 32 bits are zero-extended.
+
Only G_LOAD is valid if the result is a vector type. If the result is larger
than the memory size, the high elements are undefined (i.e. this is not a
per-element, vector anyextload)
@@ -664,9 +670,15 @@ per-element, vector anyextload)
G_INDEXED_LOAD
^^^^^^^^^^^^^^
-Generic indexed load. Combines a GEP with a load. $newaddr is set to $base + $offset.
+Generic indexed load opcode combines a G_PTR_ADD with a load.
+
+.. code-block:: none
+
+ $val, $addr = G_INDEXED_LOAD $base, $offset, 1 (IsPre)
+
+$addr is set to $base + $offset.
If $am is 0 (post-indexed), then the value is loaded from $base; if $am is 1 (pre-indexed)
-then the value is loaded from $newaddr.
+then the value is loaded from $addr.
G_INDEXED_SEXTLOAD
^^^^^^^^^^^^^^^^^^
@@ -692,6 +704,10 @@ G_INDEXED_STORE
Combines a store with a GEP. See description of G_INDEXED_LOAD for indexing behaviour.
+.. code:: none
+
+ $addr = G_INDEXED_STORE $val, $base, $offset
+
G_ATOMIC_CMPXCHG_WITH_SUCCESS
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^