Skip to content

Commit b8e1071

Browse files
committed
[AMDGPU][GFX11][DOC][NFC] Add GFX11 assembler syntax description
1 parent cce3cd2 commit b8e1071

File tree

116 files changed

+5717
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+5717
-25
lines changed

llvm/docs/AMDGPU/AMDGPUAsmGFX11.rst

Lines changed: 3313 additions & 0 deletions
Large diffs are not rendered by default.

llvm/docs/AMDGPU/gfx11_attr.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_attr:
9+
10+
attr
11+
====
12+
13+
Interpolation attribute and channel:
14+
15+
============== ===================================
16+
Syntax Description
17+
============== ===================================
18+
attr{0..32}.x Attribute 0..32 with *x* channel.
19+
attr{0..32}.y Attribute 0..32 with *y* channel.
20+
attr{0..32}.z Attribute 0..32 with *z* channel.
21+
attr{0..32}.w Attribute 0..32 with *w* channel.
22+
============== ===================================
23+
24+
Examples:
25+
26+
.. parsed-literal::
27+
28+
lds_param_load v5, attr0.z

llvm/docs/AMDGPU/gfx11_delay.rst

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_delay:
9+
10+
delay
11+
=====
12+
13+
A delay between dependent SALU/VALU instructions.
14+
This operand may specify a delay for 2 instructions:
15+
the one after the current *s_delay_alu* instruction
16+
and for the second instruction indicated by *SKIP*.
17+
18+
The bits of this operand have the following meaning:
19+
20+
===== ========================================================== ============
21+
Bits Description Value Range
22+
===== ========================================================== ============
23+
3:0 ID0: indicates a delay for the first instruction. 0..11
24+
6:4 SKIP: indicates the position of the second instruction. 0..5
25+
10:7 ID1: indicates a delay for the second instruction. 0..11
26+
===== ========================================================== ============
27+
28+
This operand may be specified as one of the following:
29+
30+
* An :ref:`integer_number<amdgpu_synid_integer_number>` or an :ref:`absolute_expression<amdgpu_synid_absolute_expression>`. The value must be in the range from 0 to 0xFFFF.
31+
* A combination of *instid0*, *instskip*, *instid1* values which are described below.
32+
33+
======================== =========================== ===============
34+
Syntax Description Default Value
35+
======================== =========================== ===============
36+
instid0(<*ID name*>) A symbolic *ID0* value. instid0(NO_DEP)
37+
instskip(<*SKIP name*>) A symbolic *SKIP* value. instskip(SAME)
38+
instid1(<*ID name*>) A symbolic *ID1* value. instid1(NO_DEP)
39+
======================== =========================== ===============
40+
41+
These values may be specified in any order.
42+
When more than one value is specified, the values must be separated from each other by a '|'.
43+
44+
Valid *ID names* are defined below.
45+
46+
=================== ===================================================================
47+
Name Description
48+
=================== ===================================================================
49+
NO_DEP No dependency on any prior instruction. This is the default value.
50+
VALU_DEP_1 Dependency on a previous VALU instruction, 1 opcode back.
51+
VALU_DEP_2 Dependency on a previous VALU instruction, 2 opcodes back.
52+
VALU_DEP_3 Dependency on a previous VALU instruction, 3 opcodes back.
53+
VALU_DEP_4 Dependency on a previous VALU instruction, 4 opcodes back.
54+
TRANS32_DEP_1 Dependency on a previous TRANS32 instruction, 1 opcode back.
55+
TRANS32_DEP_2 Dependency on a previous TRANS32 instruction, 2 opcodes back.
56+
TRANS32_DEP_3 Dependency on a previous TRANS32 instruction, 3 opcodes back.
57+
FMA_ACCUM_CYCLE_1 Single cycle penalty for FMA accumulation.
58+
SALU_CYCLE_1 1 cycle penalty for a prior SALU instruction.
59+
SALU_CYCLE_2 2 cycle penalty for a prior SALU instruction.
60+
SALU_CYCLE_3 3 cycle penalty for a prior SALU instruction.
61+
=================== ===================================================================
62+
63+
Legal *SKIP names* are described in the following table.
64+
65+
======== ============================================================================
66+
Name Description
67+
======== ============================================================================
68+
SAME Apply second dependency to the same instruction. This is the default value.
69+
NEXT Apply second dependency to the next instruction.
70+
SKIP_1 Skip 1 instruction then apply dependency.
71+
SKIP_2 Skip 2 instructions then apply dependency.
72+
SKIP_3 Skip 3 instructions then apply dependency.
73+
SKIP_4 Skip 4 instructions then apply dependency.
74+
======== ============================================================================
75+
76+
Examples:
77+
78+
.. parsed-literal::
79+
80+
s_delay_alu instid0(VALU_DEP_1)
81+
s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)

llvm/docs/AMDGPU/gfx11_dst.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_dst:
9+
10+
dst
11+
===
12+
13+
This is an input operand. It may optionally serve as a destination if :ref:`glc<amdgpu_synid_glc>` is specified.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_fx_operand:
9+
10+
FX Operand
11+
==========
12+
13+
This is a *f32* or *f16* operand depending on instruction modifiers:
14+
15+
* Operand size is controlled by :ref:`m_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>`.
16+
* Location of the 16-bit operand is controlled by :ref:`m_op_sel<amdgpu_synid_mad_mix_op_sel>`.

llvm/docs/AMDGPU/gfx11_hwreg.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_hwreg:
9+
10+
hwreg
11+
=====
12+
13+
Bits of a hardware register being accessed.
14+
15+
The bits of this operand have the following meaning:
16+
17+
======= ===================== ============
18+
Bits Description Value Range
19+
======= ===================== ============
20+
5:0 Register *id*. 0..63
21+
10:6 First bit *offset*. 0..31
22+
15:11 *Size* in bits. 1..32
23+
======= ===================== ============
24+
25+
This operand may be specified as one of the following:
26+
27+
* An :ref:`integer_number<amdgpu_synid_integer_number>` or an :ref:`absolute_expression<amdgpu_synid_absolute_expression>`. The value must be in the range from 0 to 0xFFFF.
28+
* An *hwreg* value which is described below.
29+
30+
==================================== ===============================================================================
31+
Hwreg Value Syntax Description
32+
==================================== ===============================================================================
33+
hwreg({0..63}) All bits of a register indicated by the register *id*.
34+
hwreg(<*name*>) All bits of a register indicated by the register *name*.
35+
hwreg({0..63}, {0..31}, {1..32}) Register bits indicated by the register *id*, first bit *offset* and *size*.
36+
hwreg(<*name*>, {0..31}, {1..32}) Register bits indicated by the register *name*, first bit *offset* and *size*.
37+
==================================== ===============================================================================
38+
39+
Numeric values may be specified as positive :ref:`integer numbers<amdgpu_synid_integer_number>`
40+
or :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
41+
42+
Predefined register *names* include:
43+
44+
============================== ==========================================
45+
Name Description
46+
============================== ==========================================
47+
HW_REG_MODE Shader writable mode bits.
48+
HW_REG_STATUS Shader read-only status.
49+
HW_REG_TRAPSTS Trap status.
50+
HW_REG_HW_ID1 Id of wave, simd, compute unit, etc.
51+
HW_REG_HW_ID2 Id of queue, pipeline, etc.
52+
HW_REG_GPR_ALLOC Per-wave SGPR and VGPR allocation.
53+
HW_REG_LDS_ALLOC Per-wave LDS allocation.
54+
HW_REG_IB_STS Counters of outstanding instructions.
55+
HW_REG_SH_MEM_BASES Memory aperture.
56+
HW_REG_FLAT_SCR_LO flat_scratch_lo register.
57+
HW_REG_FLAT_SCR_HI flat_scratch_hi register.
58+
============================== ==========================================
59+
60+
Examples:
61+
62+
.. parsed-literal::
63+
64+
reg = 1
65+
offset = 2
66+
size = 4
67+
hwreg_enc = reg | (offset << 6) | ((size - 1) << 11)
68+
69+
s_getreg_b32 s2, 0x1881
70+
s_getreg_b32 s2, hwreg_enc // the same as above
71+
s_getreg_b32 s2, hwreg(1, 2, 4) // the same as above
72+
s_getreg_b32 s2, hwreg(reg, offset, size) // the same as above
73+
74+
s_getreg_b32 s2, hwreg(15)
75+
s_getreg_b32 s2, hwreg(51, 1, 31)
76+
s_getreg_b32 s2, hwreg(HW_REG_LDS_ALLOC, 0, 1)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_imm16_0533c2:
9+
10+
imm16
11+
=====
12+
13+
An :ref:`integer_number<amdgpu_synid_integer_number>` or an :ref:`absolute_expression<amdgpu_synid_absolute_expression>`. The value must be in the range from -32768 to 65535.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_imm16_169952:
9+
10+
imm16
11+
=====
12+
13+
An :ref:`integer_number<amdgpu_synid_integer_number>` or an :ref:`absolute_expression<amdgpu_synid_absolute_expression>`. The value must be in the range from 0 to 65535.

llvm/docs/AMDGPU/gfx11_label.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_label:
9+
10+
label
11+
=====
12+
13+
A branch target, which is a 16-bit signed integer treated as a PC-relative dword offset.
14+
15+
This operand may be specified as one of the following:
16+
17+
* An :ref:`integer_number<amdgpu_synid_integer_number>` or an :ref:`absolute_expression<amdgpu_synid_absolute_expression>`. The value must be in the range from -32768 to 65535.
18+
* A :ref:`symbol<amdgpu_synid_symbol>` (for example, a label) representing a relocatable address in the same compilation unit where it is referred from. The value is handled as a 16-bit PC-relative dword offset to be resolved by a linker.
19+
20+
Examples:
21+
22+
.. parsed-literal::
23+
24+
offset = 30
25+
label_1:
26+
label_2 = . + 4
27+
28+
s_branch 32
29+
s_branch offset + 2
30+
s_branch label_1
31+
s_branch label_2
32+
s_branch label_3
33+
s_branch label_4
34+
35+
label_3 = label_2 + 4
36+
label_4:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx11_m_181aa0:
9+
10+
m
11+
=
12+
13+
This operand may be used with a floating-point operand modifier :ref:`neg<amdgpu_synid_neg>`.

0 commit comments

Comments
 (0)