AMDGPUInstructionNotation.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. ============================
  2. AMDGPU Instructions Notation
  3. ============================
  4. .. contents::
  5. :local:
  6. .. _amdgpu_syn_instruction_notation:
  7. Introduction
  8. ============
  9. This is an overview of notation used to describe the syntax of AMDGPU assembler instructions.
  10. This notation mimics the :ref:`syntax of assembler instructions<amdgpu_syn_instructions>`
  11. except that instead of real operands and modifiers it provides references to their description.
  12. Instructions
  13. ============
  14. Notation
  15. ~~~~~~~~
  16. This is the notation used to describe AMDGPU instructions:
  17. ``<``\ :ref:`opcode description<amdgpu_syn_opcode_notation>`\ ``> <``\ :ref:`operands description<amdgpu_syn_instruction_operands_notation>`\ ``> <``\ :ref:`modifiers description<amdgpu_syn_instruction_modifiers_notation>`\ ``>``
  18. .. _amdgpu_syn_opcode_notation:
  19. Opcode
  20. ======
  21. Notation
  22. ~~~~~~~~
  23. TBD
  24. .. _amdgpu_syn_instruction_operands_notation:
  25. Operands
  26. ========
  27. An instruction may have zero or more *operands*. They are comma-separated in the description:
  28. ``<``\ :ref:`description of operand 0<amdgpu_syn_instruction_operand_notation>`\ ``>, <``\ :ref:`description of operand 1<amdgpu_syn_instruction_operand_notation>`\ ``>, ...``
  29. The order of *operands* is fixed. *Operands* cannot be omitted
  30. except for special cases described below.
  31. .. _amdgpu_syn_instruction_operand_notation:
  32. Notation
  33. ~~~~~~~~
  34. An operand is described using the following notation:
  35. *<name><tag0><tag1>...*
  36. Where:
  37. * *name* is a link to a description of the operand.
  38. * *tags* are optional. They are used to indicate special operand properties:
  39. .. _amdgpu_syn_instruction_operand_tags:
  40. ============== =================================================================================
  41. Operand tag Meaning
  42. ============== =================================================================================
  43. :opt An optional operand.
  44. :m An operand which may be used with
  45. :ref:`VOP3 operand modifiers<amdgpu_synid_vop3_operand_modifiers>` or
  46. :ref:`SDWA operand modifiers<amdgpu_synid_sdwa_operand_modifiers>`.
  47. :dst An input operand which may also serve as a destination
  48. if :ref:`glc<amdgpu_synid_glc>` modifier is specified.
  49. :fx This is an *f32* or *f16* operand depending on
  50. :ref:`m_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>` modifier.
  51. :<type> Operand *type* differs from *type*
  52. :ref:`implied by the opcode name<amdgpu_syn_instruction_type>`.
  53. This tag specifies actual operand *type*.
  54. ============== =================================================================================
  55. Examples:
  56. .. parsed-literal::
  57. src1:m // src1 operand may be used with operand modifiers
  58. vdata:dst // vdata operand may be used as both source and destination
  59. vdst:u32 // vdst operand has u32 type
  60. .. _amdgpu_syn_instruction_modifiers_notation:
  61. Modifiers
  62. =========
  63. An instruction may have zero or more optional *modifiers*. They are space-separated in the description:
  64. ``<``\ :ref:`description of modifier 0<amdgpu_syn_instruction_modifier_notation>`\ ``> <``\ :ref:`description of modifier 1<amdgpu_syn_instruction_modifier_notation>`\ ``> ...``
  65. The order of *modifiers* is fixed.
  66. .. _amdgpu_syn_instruction_modifier_notation:
  67. Notation
  68. ~~~~~~~~
  69. A *modifier* is described using the following notation:
  70. *<name>*
  71. Where *name* is a link to a description of the *modifier*.