Skip to content

Commit ddac5c9

Browse files
committed
[AMDGPU][MC][DOC] Updated AMD GPU assembler description.
Minor bugfixing and improvements. See bug 36572: https://bugs.llvm.org/show_bug.cgi?id=36572 llvm-svn: 350120
1 parent 8f70c9b commit ddac5c9

8 files changed

+2050
-2049
lines changed

llvm/docs/AMDGPU/AMDGPUAsmGFX7.rst

+191-191
Large diffs are not rendered by default.

llvm/docs/AMDGPU/AMDGPUAsmGFX8.rst

+756-756
Large diffs are not rendered by default.

llvm/docs/AMDGPU/AMDGPUAsmGFX9.rst

+1,049-1,049
Large diffs are not rendered by default.

llvm/docs/AMDGPU/gfx9_mad_type_dev.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ fx
1212

1313
This is an *f32* or *f16* operand depending on instruction modifiers:
1414

15-
* Operand size is controlled by :ref:`mad_mix_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>`.
16-
* Location of 16-bit operand is controlled by :ref:`mad_mix_op_sel<amdgpu_synid_mad_mix_op_sel>`.
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>`.
1717

llvm/docs/AMDGPU/gfx9_vaddr_flat_global.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ vaddr
1212

1313
A 64-bit flat global address or a 32-bit offset depending on addressing mode:
1414

15-
* Address = :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` + :ref:`flat_offset13<amdgpu_synid_flat_offset13>`. :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` is a 64-bit address. This mode is indicated by :ref:`saddr<amdgpu_synid9_saddr_flat_global>` set to :ref:`off<amdgpu_synid_off>`.
16-
* Address = :ref:`saddr<amdgpu_synid9_saddr_flat_global>` + :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` + :ref:`flat_offset13<amdgpu_synid_flat_offset13>`. :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` is a 32-bit offset. This mode is used when :ref:`saddr<amdgpu_synid9_saddr_flat_global>` is not :ref:`off<amdgpu_synid_off>`.
15+
* Address = :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` + :ref:`offset13s<amdgpu_synid_flat_offset13s>`. :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` is a 64-bit address. This mode is indicated by :ref:`saddr<amdgpu_synid9_saddr_flat_global>` set to :ref:`off<amdgpu_synid_off>`.
16+
* Address = :ref:`saddr<amdgpu_synid9_saddr_flat_global>` + :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` + :ref:`offset13s<amdgpu_synid_flat_offset13s>`. :ref:`vaddr<amdgpu_synid9_vaddr_flat_global>` is a 32-bit offset. This mode is used when :ref:`saddr<amdgpu_synid9_saddr_flat_global>` is not :ref:`off<amdgpu_synid_off>`.
1717

1818
.. WARNING:: Assembler currently expects a 64-bit *vaddr* regardless of addressing mode. This have to be fixed.
1919

llvm/docs/AMDGPUInstructionNotation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Where:
7373
:dst An input operand which may also serve as a destination
7474
if :ref:`glc<amdgpu_synid_glc>` modifier is specified.
7575
:fx This is an *f32* or *f16* operand depending on
76-
:ref:`mad_mix_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>` modifier.
76+
:ref:`m_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>` modifier.
7777
:<type> Operand *type* differs from *type*
7878
:ref:`implied by the opcode name<amdgpu_syn_instruction_type>`.
7979
This tag specifies actual operand *type*.

llvm/docs/AMDGPUModifierSyntax.rst

+23-23
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ DS Modifiers
2727

2828
.. _amdgpu_synid_ds_offset8:
2929

30-
ds_offset8
31-
~~~~~~~~~~
30+
offset8
31+
~~~~~~~
3232

3333
Specifies an immediate unsigned 8-bit offset, in bytes. The default value is 0.
3434

@@ -50,8 +50,8 @@ Examples:
5050
5151
.. _amdgpu_synid_ds_offset16:
5252

53-
ds_offset16
54-
~~~~~~~~~~~
53+
offset16
54+
~~~~~~~~
5555

5656
Specifies an immediate unsigned 16-bit offset, in bytes. The default value is 0.
5757

@@ -73,8 +73,8 @@ Examples:
7373
7474
.. _amdgpu_synid_sw_offset16:
7575

76-
sw_offset16
77-
~~~~~~~~~~~
76+
pattern
77+
~~~~~~~
7878

7979
This is a special modifier which may be used with *ds_swizzle_b32* instruction only.
8080
It specifies a swizzle pattern in numeric or symbolic form. The default value is 0.
@@ -205,8 +205,8 @@ FLAT Modifiers
205205

206206
.. _amdgpu_synid_flat_offset12:
207207

208-
flat_offset12
209-
~~~~~~~~~~~~~
208+
offset12
209+
~~~~~~~~
210210

211211
Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
212212

@@ -226,10 +226,10 @@ Examples:
226226
offset:4095
227227
offset:0xff
228228

229-
.. _amdgpu_synid_flat_offset13:
229+
.. _amdgpu_synid_flat_offset13s:
230230

231-
flat_offset13
232-
~~~~~~~~~~~~~
231+
offset13s
232+
~~~~~~~~~
233233

234234
Specifies an immediate signed 13-bit offset, in bytes. The default value is 0.
235235

@@ -238,7 +238,7 @@ Can be used with *global/scratch* opcodes only. GFX9 only.
238238
============================ =======================================================
239239
Syntax Description
240240
============================ =======================================================
241-
offset:{-4096..+4095} Specifies a 13-bit signed offset as an
241+
offset:{-4096..4095} Specifies a 13-bit signed offset as an
242242
:ref:`integer number <amdgpu_synid_integer_number>`.
243243
============================ =======================================================
244244

@@ -353,7 +353,7 @@ GFX7 and GFX8 only.
353353
r128 Specifies 128 bits texture resource size.
354354
=================== ================================================
355355

356-
.. WARNING:: Using this modifier should descrease *rsrc* register size from 8 to 4 dwords, but assembler does not currently support this feature.
356+
.. WARNING:: Using this modifier should descrease *rsrc* operand size from 8 to 4 dwords, but assembler does not currently support this feature.
357357

358358
tfe
359359
~~~
@@ -545,8 +545,8 @@ GFX7 only. Cannot be used with :ref:`offen<amdgpu_synid_offen>` and
545545

546546
.. _amdgpu_synid_buf_offset12:
547547

548-
buf_offset12
549-
~~~~~~~~~~~~
548+
offset12
549+
~~~~~~~~
550550

551551
Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
552552

@@ -889,8 +889,8 @@ VOP3 Modifiers
889889

890890
.. _amdgpu_synid_vop3_op_sel:
891891

892-
vop3_op_sel
893-
~~~~~~~~~~~
892+
op_sel
893+
~~~~~~
894894

895895
Selects the low [15:0] or high [31:16] operand bits for source and destination operands.
896896
By default, low bits are used for all operands.
@@ -1177,11 +1177,11 @@ GFX9 only.
11771177

11781178
.. _amdgpu_synid_mad_mix_op_sel:
11791179

1180-
mad_mix_op_sel
1181-
~~~~~~~~~~~~~~
1180+
m_op_sel
1181+
~~~~~~~~
11821182

11831183
This operand has meaning only for 16-bit source operands as indicated by
1184-
:ref:`mad_mix_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>`.
1184+
:ref:`m_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>`.
11851185
It specifies to select either the low [15:0] or high [31:16] operand bits
11861186
as input to the operation.
11871187

@@ -1206,8 +1206,8 @@ Examples:
12061206

12071207
.. _amdgpu_synid_mad_mix_op_sel_hi:
12081208

1209-
mad_mix_op_sel_hi
1210-
~~~~~~~~~~~~~~~~~
1209+
m_op_sel_hi
1210+
~~~~~~~~~~~
12111211

12121212
Selects the size of source operands: either 32 bits or 16 bits.
12131213
By default, 32 bits are used for all source operands.
@@ -1218,7 +1218,7 @@ operands. First value controls src0, second value controls src1 and so on.
12181218
The value 0 indicates 32 bits, the value 1 indicates 16 bits.
12191219

12201220
The location of 16 bits in the operand may be specified by
1221-
:ref:`mad_mix_op_sel<amdgpu_synid_mad_mix_op_sel>`.
1221+
:ref:`m_op_sel<amdgpu_synid_mad_mix_op_sel>`.
12221222

12231223
======================================== ====================================
12241224
Syntax Description

llvm/docs/AMDGPUOperandSyntax.rst

+26-25
Original file line numberDiff line numberDiff line change
@@ -950,13 +950,13 @@ When used as operands they are converted to
950950
============== ============== =============== ====================================================================
951951
Expected type Condition Result Note
952952
============== ============== =============== ====================================================================
953-
i16, u16, b16 cond(num, 16) num.u16 Truncate to 16 bits.
954-
i32, u32, b32 cond(num, 32) num.u32 Truncate to 32 bits.
955-
i64 cond(num, 32) {-1, num.i32} Truncate to 32 bits and then sign-extend the result to 64 bits.
956-
u64, b64 cond(num, 32) { 0, num.u32} Truncate to 32 bits and then zero-extend the result to 64 bits.
957-
f16 cond(num, 16) num.u16 Use low 16 bits as an f16 value.
958-
f32 cond(num, 32) num.u32 Use low 32 bits as an f32 value.
959-
f64 cond(num, 32) {num.u32, 0} Use low 32 bits of the number as high 32 bits
953+
i16, u16, b16 cond(num,16) num.u16 Truncate to 16 bits.
954+
i32, u32, b32 cond(num,32) num.u32 Truncate to 32 bits.
955+
i64 cond(num,32) {-1,num.i32} Truncate to 32 bits and then sign-extend the result to 64 bits.
956+
u64, b64 cond(num,32) { 0,num.u32} Truncate to 32 bits and then zero-extend the result to 64 bits.
957+
f16 cond(num,16) num.u16 Use low 16 bits as an f16 value.
958+
f32 cond(num,32) num.u32 Use low 32 bits as an f32 value.
959+
f64 cond(num,32) {num.u32,0} Use low 32 bits of the number as high 32 bits
960960
of the result; low 32 bits of the result are zeroed.
961961
============== ============== =============== ====================================================================
962962

@@ -972,23 +972,23 @@ Examples of valid literals:
972972
.. parsed-literal::
973973
974974
// GFX9
975-
976-
v_add_u16 v0, 0xff00, v0 // value after conversion: 0xff00
977-
v_add_u16 v0, 0xffffffffffffff00, v0 // value after conversion: 0xff00
978-
v_add_u16 v0, -256, v0 // value after conversion: 0xff00
979-
980-
s_bfe_i64 s[0:1], 0xffefffff, s3 // value after conversion: 0xffffffffffefffff
981-
s_bfe_u64 s[0:1], 0xffefffff, s3 // value after conversion: 0x00000000ffefffff
982-
v_ceil_f64_e32 v[0:1], 0xffefffff // value after conversion: 0xffefffff00000000 (-1.7976922776554302e308)
975+
// Literal value after conversion:
976+
v_add_u16 v0, 0xff00, v0 // 0xff00
977+
v_add_u16 v0, 0xffffffffffffff00, v0 // 0xff00
978+
v_add_u16 v0, -256, v0 // 0xff00
979+
// Literal value after conversion:
980+
s_bfe_i64 s[0:1], 0xffefffff, s3 // 0xffffffffffefffff
981+
s_bfe_u64 s[0:1], 0xffefffff, s3 // 0x00000000ffefffff
982+
v_ceil_f64_e32 v[0:1], 0xffefffff // 0xffefffff00000000 (-1.7976922776554302e308)
983983
984984
Examples of invalid literals:
985985

986986
.. parsed-literal::
987987
988988
// GFX9
989989
990-
v_add_u16 v0, 0x1ff00, v0 // conversion is not possible as truncated bits are not all 0 or 1
991-
v_add_u16 v0, 0xffffffffffff00ff, v0 // conversion is not possible as truncated bits do not match MSB of the result
990+
v_add_u16 v0, 0x1ff00, v0 // truncated bits are not all 0 or 1
991+
v_add_u16 v0, 0xffffffffffff00ff, v0 // truncated bits do not match MSB of the result
992992
993993
.. _amdgpu_synid_fp_lit_conv:
994994

@@ -1004,12 +1004,12 @@ When used as operands they are converted to
10041004
============== ============== ================= =================================================================
10051005
Expected type Condition Result Note
10061006
============== ============== ================= =================================================================
1007-
i16, u16, b16 cond(num, 16) f16(num) Convert to f16 and use bits of the result as an integer value.
1008-
i32, u32, b32 cond(num, 32) f32(num) Convert to f32 and use bits of the result as an integer value.
1007+
i16, u16, b16 cond(num,16) f16(num) Convert to f16 and use bits of the result as an integer value.
1008+
i32, u32, b32 cond(num,32) f32(num) Convert to f32 and use bits of the result as an integer value.
10091009
i64, u64, b64 false \- Conversion disabled because of an unclear semantics.
1010-
f16 cond(num, 16) f16(num) Convert to f16.
1011-
f32 cond(num, 32) f32(num) Convert to f32.
1012-
f64 true {num.u32.hi, 0} Use high 32 bits of the number as high 32 bits of the result;
1010+
f16 cond(num,16) f16(num) Convert to f16.
1011+
f32 cond(num,32) f32(num) Convert to f32.
1012+
f64 true {num.u32.hi,0} Use high 32 bits of the number as high 32 bits of the result;
10131013
zero-fill low 32 bits of the result.
10141014

10151015
Note that the result may differ from the original number.
@@ -1028,16 +1028,17 @@ Examples of valid literals:
10281028
v_add_f16 v1, 65500.0, v2
10291029
v_add_f32 v1, 65600.0, v2
10301030
1031-
// value before conversion: 0x7fefffffffffffff (1.7976931348623157e308)
1032-
v_ceil_f64 v[0:1], 1.7976931348623157e308 // value after conversion: 0x7fefffff00000000 (1.7976922776554302e308)
1031+
// Literal value before conversion: 1.7976931348623157e308 (0x7fefffffffffffff)
1032+
// Literal value after conversion: 1.7976922776554302e308 (0x7fefffff00000000)
1033+
v_ceil_f64 v[0:1], 1.7976931348623157e308
10331034
10341035
Examples of invalid literals:
10351036

10361037
.. parsed-literal::
10371038
10381039
// GFX9
10391040
1040-
v_add_f16 v1, 65600.0, v2 // cannot be converted to f16 because of overflow
1041+
v_add_f16 v1, 65600.0, v2 // overflow
10411042
10421043
.. _amdgpu_synid_exp_conv:
10431044

0 commit comments

Comments
 (0)