summaryrefslogtreecommitdiffstats
path: root/llvm/docs/AMDGPU/gfx10_msg.rst
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/docs/AMDGPU/gfx10_msg.rst')
-rw-r--r--llvm/docs/AMDGPU/gfx10_msg.rst64
1 files changed, 43 insertions, 21 deletions
diff --git a/llvm/docs/AMDGPU/gfx10_msg.rst b/llvm/docs/AMDGPU/gfx10_msg.rst
index ef531a14db1..3e6c532dd85 100644
--- a/llvm/docs/AMDGPU/gfx10_msg.rst
+++ b/llvm/docs/AMDGPU/gfx10_msg.rst
@@ -12,24 +12,29 @@ msg
A 16-bit message code. The bits of this operand have the following meaning:
- ============ ======================================================
- Bits Description
- ============ ======================================================
- 3:0 Message *type*.
- 6:4 Optional *operation*.
- 9:7 Optional *parameters*.
- 15:10 Unused.
- ============ ======================================================
-
-This operand may be specified as a positive 16-bit :ref:`integer_number<amdgpu_synid_integer_number>` or using the syntax described below:
-
- ======================================== ========================================================================
- Syntax Description
- ======================================== ========================================================================
- sendmsg(<*type*>) A message identified by its *type*.
- sendmsg(<*type*>, <*op*>) A message identified by its *type* and *operation*.
- sendmsg(<*type*>, <*op*>, <*stream*>) A message identified by its *type* and *operation* with a stream *id*.
- ======================================== ========================================================================
+ ============ =============================== ===============
+ Bits Description Value Range
+ ============ =============================== ===============
+ 3:0 Message *type*. 0..15
+ 6:4 Optional *operation*. 0..7
+ 7:7 Unused. \-
+ 9:8 Optional *stream*. 0..3
+ 15:10 Unused. \-
+ ============ =============================== ===============
+
+This operand may be specified as one of the following:
+
+* An :ref:`integer_number<amdgpu_synid_integer_number>` or an :ref:`absolute_expression<amdgpu_synid_absolute_expression>`. The value must be in the range 0..0xFFFF.
+* A *sendmsg* value described below.
+
+ ==================================== ====================================================
+ Sendmsg Value Syntax Description
+ ==================================== ====================================================
+ sendmsg(<*type*>) A message identified by its *type*.
+ sendmsg(<*type*>,<*op*>) A message identified by its *type* and *operation*.
+ sendmsg(<*type*>,<*op*>,<*stream*>) A message identified by its *type* and *operation*
+ with a stream *id*.
+ ==================================== ====================================================
*Type* may be specified using message *name* or message *id*.
@@ -37,7 +42,8 @@ This operand may be specified as a positive 16-bit :ref:`integer_number<amdgpu_s
Stream *id* is an integer in the range 0..3.
-Message *id*, operation *id* and stream *id* must be specified as positive :ref:`integer numbers<amdgpu_synid_integer_number>`.
+Numeric values may be specified as positive :ref:`integer numbers<amdgpu_synid_integer_number>`
+or :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
Each message type supports specific operations:
@@ -60,16 +66,32 @@ Each message type supports specific operations:
\ SYSMSG_OP_TTRACE_PC 4 \-
================= ========== ============================== ============ ==========
+*Sendmsg* arguments are validated depending on how *type* value is specified:
+
+* If message *type* is specified by name, arguments values must satisfy limitations detailed in the table above.
+* If message *type* is specified as a number, each argument must not exceed corresponding value range (see the first table).
+
Examples:
.. parsed-literal::
+ // numeric message code
+ msg = 0x10
s_sendmsg 0x12
+ s_sendmsg msg + 2
+
+ // sendmsg with strict arguments validation
s_sendmsg sendmsg(MSG_INTERRUPT)
- s_sendmsg sendmsg(MSG_GET_DOORBELL)
- s_sendmsg sendmsg(2, GS_OP_CUT)
s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT)
s_sendmsg sendmsg(MSG_GS, 2)
s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_EMIT_CUT, 1)
s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_TTRACE_PC)
+ s_sendmsg sendmsg(MSG_GET_DOORBELL)
+
+ // sendmsg with validation of value range only
+ msg = 2
+ op = 3
+ stream = 1
+ s_sendmsg sendmsg(msg, op, stream)
+ s_sendmsg sendmsg(2, GS_OP_CUT)
OpenPOWER on IntegriCloud