1 ======================================
2 Syntax of AMDGPU Instruction Modifiers
3 ======================================
11 The following notation is used throughout this document:
13 =================== =============================================================
15 =================== =============================================================
16 {0..N} Any integer value in the range from 0 to N (inclusive).
17 <x> Syntax and meaning of *x* are explained elsewhere.
18 =================== =============================================================
20 .. _amdgpu_syn_modifiers:
28 .. _amdgpu_synid_ds_offset80:
33 Specifies the first 8-bit offset, in bytes. The default value is 0.
35 Used with DS instructions that expect two addresses.
37 =================== ====================================================================
39 =================== ====================================================================
40 offset0:{0..0xFF} Specifies an unsigned 8-bit offset as a positive
41 :ref:`integer number <amdgpu_synid_integer_number>`
42 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
43 =================== ====================================================================
53 .. _amdgpu_synid_ds_offset81:
58 Specifies the second 8-bit offset, in bytes. The default value is 0.
60 Used with DS instructions that expect two addresses.
62 =================== ====================================================================
64 =================== ====================================================================
65 offset1:{0..0xFF} Specifies an unsigned 8-bit offset as a positive
66 :ref:`integer number <amdgpu_synid_integer_number>`
67 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
68 =================== ====================================================================
78 .. _amdgpu_synid_ds_offset16:
83 Specifies a 16-bit offset, in bytes. The default value is 0.
85 Used with DS instructions that expect a single address.
87 ==================== ====================================================================
89 ==================== ====================================================================
90 offset:{0..0xFFFF} Specifies an unsigned 16-bit offset as a positive
91 :ref:`integer number <amdgpu_synid_integer_number>`
92 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
93 ==================== ====================================================================
103 .. _amdgpu_synid_sw_offset16:
108 This is a special modifier that may be used with *ds_swizzle_b32* instruction only.
109 It specifies a swizzle pattern in numeric or symbolic form. The default value is 0.
111 ======================================================= ===========================================================
113 ======================================================= ===========================================================
114 offset:{0..0xFFFF} Specifies a 16-bit swizzle pattern.
115 offset:swizzle(QUAD_PERM,{0..3},{0..3},{0..3},{0..3}) Specifies a quad permute mode pattern
117 Each number is a lane *id*.
118 offset:swizzle(BITMASK_PERM, "<mask>") Specifies a bitmask permute mode pattern.
120 The pattern converts a 5-bit lane *id* to another
121 lane *id* with which the lane interacts.
123 The *mask* is a 5-character sequence which
124 specifies how to transform the bits of the
127 The following characters are allowed:
129 * "0" - set bit to 0.
131 * "1" - set bit to 1.
133 * "p" - preserve bit.
137 offset:swizzle(BROADCAST,{2..32},{0..N}) Specifies a broadcast mode.
139 Broadcasts the value of any particular lane to
140 all lanes in its group.
142 The first numeric parameter is a group
143 size and must be equal to 2, 4, 8, 16 or 32.
145 The second numeric parameter is an index of the
146 lane being broadcast.
148 The index must not exceed group size.
149 offset:swizzle(SWAP,{1..16}) Specifies a swap mode.
151 Swaps the neighboring groups of
152 1, 2, 4, 8 or 16 lanes.
153 offset:swizzle(REVERSE,{2..32}) Specifies a reverse mode.
155 Reverses the lanes for groups of 2, 4, 8, 16 or 32 lanes.
156 ======================================================= ===========================================================
158 Note: numeric values may be specified as either
159 :ref:`integer numbers<amdgpu_synid_integer_number>` or
160 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
168 offset:swizzle(QUAD_PERM, 0, 1, 2, 3)
169 offset:swizzle(BITMASK_PERM, "01pi0")
170 offset:swizzle(BROADCAST, 2, 0)
171 offset:swizzle(SWAP, 8)
172 offset:swizzle(REVERSE, 30 + 2)
174 .. _amdgpu_synid_gds:
179 Specifies whether to use GDS or LDS memory (LDS is the default).
181 ======================================== ================================================
183 ======================================== ================================================
185 ======================================== ================================================
191 .. _amdgpu_synid_done:
196 Specifies if this is the last export from the shader to the target. By default,
197 an *export* instruction does not finish an export sequence.
199 ======================================== ================================================
201 ======================================== ================================================
202 done Indicates the last export operation.
203 ======================================== ================================================
205 .. _amdgpu_synid_compr:
210 Indicates if the data is compressed (data is not compressed by default).
212 ======================================== ================================================
214 ======================================== ================================================
215 compr Data is compressed.
216 ======================================== ================================================
223 Specifies if the :ref:`exec<amdgpu_synid_exec>` mask is valid for this *export* instruction
224 (the mask is not valid by default).
226 ======================================== ================================================
228 ======================================== ================================================
229 vm Set the flag indicating a valid
230 :ref:`exec<amdgpu_synid_exec>` mask.
231 ======================================== ================================================
233 .. _amdgpu_synid_row_en:
238 Specifies whether to export one row or multiple rows of data.
240 ======================================== ================================================
242 ======================================== ================================================
243 row_en Export multiple rows using row index from M0.
244 ======================================== ================================================
249 .. _amdgpu_synid_flat_offset12:
254 Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
256 ================= ====================================================================
258 ================= ====================================================================
259 offset:{0..4095} Specifies a 12-bit unsigned offset as a positive
260 :ref:`integer number <amdgpu_synid_integer_number>`
261 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
262 ================= ====================================================================
271 .. _amdgpu_synid_flat_offset13s:
276 Specifies an immediate signed 13-bit offset, in bytes. The default value is 0.
278 ===================== ====================================================================
280 ===================== ====================================================================
281 offset:{-4096..4095} Specifies a 13-bit signed offset as an
282 :ref:`integer number <amdgpu_synid_integer_number>`
283 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
284 ===================== ====================================================================
294 .. _amdgpu_synid_flat_offset12s:
299 Specifies an immediate signed 12-bit offset, in bytes. The default value is 0.
301 ===================== ====================================================================
303 ===================== ====================================================================
304 offset:{-2048..2047} Specifies a 12-bit signed offset as an
305 :ref:`integer number <amdgpu_synid_integer_number>`
306 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
307 ===================== ====================================================================
317 .. _amdgpu_synid_flat_offset11:
322 Specifies an immediate unsigned 11-bit offset, in bytes. The default value is 0.
324 ================= ====================================================================
326 ================= ====================================================================
327 offset:{0..2047} Specifies an 11-bit unsigned offset as a positive
328 :ref:`integer number <amdgpu_synid_integer_number>`
329 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
330 ================= ====================================================================
342 See a description :ref:`here<amdgpu_synid_dlc>`.
347 See a description :ref:`here<amdgpu_synid_glc>`.
352 See a description :ref:`here<amdgpu_synid_lds>`.
357 See a description :ref:`here<amdgpu_synid_slc>`.
362 See a description :ref:`here<amdgpu_synid_tfe>`.
367 See a description :ref:`here<amdgpu_synid_nv>`.
372 See a description :ref:`here<amdgpu_synid_sc0>`.
377 See a description :ref:`here<amdgpu_synid_sc1>`.
382 See a description :ref:`here<amdgpu_synid_nt>`.
387 .. _amdgpu_synid_dmask:
392 Specifies which channels (image components) are used by the operation.
393 By default, no channels are used.
395 =============== ====================================================================
397 =============== ====================================================================
398 dmask:{0..15} Specifies image channels as a positive
399 :ref:`integer number <amdgpu_synid_integer_number>`
400 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
402 Each bit corresponds to one of 4 image components (RGBA).
404 If the specified bit value is 0, the image component is not used,
405 while value 1 means that the component is used.
406 =============== ====================================================================
408 This modifier has some limitations depending on the instruction kind:
410 =================================================== ========================
411 Instruction Kind Valid dmask Values
412 =================================================== ========================
413 32-bit atomic *cmpswap* 0x3
414 32-bit atomic instructions except for *cmpswap* 0x1
415 64-bit atomic *cmpswap* 0xF
416 64-bit atomic instructions except for *cmpswap* 0x3
417 *gather4* 0x1, 0x2, 0x4, 0x8
418 GFX11+ *msaa_load* 0x1, 0x2, 0x4, 0x8
419 Other instructions any value
420 =================================================== ========================
430 .. _amdgpu_synid_unorm:
435 Specifies whether the address is normalized or not (the address is normalized by default).
437 ======================== ========================================
439 ======================== ========================================
440 unorm Force the address to be not normalized.
441 ======================== ========================================
446 See a description :ref:`here<amdgpu_synid_glc>`.
451 See a description :ref:`here<amdgpu_synid_slc>`.
453 .. _amdgpu_synid_r128:
458 Specifies texture resource size. The default size is 256 bits.
460 =================== ================================================
462 =================== ================================================
463 r128 Specifies 128 bits texture resource size.
464 =================== ================================================
466 .. WARNING:: Using this modifier shall decrease *rsrc* operand size from 8 to 4 dwords, \
467 but assembler does not currently support this feature.
472 See a description :ref:`here<amdgpu_synid_tfe>`.
474 .. _amdgpu_synid_lwe:
479 Specifies LOD warning status (LOD warning is disabled by default).
481 ======================================== ================================================
483 ======================================== ================================================
484 lwe Enables LOD warning.
485 ======================================== ================================================
492 Specifies if an array index must be sent to TA. By default, the array index is not sent.
494 ======================================== ================================================
496 ======================================== ================================================
497 da Send an array index to TA.
498 ======================================== ================================================
500 .. _amdgpu_synid_d16:
505 Specifies data size: 16 or 32 bits (32 bits by default).
507 ======================================== ================================================
509 ======================================== ================================================
510 d16 Enables 16-bits data mode.
512 On loads, convert data in memory to 16-bit
513 format before storing it in VGPRs.
515 For stores, convert 16-bit data in VGPRs to
516 32 bits before writing the values to memory.
518 Note that GFX8.0 does not support data packing.
519 Each 16-bit data element occupies 1 VGPR.
521 GFX8.1 and GFX9+ support data packing.
522 Each pair of 16-bit data elements
524 ======================================== ================================================
526 .. _amdgpu_synid_a16:
531 Specifies the size of image address components: 16 or 32 bits (32 bits by default).
533 ======================================== ================================================
535 ======================================== ================================================
536 a16 Enables 16-bits image address components.
537 ======================================== ================================================
539 .. _amdgpu_synid_dim:
544 Specifies surface dimension. This is a mandatory modifier. There is no default value.
546 =============================== =========================================================
548 =============================== =========================================================
549 dim:1D One-dimensional image.
550 dim:2D Two-dimensional image.
551 dim:3D Three-dimensional image.
552 dim:CUBE Cubemap array.
553 dim:1D_ARRAY One-dimensional image array.
554 dim:2D_ARRAY Two-dimensional image array.
555 dim:2D_MSAA Two-dimensional multi-sample auto-aliasing image.
556 dim:2D_MSAA_ARRAY Two-dimensional multi-sample auto-aliasing image array.
557 =============================== =========================================================
559 The following table defines an alternative syntax which is supported
560 for compatibility with SP3 assembler:
562 =============================== =========================================================
564 =============================== =========================================================
565 dim:SQ_RSRC_IMG_1D One-dimensional image.
566 dim:SQ_RSRC_IMG_2D Two-dimensional image.
567 dim:SQ_RSRC_IMG_3D Three-dimensional image.
568 dim:SQ_RSRC_IMG_CUBE Cubemap array.
569 dim:SQ_RSRC_IMG_1D_ARRAY One-dimensional image array.
570 dim:SQ_RSRC_IMG_2D_ARRAY Two-dimensional image array.
571 dim:SQ_RSRC_IMG_2D_MSAA Two-dimensional multi-sample auto-aliasing image.
572 dim:SQ_RSRC_IMG_2D_MSAA_ARRAY Two-dimensional multi-sample auto-aliasing image array.
573 =============================== =========================================================
578 See a description :ref:`here<amdgpu_synid_dlc>`.
580 Miscellaneous Modifiers
581 -----------------------
583 .. _amdgpu_synid_dlc:
588 Controls device level cache policy for memory operations. Used for synchronization.
589 When specified, forces operation to bypass device level cache, making the operation device
590 level coherent. By default, instructions use device level cache.
592 ======================================== ================================================
594 ======================================== ================================================
595 dlc Bypass device level cache.
596 ======================================== ================================================
598 .. _amdgpu_synid_glc:
603 For atomic opcodes, this modifier indicates that the instruction returns the value from memory
604 before the operation. For other opcodes, it is used together with :ref:`slc<amdgpu_synid_slc>`
605 to specify cache policy.
607 The default value is off (0).
609 ======================================== ================================================
611 ======================================== ================================================
612 glc Set glc bit to 1.
613 ======================================== ================================================
615 .. _amdgpu_synid_lds:
620 Specifies where to store the result: VGPRs or LDS (VGPRs by default).
622 ======================================== ===========================
624 ======================================== ===========================
625 lds Store the result in LDS.
626 ======================================== ===========================
633 Specifies if the instruction is operating on non-volatile memory.
634 By default, memory is volatile.
636 ======================================== ================================================
638 ======================================== ================================================
639 nv Indicates that the instruction operates on
641 ======================================== ================================================
643 .. _amdgpu_synid_slc:
648 Controls behavior of L2 cache. The default value is off (0).
650 ======================================== ================================================
652 ======================================== ================================================
653 slc Set slc bit to 1.
654 ======================================== ================================================
656 .. _amdgpu_synid_tfe:
661 Controls access to partially resident textures. The default value is off (0).
663 ======================================== ================================================
665 ======================================== ================================================
666 tfe Set tfe bit to 1.
667 ======================================== ================================================
669 .. _amdgpu_synid_sc0:
674 For atomic opcodes, this modifier indicates that the instruction returns the value from memory
675 before the operation. For other opcodes, it is used together with :ref:`sc1<amdgpu_synid_sc1>`
676 to specify cache policy.
678 ======================================== ================================================
680 ======================================== ================================================
681 sc0 Set sc0 bit to 1.
682 ======================================== ================================================
684 .. _amdgpu_synid_sc1:
689 This modifier is used together with :ref:`sc0<amdgpu_synid_sc0>` to specify cache
692 ======================================== ================================================
694 ======================================== ================================================
695 sc1 Set sc1 bit to 1.
696 ======================================== ================================================
703 Indicates an operation with non-temporal data.
705 ======================================== ================================================
707 ======================================== ================================================
709 ======================================== ================================================
711 MUBUF/MTBUF Modifiers
712 ---------------------
714 .. _amdgpu_synid_idxen:
719 Specifies whether address components include an index. By default, the index is not used.
721 May be used together with :ref:`offen<amdgpu_synid_offen>`.
723 Cannot be used with :ref:`addr64<amdgpu_synid_addr64>`.
725 ======================================== ================================================
727 ======================================== ================================================
728 idxen Address components include an index.
729 ======================================== ================================================
731 .. _amdgpu_synid_offen:
736 Specifies whether address components include an offset. By default, the offset is not used.
738 May be used together with :ref:`idxen<amdgpu_synid_idxen>`.
740 Cannot be used with :ref:`addr64<amdgpu_synid_addr64>`.
742 ======================================== ================================================
744 ======================================== ================================================
745 offen Address components include an offset.
746 ======================================== ================================================
748 .. _amdgpu_synid_addr64:
753 Specifies whether a 64-bit address is used. By default, no address is used.
755 Cannot be used with :ref:`offen<amdgpu_synid_offen>` and
756 :ref:`idxen<amdgpu_synid_idxen>` modifiers.
758 ======================================== ================================================
760 ======================================== ================================================
761 addr64 A 64-bit address is used.
762 ======================================== ================================================
764 .. _amdgpu_synid_buf_offset12:
769 Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
771 ================== ====================================================================
773 ================== ====================================================================
774 offset:{0..0xFFF} Specifies a 12-bit unsigned offset as a positive
775 :ref:`integer number <amdgpu_synid_integer_number>`
776 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
777 ================== ====================================================================
789 See a description :ref:`here<amdgpu_synid_glc>`.
794 See a description :ref:`here<amdgpu_synid_slc>`.
799 See a description :ref:`here<amdgpu_synid_lds>`.
804 See a description :ref:`here<amdgpu_synid_dlc>`.
809 See a description :ref:`here<amdgpu_synid_tfe>`.
811 .. _amdgpu_synid_fmt:
816 Specifies data and numeric formats used by the operation.
817 The default numeric format is BUF_NUM_FORMAT_UNORM.
818 The default data format is BUF_DATA_FORMAT_8.
820 ========================================= ===============================================================
822 ========================================= ===============================================================
823 format:{0..127} Use a format specified as either an
824 :ref:`integer number<amdgpu_synid_integer_number>` or an
825 :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
826 format:[<data format>] Use the specified data format and
827 default numeric format.
828 format:[<numeric format>] Use the specified numeric format and
830 format:[<data format>,<numeric format>] Use the specified data and numeric formats.
831 format:[<numeric format>,<data format>] Use the specified data and numeric formats.
832 ========================================= ===============================================================
834 .. _amdgpu_synid_format_data:
836 Supported data formats are defined in the following table:
838 ========================================= ===============================
840 ========================================= ===============================
841 BUF_DATA_FORMAT_INVALID
842 BUF_DATA_FORMAT_8 The default value.
846 BUF_DATA_FORMAT_16_16
847 BUF_DATA_FORMAT_10_11_11
848 BUF_DATA_FORMAT_11_11_10
849 BUF_DATA_FORMAT_10_10_10_2
850 BUF_DATA_FORMAT_2_10_10_10
851 BUF_DATA_FORMAT_8_8_8_8
852 BUF_DATA_FORMAT_32_32
853 BUF_DATA_FORMAT_16_16_16_16
854 BUF_DATA_FORMAT_32_32_32
855 BUF_DATA_FORMAT_32_32_32_32
856 BUF_DATA_FORMAT_RESERVED_15
857 ========================================= ===============================
859 .. _amdgpu_synid_format_num:
861 Supported numeric formats are defined below:
863 ========================================= ===============================
865 ========================================= ===============================
866 BUF_NUM_FORMAT_UNORM The default value.
868 BUF_NUM_FORMAT_USCALED
869 BUF_NUM_FORMAT_SSCALED
872 BUF_NUM_FORMAT_SNORM_OGL GFX7 only.
873 BUF_NUM_FORMAT_RESERVED_6 GFX8 and GFX9 only.
875 ========================================= ===============================
883 format:[BUF_DATA_FORMAT_16]
884 format:[BUF_DATA_FORMAT_16,BUF_NUM_FORMAT_SSCALED]
885 format:[BUF_NUM_FORMAT_FLOAT]
887 .. _amdgpu_synid_ufmt:
892 Specifies a unified format used by the operation.
893 The default format is BUF_FMT_8_UNORM.
895 ========================================= ===============================================================
897 ========================================= ===============================================================
898 format:{0..127} Use a unified format specified as either an
899 :ref:`integer number<amdgpu_synid_integer_number>` or an
900 :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
901 Note that unified format numbers are incompatible with
902 format numbers used for pre-GFX10 ISA.
903 format:[<unified format>] Use the specified unified format.
904 ========================================= ===============================================================
906 Unified format is a replacement for :ref:`data<amdgpu_synid_format_data>`
907 and :ref:`numeric<amdgpu_synid_format_num>` formats. For compatibility with older ISA,
908 :ref:`the syntax with data and numeric formats<amdgpu_synid_fmt>` is still accepted
909 provided that the combination of formats can be mapped to a unified format.
911 Supported unified formats and equivalent combinations of data and numeric formats
914 ============================== ============================== ============================= ============
915 Unified Format Syntax Equivalent Data Format Equivalent Numeric Format Note
916 ============================== ============================== ============================= ============
917 BUF_FMT_INVALID BUF_DATA_FORMAT_INVALID BUF_NUM_FORMAT_UNORM
919 BUF_FMT_8_UNORM BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_UNORM
920 BUF_FMT_8_SNORM BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_SNORM
921 BUF_FMT_8_USCALED BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_USCALED
922 BUF_FMT_8_SSCALED BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_SSCALED
923 BUF_FMT_8_UINT BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_UINT
924 BUF_FMT_8_SINT BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_SINT
926 BUF_FMT_16_UNORM BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_UNORM
927 BUF_FMT_16_SNORM BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_SNORM
928 BUF_FMT_16_USCALED BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_USCALED
929 BUF_FMT_16_SSCALED BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_SSCALED
930 BUF_FMT_16_UINT BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_UINT
931 BUF_FMT_16_SINT BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_SINT
932 BUF_FMT_16_FLOAT BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_FLOAT
934 BUF_FMT_8_8_UNORM BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_UNORM
935 BUF_FMT_8_8_SNORM BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_SNORM
936 BUF_FMT_8_8_USCALED BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_USCALED
937 BUF_FMT_8_8_SSCALED BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_SSCALED
938 BUF_FMT_8_8_UINT BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_UINT
939 BUF_FMT_8_8_SINT BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_SINT
941 BUF_FMT_32_UINT BUF_DATA_FORMAT_32 BUF_NUM_FORMAT_UINT
942 BUF_FMT_32_SINT BUF_DATA_FORMAT_32 BUF_NUM_FORMAT_SINT
943 BUF_FMT_32_FLOAT BUF_DATA_FORMAT_32 BUF_NUM_FORMAT_FLOAT
945 BUF_FMT_16_16_UNORM BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_UNORM
946 BUF_FMT_16_16_SNORM BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_SNORM
947 BUF_FMT_16_16_USCALED BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_USCALED
948 BUF_FMT_16_16_SSCALED BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_SSCALED
949 BUF_FMT_16_16_UINT BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_UINT
950 BUF_FMT_16_16_SINT BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_SINT
951 BUF_FMT_16_16_FLOAT BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_FLOAT
953 BUF_FMT_10_11_11_UNORM BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_UNORM GFX10 only
954 BUF_FMT_10_11_11_SNORM BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_SNORM GFX10 only
955 BUF_FMT_10_11_11_USCALED BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_USCALED GFX10 only
956 BUF_FMT_10_11_11_SSCALED BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_SSCALED GFX10 only
957 BUF_FMT_10_11_11_UINT BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_UINT GFX10 only
958 BUF_FMT_10_11_11_SINT BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_SINT GFX10 only
959 BUF_FMT_10_11_11_FLOAT BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_FLOAT
961 BUF_FMT_11_11_10_UNORM BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_UNORM GFX10 only
962 BUF_FMT_11_11_10_SNORM BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_SNORM GFX10 only
963 BUF_FMT_11_11_10_USCALED BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_USCALED GFX10 only
964 BUF_FMT_11_11_10_SSCALED BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_SSCALED GFX10 only
965 BUF_FMT_11_11_10_UINT BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_UINT GFX10 only
966 BUF_FMT_11_11_10_SINT BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_SINT GFX10 only
967 BUF_FMT_11_11_10_FLOAT BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_FLOAT
969 BUF_FMT_10_10_10_2_UNORM BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_UNORM
970 BUF_FMT_10_10_10_2_SNORM BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_SNORM
971 BUF_FMT_10_10_10_2_USCALED BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_USCALED GFX10 only
972 BUF_FMT_10_10_10_2_SSCALED BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_SSCALED GFX10 only
973 BUF_FMT_10_10_10_2_UINT BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_UINT
974 BUF_FMT_10_10_10_2_SINT BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_SINT
976 BUF_FMT_2_10_10_10_UNORM BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_UNORM
977 BUF_FMT_2_10_10_10_SNORM BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_SNORM
978 BUF_FMT_2_10_10_10_USCALED BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_USCALED
979 BUF_FMT_2_10_10_10_SSCALED BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_SSCALED
980 BUF_FMT_2_10_10_10_UINT BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_UINT
981 BUF_FMT_2_10_10_10_SINT BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_SINT
983 BUF_FMT_8_8_8_8_UNORM BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_UNORM
984 BUF_FMT_8_8_8_8_SNORM BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_SNORM
985 BUF_FMT_8_8_8_8_USCALED BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_USCALED
986 BUF_FMT_8_8_8_8_SSCALED BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_SSCALED
987 BUF_FMT_8_8_8_8_UINT BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_UINT
988 BUF_FMT_8_8_8_8_SINT BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_SINT
990 BUF_FMT_32_32_UINT BUF_DATA_FORMAT_32_32 BUF_NUM_FORMAT_UINT
991 BUF_FMT_32_32_SINT BUF_DATA_FORMAT_32_32 BUF_NUM_FORMAT_SINT
992 BUF_FMT_32_32_FLOAT BUF_DATA_FORMAT_32_32 BUF_NUM_FORMAT_FLOAT
994 BUF_FMT_16_16_16_16_UNORM BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_UNORM
995 BUF_FMT_16_16_16_16_SNORM BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_SNORM
996 BUF_FMT_16_16_16_16_USCALED BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_USCALED
997 BUF_FMT_16_16_16_16_SSCALED BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_SSCALED
998 BUF_FMT_16_16_16_16_UINT BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_UINT
999 BUF_FMT_16_16_16_16_SINT BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_SINT
1000 BUF_FMT_16_16_16_16_FLOAT BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_FLOAT
1002 BUF_FMT_32_32_32_UINT BUF_DATA_FORMAT_32_32_32 BUF_NUM_FORMAT_UINT
1003 BUF_FMT_32_32_32_SINT BUF_DATA_FORMAT_32_32_32 BUF_NUM_FORMAT_SINT
1004 BUF_FMT_32_32_32_FLOAT BUF_DATA_FORMAT_32_32_32 BUF_NUM_FORMAT_FLOAT
1005 BUF_FMT_32_32_32_32_UINT BUF_DATA_FORMAT_32_32_32_32 BUF_NUM_FORMAT_UINT
1006 BUF_FMT_32_32_32_32_SINT BUF_DATA_FORMAT_32_32_32_32 BUF_NUM_FORMAT_SINT
1007 BUF_FMT_32_32_32_32_FLOAT BUF_DATA_FORMAT_32_32_32_32 BUF_NUM_FORMAT_FLOAT
1008 ============================== ============================== ============================= ============
1015 format:[BUF_FMT_32_UINT]
1023 See a description :ref:`here<amdgpu_synid_glc>`.
1028 See a description :ref:`here<amdgpu_synid_nv>`.
1033 See a description :ref:`here<amdgpu_synid_dlc>`.
1035 .. _amdgpu_synid_smem_offset20u:
1040 Specifies an unsigned 20-bit offset, in bytes. The default value is 0.
1042 ==================== ====================================================================
1044 ==================== ====================================================================
1045 offset:{0..0xFFFFF} Specifies an offset as a positive
1046 :ref:`integer number <amdgpu_synid_integer_number>`
1047 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1048 ==================== ====================================================================
1058 .. _amdgpu_synid_smem_offset21s:
1063 Specifies a signed 21-bit offset, in bytes. The default value is 0.
1065 ============================= ====================================================================
1067 ============================= ====================================================================
1068 offset:{-0x100000..0xFFFFF} Specifies an offset as an
1069 :ref:`integer number <amdgpu_synid_integer_number>`
1070 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1071 ============================= ====================================================================
1081 VINTRP/VINTERP/LDSDIR Modifiers
1082 -------------------------------
1084 .. _amdgpu_synid_high:
1089 Specifies which half of the LDS word to use. Low half of LDS word is used by default.
1091 ======================================== ================================
1093 ======================================== ================================
1094 high Use the high half of LDS word.
1095 ======================================== ================================
1100 See a description :ref:`here<amdgpu_synid_neg>`.
1102 .. _amdgpu_synid_wait_exp:
1107 Specifies a wait on the EXP counter before issuing the current instruction.
1108 The counter must be less than or equal to this value before the instruction is issued.
1109 If set to 7, no wait is performed.
1111 The default value is zero. This is a safe value, but it may be suboptimal.
1113 ================ ======================================================
1115 ================ ======================================================
1116 wait_exp:{0..7} An additional wait on the EXP counter before
1117 issuing this instruction.
1118 ================ ======================================================
1120 .. _amdgpu_synid_wait_vdst:
1125 Specifies a wait on the VA_VDST counter before issuing the current instruction.
1126 The counter must be less than or equal to this value before the instruction is issued.
1127 If set to 15, no wait is performed.
1129 The default value is zero. This is a safe value, but it may be suboptimal.
1131 ================== ======================================================
1133 ================== ======================================================
1134 wait_vdst:{0..15} An additional wait on the VA_VDST counter before
1135 issuing this instruction.
1136 ================== ======================================================
1141 .. _amdgpu_synid_dpp8_sel:
1146 Selects which lanes to pull data from, within a group of 8 lanes. This is a mandatory modifier.
1147 There is no default value.
1149 The *dpp8_sel* modifier must specify exactly 8 values.
1150 The first value selects which lane to read from to supply data into lane 0.
1151 The second value controls lane 1 and so on.
1153 Each value may be specified as either
1154 an :ref:`integer number<amdgpu_synid_integer_number>` or
1155 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1157 =============================================================== ===========================
1159 =============================================================== ===========================
1160 dpp8:[{0..7},{0..7},{0..7},{0..7},{0..7},{0..7},{0..7},{0..7}] Select lanes to read from.
1161 =============================================================== ===========================
1167 dpp8:[7,6,5,4,3,2,1,0]
1168 dpp8:[0,1,0,1,0,1,0,1]
1170 .. _amdgpu_synid_fi8:
1175 Controls interaction with inactive lanes for *dpp8* instructions. The default value is zero.
1177 Note: *inactive* lanes are those whose :ref:`exec<amdgpu_synid_exec>` mask bit is zero.
1179 ==================================== =====================================================
1181 ==================================== =====================================================
1182 fi:0 Fetch zero when accessing data from inactive lanes.
1183 fi:1 Fetch pre-existing values from inactive lanes.
1184 ==================================== =====================================================
1186 Note: numeric values may be specified as either
1187 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1188 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1193 .. _amdgpu_synid_dpp_ctrl:
1198 Specifies how data is shared between threads. This is a mandatory modifier.
1199 There is no default value.
1201 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1203 ======================================== ========================================================
1205 ======================================== ========================================================
1206 quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
1207 row_mirror Mirror threads within row.
1208 row_half_mirror Mirror threads within 1/2 row (8 threads).
1209 row_bcast:15 Broadcast the 15th thread of each row to the next row.
1210 row_bcast:31 Broadcast thread 31 to rows 2 and 3.
1211 wave_shl:1 Wavefront left shift by 1 thread.
1212 wave_rol:1 Wavefront left rotate by 1 thread.
1213 wave_shr:1 Wavefront right shift by 1 thread.
1214 wave_ror:1 Wavefront right rotate by 1 thread.
1215 row_shl:{1..15} Row shift left by 1-15 threads.
1216 row_shr:{1..15} Row shift right by 1-15 threads.
1217 row_ror:{1..15} Row rotate right by 1-15 threads.
1218 ======================================== ========================================================
1220 Note: numeric values may be specified as either
1221 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1222 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1228 quad_perm:[0, 1, 2, 3]
1231 .. _amdgpu_synid_dpp16_ctrl:
1236 Specifies how data is shared between threads. This is a mandatory modifier.
1237 There is no default value.
1239 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1240 (There are only two rows in *wave32* mode.)
1242 ======================================== =======================================================
1244 ======================================== =======================================================
1245 quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
1246 row_mirror Mirror threads within row.
1247 row_half_mirror Mirror threads within 1/2 row (8 threads).
1248 row_share:{0..15} Share the value from the specified lane with other
1250 row_xmask:{0..15} Fetch from XOR(<current lane id>,<specified lane id>).
1251 row_shl:{1..15} Row shift left by 1-15 threads.
1252 row_shr:{1..15} Row shift right by 1-15 threads.
1253 row_ror:{1..15} Row rotate right by 1-15 threads.
1254 ======================================== =======================================================
1256 Note: numeric values may be specified as either
1257 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1258 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1264 quad_perm:[0, 1, 2, 3]
1267 .. _amdgpu_synid_dpp32_ctrl:
1272 Specifies how data is shared between threads. This is a mandatory modifier.
1273 There is no default value.
1275 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1277 ======================================== =========================================================
1279 ======================================== =========================================================
1280 quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
1281 row_mirror Mirror threads within row.
1282 row_half_mirror Mirror threads within 1/2 row (8 threads).
1283 row_bcast:15 Broadcast the 15th thread of each row to the next row.
1284 row_bcast:31 Broadcast thread 31 to rows 2 and 3.
1285 wave_shl:1 Wavefront left shift by 1 thread.
1286 wave_rol:1 Wavefront left rotate by 1 thread.
1287 wave_shr:1 Wavefront right shift by 1 thread.
1288 wave_ror:1 Wavefront right rotate by 1 thread.
1289 row_shl:{1..15} Row shift left by 1-15 threads.
1290 row_shr:{1..15} Row shift right by 1-15 threads.
1291 row_ror:{1..15} Row rotate right by 1-15 threads.
1292 row_newbcast:{1..15} Broadcast a thread within a row to the whole row.
1293 ======================================== =========================================================
1295 Note: numeric values may be specified as either
1296 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1297 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1303 quad_perm:[0, 1, 2, 3]
1307 .. _amdgpu_synid_dpp64_ctrl:
1312 Specifies how data is shared between threads. This is a mandatory modifier.
1313 There is no default value.
1315 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1317 ======================================== ==================================================
1319 ======================================== ==================================================
1320 row_newbcast:{1..15} Broadcast a thread within a row to the whole row.
1321 ======================================== ==================================================
1323 Note: numeric values may be specified as either
1324 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1325 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1334 .. _amdgpu_synid_row_mask:
1339 Controls which rows are enabled for data sharing. By default, all rows are enabled.
1341 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1342 (There are only two rows in *wave32* mode.)
1344 ================= ====================================================================
1346 ================= ====================================================================
1347 row_mask:{0..15} Specifies a *row mask* as a positive
1348 :ref:`integer number <amdgpu_synid_integer_number>`
1349 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1351 Each of the 4 bits in the mask controls one row
1352 (0 - disabled, 1 - enabled).
1354 In *wave32* mode, the values shall be limited to {0..7}.
1355 ================= ====================================================================
1365 .. _amdgpu_synid_bank_mask:
1370 Controls which banks are enabled for data sharing. By default, all banks are enabled.
1372 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1373 (There are only two rows in *wave32* mode.)
1375 ================== ====================================================================
1377 ================== ====================================================================
1378 bank_mask:{0..15} Specifies a *bank mask* as a positive
1379 :ref:`integer number <amdgpu_synid_integer_number>`
1380 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1382 Each of the 4 bits in the mask controls one bank
1383 (0 - disabled, 1 - enabled).
1384 ================== ====================================================================
1394 .. _amdgpu_synid_bound_ctrl:
1399 Controls data sharing when accessing an invalid lane. By default, data sharing with
1400 invalid lanes is disabled.
1402 ======================================== ================================================
1404 ======================================== ================================================
1405 bound_ctrl:1 Enables data sharing with invalid lanes.
1407 Accessing data from an invalid lane will
1410 bound_ctrl:0 (GFX11+) Disables data sharing with invalid lanes.
1411 ======================================== ================================================
1413 .. WARNING:: For historical reasons, *bound_ctrl:0* has the same meaning as *bound_ctrl:1* for older architectures.
1415 .. _amdgpu_synid_fi16:
1420 Controls interaction with *inactive* lanes for *dpp16* instructions. The default value is zero.
1422 Note: *inactive* lanes are those whose :ref:`exec<amdgpu_synid_exec>` mask bit is zero.
1424 ======================================== ==================================================
1426 ======================================== ==================================================
1427 fi:0 Interaction with inactive lanes is controlled by
1428 :ref:`bound_ctrl<amdgpu_synid_bound_ctrl>`.
1430 fi:1 Fetch pre-existing values from inactive lanes.
1431 ======================================== ==================================================
1433 Note: numeric values may be specified as either
1434 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1435 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1443 See a description :ref:`here<amdgpu_synid_clamp>`.
1448 See a description :ref:`here<amdgpu_synid_omod>`.
1450 .. _amdgpu_synid_dst_sel:
1455 Selects which bits in the destination are affected. By default, all bits are affected.
1457 ======================================== ================================================
1459 ======================================== ================================================
1460 dst_sel:DWORD Use bits 31:0.
1461 dst_sel:BYTE_0 Use bits 7:0.
1462 dst_sel:BYTE_1 Use bits 15:8.
1463 dst_sel:BYTE_2 Use bits 23:16.
1464 dst_sel:BYTE_3 Use bits 31:24.
1465 dst_sel:WORD_0 Use bits 15:0.
1466 dst_sel:WORD_1 Use bits 31:16.
1467 ======================================== ================================================
1469 .. _amdgpu_synid_dst_unused:
1474 Controls what to do with the bits in the destination which are not selected
1475 by :ref:`dst_sel<amdgpu_synid_dst_sel>`.
1476 By default, unused bits are preserved.
1478 ======================================== ================================================
1480 ======================================== ================================================
1481 dst_unused:UNUSED_PAD Pad with zeros.
1482 dst_unused:UNUSED_SEXT Sign-extend upper bits, zero lower bits.
1483 dst_unused:UNUSED_PRESERVE Preserve bits.
1484 ======================================== ================================================
1486 .. _amdgpu_synid_src0_sel:
1491 Controls which bits in the src0 are used. By default, all bits are used.
1493 ======================================== ================================================
1495 ======================================== ================================================
1496 src0_sel:DWORD Use bits 31:0.
1497 src0_sel:BYTE_0 Use bits 7:0.
1498 src0_sel:BYTE_1 Use bits 15:8.
1499 src0_sel:BYTE_2 Use bits 23:16.
1500 src0_sel:BYTE_3 Use bits 31:24.
1501 src0_sel:WORD_0 Use bits 15:0.
1502 src0_sel:WORD_1 Use bits 31:16.
1503 ======================================== ================================================
1505 .. _amdgpu_synid_src1_sel:
1510 Controls which bits in the src1 are used. By default, all bits are used.
1512 ======================================== ================================================
1514 ======================================== ================================================
1515 src1_sel:DWORD Use bits 31:0.
1516 src1_sel:BYTE_0 Use bits 7:0.
1517 src1_sel:BYTE_1 Use bits 15:8.
1518 src1_sel:BYTE_2 Use bits 23:16.
1519 src1_sel:BYTE_3 Use bits 31:24.
1520 src1_sel:WORD_0 Use bits 15:0.
1521 src1_sel:WORD_1 Use bits 31:16.
1522 ======================================== ================================================
1524 .. _amdgpu_synid_sdwa_operand_modifiers:
1526 SDWA Operand Modifiers
1527 ----------------------
1529 Operand modifiers are not used separately. They are applied to source operands.
1534 See a description :ref:`here<amdgpu_synid_abs>`.
1539 See a description :ref:`here<amdgpu_synid_neg>`.
1541 .. _amdgpu_synid_sext:
1546 Sign-extends the value of a (sub-dword) integer operand to fill all 32 bits.
1548 Valid for integer operands only.
1550 ======================================== ================================================
1552 ======================================== ================================================
1553 sext(<operand>) Sign-extend operand value.
1554 ======================================== ================================================
1566 .. _amdgpu_synid_vop3_op_sel:
1571 Selects the low [15:0] or high [31:16] operand bits for source and destination operands.
1572 By default, low bits are used for all operands.
1574 The number of values specified with the op_sel modifier must match the number of instruction
1575 operands (both source and destination). The first value controls src0, the second value controls src1
1576 and so on, except that the last value controls destination.
1577 The value 0 selects the low bits, while 1 selects the high bits.
1579 Note: op_sel modifier affects 16-bit operands only. For 32-bit operands, the value specified
1580 by op_sel must be 0.
1582 ======================================== ============================================================
1584 ======================================== ============================================================
1585 op_sel:[{0..1},{0..1}] Select operand bits for instructions with 1 source operand.
1586 op_sel:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
1587 op_sel:[{0..1},{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
1588 ======================================== ============================================================
1590 Note: numeric values may be specified as either
1591 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1592 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1601 .. _amdgpu_synid_dpp_op_sel:
1606 This is a special version of *op_sel* used for *permlane* opcodes to specify
1607 dpp-like mode bits - :ref:`fi<amdgpu_synid_fi16>` and
1608 :ref:`bound_ctrl<amdgpu_synid_bound_ctrl>`.
1610 ======================================== =================================================================
1612 ======================================== =================================================================
1613 op_sel:[{0..1},{0..1}] The first bit specifies :ref:`fi<amdgpu_synid_fi16>`, the second
1614 bit specifies :ref:`bound_ctrl<amdgpu_synid_bound_ctrl>`.
1615 ======================================== =================================================================
1617 Note: numeric values may be specified as either
1618 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1619 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1627 .. _amdgpu_synid_clamp:
1632 Clamp meaning depends on instruction.
1634 For *v_cmp* instructions, clamp modifier indicates that the compare signals
1635 if a floating-point exception occurs. By default, signaling is disabled.
1637 For integer operations, clamp modifier indicates that the result must be clamped
1638 to the largest and smallest representable value. By default, there is no clamping.
1640 For floating-point operations, clamp modifier indicates that the result must be clamped
1641 to the range [0.0, 1.0]. By default, there is no clamping.
1643 Note: clamp modifier is applied after :ref:`output modifiers<amdgpu_synid_omod>` (if any).
1645 ======================================== ================================================
1647 ======================================== ================================================
1648 clamp Enables clamping (or signaling).
1649 ======================================== ================================================
1651 .. _amdgpu_synid_omod:
1656 Specifies if an output modifier must be applied to the result.
1657 It is assumed that the result is a floating-point number.
1659 By default, no output modifiers are applied.
1661 Note: output modifiers are applied before :ref:`clamping<amdgpu_synid_clamp>` (if any).
1663 ======================================== ================================================
1665 ======================================== ================================================
1666 mul:2 Multiply the result by 2.
1667 mul:4 Multiply the result by 4.
1668 div:2 Multiply the result by 0.5.
1669 ======================================== ================================================
1671 Note: numeric values may be specified as either
1672 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1673 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1680 mul:x // x must be equal to 2 or 4
1682 .. _amdgpu_synid_vop3_operand_modifiers:
1684 VOP3 Operand Modifiers
1685 ----------------------
1687 Operand modifiers are not used separately. They are applied to source operands.
1689 .. _amdgpu_synid_abs:
1694 Computes the absolute value of its operand. Must be applied before :ref:`neg<amdgpu_synid_neg>`
1695 (if any). Valid for floating-point operands only.
1697 ======================================== ====================================================
1699 ======================================== ====================================================
1700 abs(<operand>) Get the absolute value of a floating-point operand.
1701 \|<operand>| The same as above (an SP3 syntax).
1702 ======================================== ====================================================
1704 Note: avoid using SP3 syntax with operands specified as expressions because the trailing '|'
1705 may be misinterpreted. Such operands should be enclosed into additional parentheses, as shown
1715 \|(x|y)| // additional parentheses are required
1717 .. _amdgpu_synid_neg:
1722 Computes the negative value of its operand. Must be applied after :ref:`abs<amdgpu_synid_abs>`
1723 (if any). Valid for floating-point operands only.
1725 ================== ====================================================
1727 ================== ====================================================
1728 neg(<operand>) Get the negative value of a floating-point operand.
1729 An optional :ref:`abs<amdgpu_synid_abs>` modifier
1730 may be applied to the operand before negation.
1731 -<operand> The same as above (an SP3 syntax).
1732 ================== ====================================================
1734 Note: SP3 syntax is supported with limitations because of a potential ambiguity.
1735 Currently, it is allowed in the following cases:
1737 * Before a register.
1738 * Before an :ref:`abs<amdgpu_synid_abs>` modifier.
1739 * Before an SP3 :ref:`abs<amdgpu_synid_abs>` modifier.
1741 In all other cases, "-" is handled as a part of an expression that follows the sign.
1747 // Operands with negate modifiers
1755 // Expressions where "-" has a different meaning
1762 This section describes modifiers of *regular* VOP3P instructions.
1764 *v_mad_mix\** and *v_fma_mix\**
1765 instructions use these modifiers :ref:`in a special manner<amdgpu_synid_mad_mix>`.
1767 .. _amdgpu_synid_op_sel:
1772 Selects the low [15:0] or high [31:16] operand bits as input to the operation,
1773 which results in the lower-half of the destination.
1774 By default, low 16 bits are used for all operands.
1776 The number of values specified by the *op_sel* modifier must match the number of source
1777 operands. The first value controls src0, the second value controls src1 and so on.
1779 The value 0 selects the low bits, while 1 selects the high bits.
1781 ================================= =============================================================
1783 ================================= =============================================================
1784 op_sel:[{0..1}] Select operand bits for instructions with 1 source operand.
1785 op_sel:[{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
1786 op_sel:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
1787 ================================= =============================================================
1789 Note: numeric values may be specified as either
1790 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1791 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1800 .. _amdgpu_synid_op_sel_hi:
1805 Selects the low [15:0] or high [31:16] operand bits as input to the operation,
1806 which results in the upper-half of the destination.
1807 By default, high 16 bits are used for all operands.
1809 The number of values specified by the *op_sel_hi* modifier must match the number of source
1810 operands. The first value controls src0, the second value controls src1 and so on.
1812 The value 0 selects the low bits, while 1 selects the high bits.
1814 =================================== =============================================================
1816 =================================== =============================================================
1817 op_sel_hi:[{0..1}] Select operand bits for instructions with 1 source operand.
1818 op_sel_hi:[{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
1819 op_sel_hi:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
1820 =================================== =============================================================
1822 Note: numeric values may be specified as either
1823 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1824 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1833 .. _amdgpu_synid_neg_lo:
1838 Specifies whether to change the sign of operand values selected by
1839 :ref:`op_sel<amdgpu_synid_op_sel>`. These values are then used
1840 as input to the operation, which results in the upper-half of the destination.
1842 The number of values specified by this modifier must match the number of source
1843 operands. The first value controls src0, the second value controls src1 and so on.
1845 The value 0 indicates that the corresponding operand value is used unmodified,
1846 the value 1 indicates that the negative value of the operand must be used.
1848 By default, operand values are used unmodified.
1850 This modifier is valid for floating-point operands only.
1852 ================================ ==================================================================
1854 ================================ ==================================================================
1855 neg_lo:[{0..1}] Select affected operands for instructions with 1 source operand.
1856 neg_lo:[{0..1},{0..1}] Select affected operands for instructions with 2 source operands.
1857 neg_lo:[{0..1},{0..1},{0..1}] Select affected operands for instructions with 3 source operands.
1858 ================================ ==================================================================
1860 Note: numeric values may be specified as either
1861 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1862 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1871 .. _amdgpu_synid_neg_hi:
1876 Specifies whether to change sign of operand values selected by
1877 :ref:`op_sel_hi<amdgpu_synid_op_sel_hi>`. These values are then used
1878 as input to the operation, which results in the upper-half of the destination.
1880 The number of values specified by this modifier must match the number of source
1881 operands. The first value controls src0, the second value controls src1 and so on.
1883 The value 0 indicates that the corresponding operand value is used unmodified,
1884 the value 1 indicates that the negative value of the operand must be used.
1886 By default, operand values are used unmodified.
1888 This modifier is valid for floating-point operands only.
1890 =============================== ==================================================================
1892 =============================== ==================================================================
1893 neg_hi:[{0..1}] Select affected operands for instructions with 1 source operand.
1894 neg_hi:[{0..1},{0..1}] Select affected operands for instructions with 2 source operands.
1895 neg_hi:[{0..1},{0..1},{0..1}] Select affected operands for instructions with 3 source operands.
1896 =============================== ==================================================================
1898 Note: numeric values may be specified as either
1899 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1900 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1912 See a description :ref:`here<amdgpu_synid_clamp>`.
1914 .. _amdgpu_synid_mad_mix:
1916 VOP3P MAD_MIX/FMA_MIX Modifiers
1917 -------------------------------
1919 *v_mad_mix\** and *v_fma_mix\**
1920 instructions use *op_sel* and *op_sel_hi* modifiers
1921 in a manner different from *regular* VOP3P instructions.
1923 See a description below.
1925 .. _amdgpu_synid_mad_mix_op_sel:
1930 This operand has meaning only for 16-bit source operands, as indicated by
1931 :ref:`m_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>`.
1932 It specifies to select either the low [15:0] or high [31:16] operand bits
1933 as input to the operation.
1935 The number of values specified by the *op_sel* modifier must match the number of source
1936 operands. The first value controls src0, the second value controls src1 and so on.
1938 The value 0 indicates the low bits, the value 1 indicates the high 16 bits.
1940 By default, low bits are used for all operands.
1942 =============================== ===================================================
1944 =============================== ===================================================
1945 op_sel:[{0..1},{0..1},{0..1}] Select the location of each 16-bit source operand.
1946 =============================== ===================================================
1948 Note: numeric values may be specified as either
1949 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1950 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1958 .. _amdgpu_synid_mad_mix_op_sel_hi:
1963 Selects the size of source operands: either 32 bits or 16 bits.
1964 By default, 32 bits are used for all source operands.
1966 The number of values specified by the *op_sel_hi* modifier must match the number of source
1967 operands. The first value controls src0, the second value controls src1 and so on.
1969 The value 0 indicates 32 bits, the value 1 indicates 16 bits.
1971 The location of 16 bits in the operand may be specified by
1972 :ref:`m_op_sel<amdgpu_synid_mad_mix_op_sel>`.
1974 ======================================== ========================================
1976 ======================================== ========================================
1977 op_sel_hi:[{0..1},{0..1},{0..1}] Select the size of each source operand.
1978 ======================================== ========================================
1980 Note: numeric values may be specified as either
1981 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1982 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1993 See a description :ref:`here<amdgpu_synid_abs>`.
1998 See a description :ref:`here<amdgpu_synid_neg>`.
2003 See a description :ref:`here<amdgpu_synid_clamp>`.
2005 VOP3P MFMA Modifiers
2006 --------------------
2008 .. _amdgpu_synid_cbsz:
2013 Specifies a broadcast mode.
2015 =============================== ==================================================================
2017 =============================== ==================================================================
2018 cbsz:[{0..7}] A broadcast mode.
2019 =============================== ==================================================================
2021 Note: numeric value may be specified as either
2022 an :ref:`integer number<amdgpu_synid_integer_number>` or
2023 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
2025 .. _amdgpu_synid_abid:
2030 Specifies matrix A group select.
2032 =============================== ==================================================================
2034 =============================== ==================================================================
2035 abid:[{0..15}] Matrix A group select id.
2036 =============================== ==================================================================
2038 Note: numeric value may be specified as either
2039 an :ref:`integer number<amdgpu_synid_integer_number>` or
2040 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
2042 .. _amdgpu_synid_blgp:
2047 Specifies matrix B lane group pattern.
2049 =============================== ==================================================================
2051 =============================== ==================================================================
2052 blgp:[{0..7}] Matrix B lane group pattern.
2053 =============================== ==================================================================
2055 Note: numeric value may be specified as either
2056 an :ref:`integer number<amdgpu_synid_integer_number>` or
2057 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
2059 .. _amdgpu_synid_mfma_neg:
2064 Indicates operands that must be negated before the operation.
2065 The number of values specified by this modifier must match the number of source
2066 operands. The first value controls src0, the second value controls src1 and so on.
2068 The value 0 indicates that the corresponding operand value is used unmodified,
2069 the value 1 indicates that the operand value must be negated before the operation.
2071 By default, operand values are used unmodified.
2073 =============================== ==================================================================
2075 =============================== ==================================================================
2076 neg:[{0..1},{0..1},{0..1}] Select operands which must be negated before the operation.
2077 =============================== ==================================================================
2079 Note: numeric values may be specified as either
2080 :ref:`integer numbers<amdgpu_synid_integer_number>` or
2081 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.