Skip to content

Commit 434b278

Browse files
committed
[AMDGPU][MC][NFC][DOC] Updated AMD GPU assembler syntax description.
Summary of changes: - added description of GFX90A; - minor bugfixing and improvements.
1 parent 7cd2833 commit 434b278

File tree

120 files changed

+4409
-41
lines changed

Some content is hidden

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

120 files changed

+4409
-41
lines changed

llvm/docs/AMDGPU/AMDGPUAsmGFX90a.rst

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

llvm/docs/AMDGPU/gfx10_offset_smem_buf.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
soffset
1111
===========================
1212

13-
An unsigned byte offset added to the base address to get memory address.
14-
15-
.. WARNING:: Assembler currently supports 20-bit offsets only. Use :ref:`uimm20<amdgpu_synid_uimm20>` instead of :ref:`uimm21<amdgpu_synid_uimm21>`.
13+
An unsigned 20-bit offset added to the base address to get memory address.
1614

1715
*Size:* 1 dword.
1816

19-
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`ttmp<amdgpu_synid_ttmp>`, :ref:`null<amdgpu_synid_null>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`uimm21<amdgpu_synid_uimm21>`
17+
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`ttmp<amdgpu_synid_ttmp>`, :ref:`null<amdgpu_synid_null>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`uimm20<amdgpu_synid_uimm20>`

llvm/docs/AMDGPU/gfx10_offset_smem_plain.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ An offset added to the base address to get memory address.
1515
* If offset is specified as a register, it supplies an unsigned byte offset.
1616
* If offset is specified as a 21-bit immediate, it supplies a signed byte offset.
1717

18-
.. WARNING:: Assembler currently supports 20-bit unsigned offsets only. Use :ref:`uimm20<amdgpu_synid_uimm20>` instead of :ref:`simm21<amdgpu_synid_simm21>`.
19-
2018
*Size:* 1 dword.
2119

2220
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`ttmp<amdgpu_synid_ttmp>`, :ref:`null<amdgpu_synid_null>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`simm21<amdgpu_synid_simm21>`

llvm/docs/AMDGPU/gfx90a_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_gfx90a_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_gfx90a_fx_operand:
9+
10+
FX Operand
11+
==========
12+
13+
This is an *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 16-bit operand is controlled by :ref:`m_op_sel<amdgpu_synid_mad_mix_op_sel>`.

llvm/docs/AMDGPU/gfx90a_hwreg.rst

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx90a_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 0..0xFFFF.
28+
* An *hwreg* value described below.
29+
30+
==================================== ============================================================================
31+
Hwreg Value Syntax Description
32+
==================================== ============================================================================
33+
hwreg({0..63}) All bits of a register indicated by its *id*.
34+
hwreg(<*name*>) All bits of a register indicated by its *name*.
35+
hwreg({0..63}, {0..31}, {1..32}) Register bits indicated by register *id*, first bit *offset* and *size*.
36+
hwreg(<*name*>, {0..31}, {1..32}) Register bits indicated by 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+
Defined register *names* include:
43+
44+
=================== ==========================================
45+
Name Description
46+
=================== ==========================================
47+
HW_REG_MODE Shader writeable mode bits.
48+
HW_REG_STATUS Shader read-only status.
49+
HW_REG_TRAPSTS Trap status.
50+
HW_REG_HW_ID Id of wave, simd, compute unit, etc.
51+
HW_REG_GPR_ALLOC Per-wave SGPR and VGPR allocation.
52+
HW_REG_LDS_ALLOC Per-wave LDS allocation.
53+
HW_REG_IB_STS Counters of outstanding instructions.
54+
HW_REG_SH_MEM_BASES Memory aperture.
55+
=================== ==========================================
56+
57+
Examples:
58+
59+
.. parsed-literal::
60+
61+
reg = 1
62+
offset = 2
63+
size = 4
64+
hwreg_enc = reg | (offset << 6) | ((size - 1) << 11)
65+
66+
s_getreg_b32 s2, 0x1881
67+
s_getreg_b32 s2, hwreg_enc // the same as above
68+
s_getreg_b32 s2, hwreg(1, 2, 4) // the same as above
69+
s_getreg_b32 s2, hwreg(reg, offset, size) // the same as above
70+
71+
s_getreg_b32 s2, hwreg(15)
72+
s_getreg_b32 s2, hwreg(51, 1, 31)
73+
s_getreg_b32 s2, hwreg(HW_REG_LDS_ALLOC, 0, 1)

llvm/docs/AMDGPU/gfx90a_imask.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
..
2+
**************************************************
3+
* *
4+
* Automatically generated file, do not edit! *
5+
* *
6+
**************************************************
7+
8+
.. _amdgpu_synid_gfx90a_imask:
9+
10+
imask
11+
=====
12+
13+
This operand is a mask which controls indexing mode for operands of subsequent instructions.
14+
Bits 0, 1 and 2 control indexing of *src0*, *src1* and *src2*, while bit 3 controls indexing of *dst*.
15+
Value 1 enables indexing and value 0 disables it.
16+
17+
===== ========================================
18+
Bit Meaning
19+
===== ========================================
20+
0 Enables or disables *src0* indexing.
21+
1 Enables or disables *src1* indexing.
22+
2 Enables or disables *src2* indexing.
23+
3 Enables or disables *dst* indexing.
24+
===== ========================================
25+
26+
This operand may be specified as one of the following:
27+
28+
* 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..15.
29+
* A *gpr_idx* value described below.
30+
31+
==================================== ===========================================
32+
Gpr_idx Value Syntax Description
33+
==================================== ===========================================
34+
gpr_idx(*<operands>*) Enable indexing for specified *operands*
35+
and disable it for the rest.
36+
*Operands* is a comma-separated list of
37+
values which may include:
38+
39+
* "SRC0" - enable *src0* indexing.
40+
41+
* "SRC1" - enable *src1* indexing.
42+
43+
* "SRC2" - enable *src2* indexing.
44+
45+
* "DST" - enable *dst* indexing.
46+
47+
Each of these values may be specified only
48+
once.
49+
50+
*Operands* list may be empty; this syntax
51+
disables indexing for all operands.
52+
==================================== ===========================================
53+
54+
Examples:
55+
56+
.. parsed-literal::
57+
58+
s_set_gpr_idx_mode 0
59+
s_set_gpr_idx_mode gpr_idx() // the same as above
60+
61+
s_set_gpr_idx_mode 15
62+
s_set_gpr_idx_mode gpr_idx(DST,SRC0,SRC1,SRC2) // the same as above
63+
s_set_gpr_idx_mode gpr_idx(SRC0,SRC1,SRC2,DST) // the same as above
64+
65+
s_set_gpr_idx_mode gpr_idx(DST,SRC1)

llvm/docs/AMDGPU/gfx90a_imm16.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_gfx90a_imm16:
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 -32768..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_gfx90a_imm16_1:
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 0..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_gfx90a_imm16_2:
9+
10+
imm16
11+
=====
12+
13+
A 16-bit :ref:`integer_number<amdgpu_synid_integer_number>` or an :ref:`absolute_expression<amdgpu_synid_absolute_expression>`. The value must be in the range -32768..65535.

0 commit comments

Comments
 (0)