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* is explained elsewhere.
18 =================== =============================================================
20 .. _amdgpu_syn_modifiers:
28 .. _amdgpu_synid_ds_offset80:
33 Specifies 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 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 which 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 See AMD documentation for more information.
113 ======================================================= ===========================================================
115 ======================================================= ===========================================================
116 offset:{0..0xFFFF} Specifies a 16-bit swizzle pattern.
117 offset:swizzle(QUAD_PERM,{0..3},{0..3},{0..3},{0..3}) Specifies a quad permute mode pattern
119 Each number is a lane *id*.
120 offset:swizzle(BITMASK_PERM, "<mask>") Specifies a bitmask permute mode pattern.
122 The pattern converts a 5-bit lane *id* to another
123 lane *id* with which the lane interacts.
125 *mask* is a 5 character sequence which
126 specifies how to transform the bits of the
129 The following characters are allowed:
131 * "0" - set bit to 0.
133 * "1" - set bit to 1.
135 * "p" - preserve bit.
139 offset:swizzle(BROADCAST,{2..32},{0..N}) Specifies a broadcast mode.
141 Broadcasts the value of any particular lane to
142 all lanes in its group.
144 The first numeric parameter is a group
145 size and must be equal to 2, 4, 8, 16 or 32.
147 The second numeric parameter is an index of the
148 lane being broadcasted.
150 The index must not exceed group size.
151 offset:swizzle(SWAP,{1..16}) Specifies a swap mode.
153 Swaps the neighboring groups of
154 1, 2, 4, 8 or 16 lanes.
155 offset:swizzle(REVERSE,{2..32}) Specifies a reverse mode.
157 Reverses the lanes for groups of 2, 4, 8, 16 or 32 lanes.
158 ======================================================= ===========================================================
160 Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
161 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
169 offset:swizzle(QUAD_PERM, 0, 1, 2, 3)
170 offset:swizzle(BITMASK_PERM, "01pi0")
171 offset:swizzle(BROADCAST, 2, 0)
172 offset:swizzle(SWAP, 8)
173 offset:swizzle(REVERSE, 30 + 2)
175 .. _amdgpu_synid_gds:
180 Specifies whether to use GDS or LDS memory (LDS is the default).
182 ======================================== ================================================
184 ======================================== ================================================
186 ======================================== ================================================
192 .. _amdgpu_synid_done:
197 Specifies if this is the last export from the shader to the target. By default,
198 *exp* instruction does not finish an export sequence.
200 ======================================== ================================================
202 ======================================== ================================================
203 done Indicates the last export operation.
204 ======================================== ================================================
206 .. _amdgpu_synid_compr:
211 Indicates if the data are compressed (data are not compressed by default).
213 ======================================== ================================================
215 ======================================== ================================================
216 compr Data are compressed.
217 ======================================== ================================================
224 Specifies valid mask flag state (off by default).
226 ======================================== ================================================
228 ======================================== ================================================
229 vm Set valid mask flag.
230 ======================================== ================================================
235 .. _amdgpu_synid_flat_offset12:
240 Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
242 Cannot be used with *global/scratch* opcodes. GFX9 only.
244 ================= ====================================================================
246 ================= ====================================================================
247 offset:{0..4095} Specifies a 12-bit unsigned offset as a positive
248 :ref:`integer number <amdgpu_synid_integer_number>`
249 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
250 ================= ====================================================================
259 .. _amdgpu_synid_flat_offset13s:
264 Specifies an immediate signed 13-bit offset, in bytes. The default value is 0.
266 Can be used with *global/scratch* opcodes only. GFX9 only.
268 ===================== ====================================================================
270 ===================== ====================================================================
271 offset:{-4096..4095} Specifies a 13-bit signed offset as an
272 :ref:`integer number <amdgpu_synid_integer_number>`
273 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
274 ===================== ====================================================================
284 .. _amdgpu_synid_flat_offset12s:
289 Specifies an immediate signed 12-bit offset, in bytes. The default value is 0.
291 Can be used with *global/scratch* opcodes only.
295 ===================== ====================================================================
297 ===================== ====================================================================
298 offset:{-2048..2047} Specifies a 12-bit signed offset as an
299 :ref:`integer number <amdgpu_synid_integer_number>`
300 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
301 ===================== ====================================================================
311 .. _amdgpu_synid_flat_offset11:
316 Specifies an immediate unsigned 11-bit offset, in bytes. The default value is 0.
318 Cannot be used with *global/scratch* opcodes.
322 ================= ====================================================================
324 ================= ====================================================================
325 offset:{0..2047} Specifies an 11-bit unsigned offset as a positive
326 :ref:`integer number <amdgpu_synid_integer_number>`
327 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
328 ================= ====================================================================
340 See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
345 See a description :ref:`here<amdgpu_synid_glc>`.
350 See a description :ref:`here<amdgpu_synid_lds>`. GFX10 only.
355 See a description :ref:`here<amdgpu_synid_slc>`.
360 See a description :ref:`here<amdgpu_synid_tfe>`.
365 See a description :ref:`here<amdgpu_synid_nv>`.
370 See a description :ref:`here<amdgpu_synid_sc0>`.
375 See a description :ref:`here<amdgpu_synid_sc1>`.
380 See a description :ref:`here<amdgpu_synid_nt>`.
385 .. _amdgpu_synid_dmask:
390 Specifies which channels (image components) are used by the operation. By default, no channels
393 =============== ====================================================================
395 =============== ====================================================================
396 dmask:{0..15} Specifies image channels as a positive
397 :ref:`integer number <amdgpu_synid_integer_number>`
398 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
400 Each bit corresponds to one of 4 image components (RGBA).
402 If the specified bit value is 0, the component is not used,
403 value 1 means that the component is used.
404 =============== ====================================================================
406 This modifier has some limitations depending on instruction kind:
408 =================================================== ========================
409 Instruction Kind Valid dmask Values
410 =================================================== ========================
411 32-bit atomic *cmpswap* 0x3
412 32-bit atomic instructions except for *cmpswap* 0x1
413 64-bit atomic *cmpswap* 0xF
414 64-bit atomic instructions except for *cmpswap* 0x3
415 *gather4* 0x1, 0x2, 0x4, 0x8
416 Other instructions any value
417 =================================================== ========================
427 .. _amdgpu_synid_unorm:
432 Specifies whether the address is normalized or not (the address is normalized by default).
434 ======================== ========================================
436 ======================== ========================================
437 unorm Force the address to be unnormalized.
438 ======================== ========================================
443 See a description :ref:`here<amdgpu_synid_glc>`.
448 See a description :ref:`here<amdgpu_synid_slc>`.
450 .. _amdgpu_synid_r128:
455 Specifies texture resource size. The default size is 256 bits.
457 GFX7, GFX8 and GFX10 only.
459 =================== ================================================
461 =================== ================================================
462 r128 Specifies 128 bits texture resource size.
463 =================== ================================================
465 .. WARNING:: Using this modifier should decrease *rsrc* operand size from 8 to 4 dwords, but assembler does not currently support this feature.
470 See a description :ref:`here<amdgpu_synid_tfe>`.
472 .. _amdgpu_synid_lwe:
477 Specifies LOD warning status (LOD warning is disabled by default).
479 ======================================== ================================================
481 ======================================== ================================================
482 lwe Enables LOD warning.
483 ======================================== ================================================
490 Specifies if an array index must be sent to TA. By default, array index is not sent.
492 ======================================== ================================================
494 ======================================== ================================================
495 da Send an array-index to TA.
496 ======================================== ================================================
498 .. _amdgpu_synid_d16:
503 Specifies data size: 16 or 32 bits (32 bits by default). Not supported by GFX7.
505 ======================================== ================================================
507 ======================================== ================================================
508 d16 Enables 16-bits data mode.
510 On loads, convert data in memory to 16-bit
511 format before storing it in VGPRs.
513 For stores, convert 16-bit data in VGPRs to
514 32 bits before going to memory.
516 Note that GFX8.0 does not support data packing.
517 Each 16-bit data element occupies 1 VGPR.
519 GFX8.1, GFX9 and GFX10 support data packing.
520 Each pair of 16-bit data elements
522 ======================================== ================================================
524 .. _amdgpu_synid_a16:
529 Specifies size of image address components: 16 or 32 bits (32 bits by default).
532 ======================================== ================================================
534 ======================================== ================================================
535 a16 Enables 16-bits image address components.
536 ======================================== ================================================
538 .. _amdgpu_synid_dim:
543 Specifies surface dimension. This is a mandatory modifier. There is no default value.
547 =============================== =========================================================
549 =============================== =========================================================
550 dim:1D One-dimensional image.
551 dim:2D Two-dimensional image.
552 dim:3D Three-dimensional image.
553 dim:CUBE Cubemap array.
554 dim:1D_ARRAY One-dimensional image array.
555 dim:2D_ARRAY Two-dimensional image array.
556 dim:2D_MSAA Two-dimensional multi-sample auto-aliasing image.
557 dim:2D_MSAA_ARRAY Two-dimensional multi-sample auto-aliasing image array.
558 =============================== =========================================================
560 The following table defines an alternative syntax which is supported
561 for compatibility with SP3 assembler:
563 =============================== =========================================================
565 =============================== =========================================================
566 dim:SQ_RSRC_IMG_1D One-dimensional image.
567 dim:SQ_RSRC_IMG_2D Two-dimensional image.
568 dim:SQ_RSRC_IMG_3D Three-dimensional image.
569 dim:SQ_RSRC_IMG_CUBE Cubemap array.
570 dim:SQ_RSRC_IMG_1D_ARRAY One-dimensional image array.
571 dim:SQ_RSRC_IMG_2D_ARRAY Two-dimensional image array.
572 dim:SQ_RSRC_IMG_2D_MSAA Two-dimensional multi-sample auto-aliasing image.
573 dim:SQ_RSRC_IMG_2D_MSAA_ARRAY Two-dimensional multi-sample auto-aliasing image array.
574 =============================== =========================================================
579 See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
581 Miscellaneous Modifiers
582 -----------------------
584 .. _amdgpu_synid_dlc:
589 Controls device level cache policy for memory operations. Used for synchronization.
590 When specified, forces operation to bypass device level cache making the operation device
591 level coherent. By default, instructions use device level cache.
595 ======================================== ================================================
597 ======================================== ================================================
598 dlc Bypass device level cache.
599 ======================================== ================================================
601 .. _amdgpu_synid_glc:
606 This modifier has different meaning for loads, stores, and atomic operations.
607 The default value is off (0).
609 See AMD documentation for details.
611 ======================================== ================================================
613 ======================================== ================================================
614 glc Set glc bit to 1.
615 ======================================== ================================================
617 .. _amdgpu_synid_lds:
622 Specifies where to store the result: VGPRs or LDS (VGPRs by default).
624 ======================================== ===========================
626 ======================================== ===========================
627 lds Store result in LDS.
628 ======================================== ===========================
635 Specifies if instruction is operating on non-volatile memory. By default, memory is volatile.
639 ======================================== ================================================
641 ======================================== ================================================
642 nv Indicates that instruction operates on
644 ======================================== ================================================
646 .. _amdgpu_synid_slc:
651 Specifies cache policy. The default value is off (0).
653 See AMD documentation for details.
655 ======================================== ================================================
657 ======================================== ================================================
658 slc Set slc bit to 1.
659 ======================================== ================================================
661 .. _amdgpu_synid_tfe:
666 Controls access to partially resident textures. The default value is off (0).
668 See AMD documentation for details.
670 ======================================== ================================================
672 ======================================== ================================================
673 tfe Set tfe bit to 1.
674 ======================================== ================================================
676 .. _amdgpu_synid_sc0:
681 For atomics, sc0 indicates that the atomic operation returns a value.
682 For other opcodes is is used together with :ref:`sc1<amdgpu_synid_sc1>` to specify cache
683 policy. See AMD documentation for details.
685 ======================================== ================================================
687 ======================================== ================================================
688 sc0 Set sc0 bit to 1.
689 ======================================== ================================================
691 .. _amdgpu_synid_sc1:
696 This modifier is used together with :ref:`sc0<amdgpu_synid_sc0>` to specify cache
699 ======================================== ================================================
701 ======================================== ================================================
702 sc1 Set sc1 bit to 1.
703 ======================================== ================================================
710 Indicates an operation with non-temporal data.
712 ======================================== ================================================
714 ======================================== ================================================
716 ======================================== ================================================
718 MUBUF/MTBUF Modifiers
719 ---------------------
721 .. _amdgpu_synid_idxen:
726 Specifies whether address components include an index. By default, no components are used.
728 Can be used together with :ref:`offen<amdgpu_synid_offen>`.
730 Cannot be used with :ref:`addr64<amdgpu_synid_addr64>`.
732 ======================================== ================================================
734 ======================================== ================================================
735 idxen Address components include an index.
736 ======================================== ================================================
738 .. _amdgpu_synid_offen:
743 Specifies whether address components include an offset. By default, no components are used.
745 Can be used together with :ref:`idxen<amdgpu_synid_idxen>`.
747 Cannot be used with :ref:`addr64<amdgpu_synid_addr64>`.
749 ======================================== ================================================
751 ======================================== ================================================
752 offen Address components include an offset.
753 ======================================== ================================================
755 .. _amdgpu_synid_addr64:
760 Specifies whether a 64-bit address is used. By default, no address is used.
762 GFX7 only. Cannot be used with :ref:`offen<amdgpu_synid_offen>` and
763 :ref:`idxen<amdgpu_synid_idxen>` modifiers.
765 ======================================== ================================================
767 ======================================== ================================================
768 addr64 A 64-bit address is used.
769 ======================================== ================================================
771 .. _amdgpu_synid_buf_offset12:
776 Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
778 ================== ====================================================================
780 ================== ====================================================================
781 offset:{0..0xFFF} Specifies a 12-bit unsigned offset as a positive
782 :ref:`integer number <amdgpu_synid_integer_number>`
783 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
784 ================== ====================================================================
796 See a description :ref:`here<amdgpu_synid_glc>`.
801 See a description :ref:`here<amdgpu_synid_slc>`.
806 See a description :ref:`here<amdgpu_synid_lds>`.
811 See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
816 See a description :ref:`here<amdgpu_synid_tfe>`.
818 .. _amdgpu_synid_fmt:
823 Specifies data and numeric formats used by the operation.
824 The default numeric format is BUF_NUM_FORMAT_UNORM.
825 The default data format is BUF_DATA_FORMAT_8.
827 ========================================= ===============================================================
829 ========================================= ===============================================================
830 format:{0..127} Use format specified as either an
831 :ref:`integer number<amdgpu_synid_integer_number>` or an
832 :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
833 format:[<data format>] Use the specified data format and
834 default numeric format.
835 format:[<numeric format>] Use the specified numeric format and
837 format:[<data format>, <numeric format>] Use the specified data and numeric formats.
838 format:[<numeric format>, <data format>] Use the specified data and numeric formats.
839 ========================================= ===============================================================
841 .. _amdgpu_synid_format_data:
843 Supported data formats are defined in the following table:
845 ========================================= ===============================
847 ========================================= ===============================
848 BUF_DATA_FORMAT_INVALID
849 BUF_DATA_FORMAT_8 Default value.
853 BUF_DATA_FORMAT_16_16
854 BUF_DATA_FORMAT_10_11_11
855 BUF_DATA_FORMAT_11_11_10
856 BUF_DATA_FORMAT_10_10_10_2
857 BUF_DATA_FORMAT_2_10_10_10
858 BUF_DATA_FORMAT_8_8_8_8
859 BUF_DATA_FORMAT_32_32
860 BUF_DATA_FORMAT_16_16_16_16
861 BUF_DATA_FORMAT_32_32_32
862 BUF_DATA_FORMAT_32_32_32_32
863 BUF_DATA_FORMAT_RESERVED_15
864 ========================================= ===============================
866 .. _amdgpu_synid_format_num:
868 Supported numeric formats are defined below:
870 ========================================= ===============================
872 ========================================= ===============================
873 BUF_NUM_FORMAT_UNORM Default value.
875 BUF_NUM_FORMAT_USCALED
876 BUF_NUM_FORMAT_SSCALED
879 BUF_NUM_FORMAT_SNORM_OGL GFX7 only.
880 BUF_NUM_FORMAT_RESERVED_6 GFX8 and GFX9 only.
882 ========================================= ===============================
890 format:[BUF_DATA_FORMAT_16]
891 format:[BUF_DATA_FORMAT_16,BUF_NUM_FORMAT_SSCALED]
892 format:[BUF_NUM_FORMAT_FLOAT]
894 .. _amdgpu_synid_ufmt:
899 Specifies a unified format used by the operation.
900 The default format is BUF_FMT_8_UNORM.
903 ========================================= ===============================================================
905 ========================================= ===============================================================
906 format:{0..127} Use unified format specified as either an
907 :ref:`integer number<amdgpu_synid_integer_number>` or an
908 :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
909 Note that unified format numbers are not compatible with
910 format numbers used for pre-GFX10 ISA.
911 format:[<unified format>] Use the specified unified format.
912 ========================================= ===============================================================
914 Unified format is a replacement for :ref:`data<amdgpu_synid_format_data>`
915 and :ref:`numeric<amdgpu_synid_format_num>` formats. For compatibility with older ISA,
916 :ref:`syntax with data and numeric formats<amdgpu_synid_fmt>` is still accepted
917 provided that the combination of formats can be mapped to a unified format.
919 Supported unified formats and equivalent combinations of data and numeric formats
922 ============================== ============================== =============================
923 Syntax Equivalent Data Format Equivalent Numeric Format
924 ============================== ============================== =============================
925 BUF_FMT_INVALID BUF_DATA_FORMAT_INVALID BUF_NUM_FORMAT_UNORM
927 BUF_FMT_8_UNORM BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_UNORM
928 BUF_FMT_8_SNORM BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_SNORM
929 BUF_FMT_8_USCALED BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_USCALED
930 BUF_FMT_8_SSCALED BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_SSCALED
931 BUF_FMT_8_UINT BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_UINT
932 BUF_FMT_8_SINT BUF_DATA_FORMAT_8 BUF_NUM_FORMAT_SINT
934 BUF_FMT_16_UNORM BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_UNORM
935 BUF_FMT_16_SNORM BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_SNORM
936 BUF_FMT_16_USCALED BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_USCALED
937 BUF_FMT_16_SSCALED BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_SSCALED
938 BUF_FMT_16_UINT BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_UINT
939 BUF_FMT_16_SINT BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_SINT
940 BUF_FMT_16_FLOAT BUF_DATA_FORMAT_16 BUF_NUM_FORMAT_FLOAT
942 BUF_FMT_8_8_UNORM BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_UNORM
943 BUF_FMT_8_8_SNORM BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_SNORM
944 BUF_FMT_8_8_USCALED BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_USCALED
945 BUF_FMT_8_8_SSCALED BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_SSCALED
946 BUF_FMT_8_8_UINT BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_UINT
947 BUF_FMT_8_8_SINT BUF_DATA_FORMAT_8_8 BUF_NUM_FORMAT_SINT
949 BUF_FMT_32_UINT BUF_DATA_FORMAT_32 BUF_NUM_FORMAT_UINT
950 BUF_FMT_32_SINT BUF_DATA_FORMAT_32 BUF_NUM_FORMAT_SINT
951 BUF_FMT_32_FLOAT BUF_DATA_FORMAT_32 BUF_NUM_FORMAT_FLOAT
953 BUF_FMT_16_16_UNORM BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_UNORM
954 BUF_FMT_16_16_SNORM BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_SNORM
955 BUF_FMT_16_16_USCALED BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_USCALED
956 BUF_FMT_16_16_SSCALED BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_SSCALED
957 BUF_FMT_16_16_UINT BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_UINT
958 BUF_FMT_16_16_SINT BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_SINT
959 BUF_FMT_16_16_FLOAT BUF_DATA_FORMAT_16_16 BUF_NUM_FORMAT_FLOAT
961 BUF_FMT_10_11_11_UNORM BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_UNORM
962 BUF_FMT_10_11_11_SNORM BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_SNORM
963 BUF_FMT_10_11_11_USCALED BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_USCALED
964 BUF_FMT_10_11_11_SSCALED BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_SSCALED
965 BUF_FMT_10_11_11_UINT BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_UINT
966 BUF_FMT_10_11_11_SINT BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_SINT
967 BUF_FMT_10_11_11_FLOAT BUF_DATA_FORMAT_10_11_11 BUF_NUM_FORMAT_FLOAT
969 BUF_FMT_11_11_10_UNORM BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_UNORM
970 BUF_FMT_11_11_10_SNORM BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_SNORM
971 BUF_FMT_11_11_10_USCALED BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_USCALED
972 BUF_FMT_11_11_10_SSCALED BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_SSCALED
973 BUF_FMT_11_11_10_UINT BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_UINT
974 BUF_FMT_11_11_10_SINT BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_SINT
975 BUF_FMT_11_11_10_FLOAT BUF_DATA_FORMAT_11_11_10 BUF_NUM_FORMAT_FLOAT
977 BUF_FMT_10_10_10_2_UNORM BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_UNORM
978 BUF_FMT_10_10_10_2_SNORM BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_SNORM
979 BUF_FMT_10_10_10_2_USCALED BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_USCALED
980 BUF_FMT_10_10_10_2_SSCALED BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_SSCALED
981 BUF_FMT_10_10_10_2_UINT BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_UINT
982 BUF_FMT_10_10_10_2_SINT BUF_DATA_FORMAT_10_10_10_2 BUF_NUM_FORMAT_SINT
984 BUF_FMT_2_10_10_10_UNORM BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_UNORM
985 BUF_FMT_2_10_10_10_SNORM BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_SNORM
986 BUF_FMT_2_10_10_10_USCALED BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_USCALED
987 BUF_FMT_2_10_10_10_SSCALED BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_SSCALED
988 BUF_FMT_2_10_10_10_UINT BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_UINT
989 BUF_FMT_2_10_10_10_SINT BUF_DATA_FORMAT_2_10_10_10 BUF_NUM_FORMAT_SINT
991 BUF_FMT_8_8_8_8_UNORM BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_UNORM
992 BUF_FMT_8_8_8_8_SNORM BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_SNORM
993 BUF_FMT_8_8_8_8_USCALED BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_USCALED
994 BUF_FMT_8_8_8_8_SSCALED BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_SSCALED
995 BUF_FMT_8_8_8_8_UINT BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_UINT
996 BUF_FMT_8_8_8_8_SINT BUF_DATA_FORMAT_8_8_8_8 BUF_NUM_FORMAT_SINT
998 BUF_FMT_32_32_UINT BUF_DATA_FORMAT_32_32 BUF_NUM_FORMAT_UINT
999 BUF_FMT_32_32_SINT BUF_DATA_FORMAT_32_32 BUF_NUM_FORMAT_SINT
1000 BUF_FMT_32_32_FLOAT BUF_DATA_FORMAT_32_32 BUF_NUM_FORMAT_FLOAT
1002 BUF_FMT_16_16_16_16_UNORM BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_UNORM
1003 BUF_FMT_16_16_16_16_SNORM BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_SNORM
1004 BUF_FMT_16_16_16_16_USCALED BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_USCALED
1005 BUF_FMT_16_16_16_16_SSCALED BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_SSCALED
1006 BUF_FMT_16_16_16_16_UINT BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_UINT
1007 BUF_FMT_16_16_16_16_SINT BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_SINT
1008 BUF_FMT_16_16_16_16_FLOAT BUF_DATA_FORMAT_16_16_16_16 BUF_NUM_FORMAT_FLOAT
1010 BUF_FMT_32_32_32_UINT BUF_DATA_FORMAT_32_32_32 BUF_NUM_FORMAT_UINT
1011 BUF_FMT_32_32_32_SINT BUF_DATA_FORMAT_32_32_32 BUF_NUM_FORMAT_SINT
1012 BUF_FMT_32_32_32_FLOAT BUF_DATA_FORMAT_32_32_32 BUF_NUM_FORMAT_FLOAT
1013 BUF_FMT_32_32_32_32_UINT BUF_DATA_FORMAT_32_32_32_32 BUF_NUM_FORMAT_UINT
1014 BUF_FMT_32_32_32_32_SINT BUF_DATA_FORMAT_32_32_32_32 BUF_NUM_FORMAT_SINT
1015 BUF_FMT_32_32_32_32_FLOAT BUF_DATA_FORMAT_32_32_32_32 BUF_NUM_FORMAT_FLOAT
1016 ============================== ============================== =============================
1023 format:[BUF_FMT_32_UINT]
1031 See a description :ref:`here<amdgpu_synid_glc>`.
1036 See a description :ref:`here<amdgpu_synid_nv>`. GFX9 only.
1041 See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
1043 .. _amdgpu_synid_smem_offset20u:
1048 Specifies an unsigned 20-bit offset, in bytes. The default value is 0.
1050 ==================== ====================================================================
1052 ==================== ====================================================================
1053 offset:{0..0xFFFFF} Specifies an offset as a positive
1054 :ref:`integer number <amdgpu_synid_integer_number>`
1055 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1056 ==================== ====================================================================
1066 .. _amdgpu_synid_smem_offset21s:
1071 Specifies a signed 21-bit offset, in bytes. The default value is 0.
1073 ============================= ====================================================================
1075 ============================= ====================================================================
1076 offset:{-0x100000..0xFFFFF} Specifies an offset as an
1077 :ref:`integer number <amdgpu_synid_integer_number>`
1078 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1079 ============================= ====================================================================
1092 .. _amdgpu_synid_high:
1097 Specifies which half of the LDS word to use. Low half of LDS word is used by default.
1098 GFX9 and GFX10 only.
1100 ======================================== ================================
1102 ======================================== ================================
1103 high Use high half of LDS word.
1104 ======================================== ================================
1111 .. _amdgpu_synid_dpp8_sel:
1116 Selects which lanes to pull data from, within a group of 8 lanes. This is a mandatory modifier.
1117 There is no default value.
1121 The *dpp8_sel* modifier must specify exactly 8 values.
1122 First value selects which lane to read from to supply data into lane 0.
1123 Second value controls lane 1 and so on.
1125 Each value may be specified as either
1126 an :ref:`integer number<amdgpu_synid_integer_number>` or
1127 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1129 =============================================================== ===========================
1131 =============================================================== ===========================
1132 dpp8:[{0..7},{0..7},{0..7},{0..7},{0..7},{0..7},{0..7},{0..7}] Select lanes to read from.
1133 =============================================================== ===========================
1139 dpp8:[7,6,5,4,3,2,1,0]
1140 dpp8:[0,1,0,1,0,1,0,1]
1142 .. _amdgpu_synid_fi8:
1147 Controls interaction with inactive lanes for *dpp8* instructions. The default value is zero.
1149 Note: *inactive* lanes are those whose :ref:`exec<amdgpu_synid_exec>` mask bit is zero.
1153 ==================================== =====================================================
1155 ==================================== =====================================================
1156 fi:0 Fetch zero when accessing data from inactive lanes.
1157 fi:1 Fetch pre-exist values from inactive lanes.
1158 ==================================== =====================================================
1160 Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
1161 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1166 GFX8, GFX9 and GFX10 only.
1168 .. _amdgpu_synid_dpp_ctrl:
1173 Specifies how data are shared between threads. This is a mandatory modifier.
1174 There is no default value.
1176 GFX8 and GFX9 only. Use :ref:`dpp16_ctrl<amdgpu_synid_dpp16_ctrl>` for GFX10.
1178 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1180 ======================================== ================================================
1182 ======================================== ================================================
1183 quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
1184 row_mirror Mirror threads within row.
1185 row_half_mirror Mirror threads within 1/2 row (8 threads).
1186 row_bcast:15 Broadcast 15th thread of each row to next row.
1187 row_bcast:31 Broadcast thread 31 to rows 2 and 3.
1188 wave_shl:1 Wavefront left shift by 1 thread.
1189 wave_rol:1 Wavefront left rotate by 1 thread.
1190 wave_shr:1 Wavefront right shift by 1 thread.
1191 wave_ror:1 Wavefront right rotate by 1 thread.
1192 row_shl:{1..15} Row shift left by 1-15 threads.
1193 row_shr:{1..15} Row shift right by 1-15 threads.
1194 row_ror:{1..15} Row rotate right by 1-15 threads.
1195 ======================================== ================================================
1197 Note: numeric values may be specified as either
1198 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1199 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1205 quad_perm:[0, 1, 2, 3]
1208 .. _amdgpu_synid_dpp16_ctrl:
1213 Specifies how data are shared between threads. This is a mandatory modifier.
1214 There is no default value.
1216 GFX10 only. Use :ref:`dpp_ctrl<amdgpu_synid_dpp_ctrl>` for GFX8 and GFX9.
1218 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1219 (There are only two rows in *wave32* mode.)
1221 ======================================== ====================================================
1223 ======================================== ====================================================
1224 quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
1225 row_mirror Mirror threads within row.
1226 row_half_mirror Mirror threads within 1/2 row (8 threads).
1227 row_share:{0..15} Share the value from the specified lane with other
1229 row_xmask:{0..15} Fetch from XOR(current lane id, specified lane id).
1230 row_shl:{1..15} Row shift left by 1-15 threads.
1231 row_shr:{1..15} Row shift right by 1-15 threads.
1232 row_ror:{1..15} Row rotate right by 1-15 threads.
1233 ======================================== ====================================================
1235 Note: numeric values may be specified as either
1236 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1237 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1243 quad_perm:[0, 1, 2, 3]
1246 .. _amdgpu_synid_dpp32_ctrl:
1251 Specifies how data are shared between threads. This is a mandatory modifier.
1252 There is no default value.
1254 May be used only with GFX90A 32-bit instructions.
1256 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1258 ======================================== ==================================================
1260 ======================================== ==================================================
1261 quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
1262 row_mirror Mirror threads within row.
1263 row_half_mirror Mirror threads within 1/2 row (8 threads).
1264 row_bcast:15 Broadcast 15th thread of each row to next row.
1265 row_bcast:31 Broadcast thread 31 to rows 2 and 3.
1266 wave_shl:1 Wavefront left shift by 1 thread.
1267 wave_rol:1 Wavefront left rotate by 1 thread.
1268 wave_shr:1 Wavefront right shift by 1 thread.
1269 wave_ror:1 Wavefront right rotate by 1 thread.
1270 row_shl:{1..15} Row shift left by 1-15 threads.
1271 row_shr:{1..15} Row shift right by 1-15 threads.
1272 row_ror:{1..15} Row rotate right by 1-15 threads.
1273 row_newbcast:{1..15} Broadcast a thread within a row to the whole row.
1274 ======================================== ==================================================
1276 Note: numeric values may be specified as either
1277 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1278 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1284 quad_perm:[0, 1, 2, 3]
1288 .. _amdgpu_synid_dpp64_ctrl:
1293 Specifies how data are shared between threads. This is a mandatory modifier.
1294 There is no default value.
1296 May be used only with GFX90A 64-bit instructions.
1298 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1300 ======================================== ==================================================
1302 ======================================== ==================================================
1303 row_newbcast:{1..15} Broadcast a thread within a row to the whole row.
1304 ======================================== ==================================================
1306 Note: numeric values may be specified as either
1307 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1308 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1317 .. _amdgpu_synid_row_mask:
1322 Controls which rows are enabled for data sharing. By default, all rows are enabled.
1324 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1325 (There are only two rows in *wave32* mode.)
1327 ================= ====================================================================
1329 ================= ====================================================================
1330 row_mask:{0..15} Specifies a *row mask* as a positive
1331 :ref:`integer number <amdgpu_synid_integer_number>`
1332 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1334 Each of 4 bits in the mask controls one row
1335 (0 - disabled, 1 - enabled).
1337 In *wave32* mode the values should be limited to 0..7.
1338 ================= ====================================================================
1348 .. _amdgpu_synid_bank_mask:
1353 Controls which banks are enabled for data sharing. By default, all banks are enabled.
1355 Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
1356 (There are only two rows in *wave32* mode.)
1358 ================== ====================================================================
1360 ================== ====================================================================
1361 bank_mask:{0..15} Specifies a *bank mask* as a positive
1362 :ref:`integer number <amdgpu_synid_integer_number>`
1363 or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
1365 Each of 4 bits in the mask controls one bank
1366 (0 - disabled, 1 - enabled).
1367 ================== ====================================================================
1377 .. _amdgpu_synid_bound_ctrl:
1382 Controls data sharing when accessing an invalid lane. By default, data sharing with
1383 invalid lanes is disabled.
1385 ======================================== ================================================
1387 ======================================== ================================================
1388 bound_ctrl:1 Enables data sharing with invalid lanes.
1390 Accessing data from an invalid lane will
1392 ======================================== ================================================
1394 .. _amdgpu_synid_fi16:
1399 Controls interaction with *inactive* lanes for *dpp16* instructions. The default value is zero.
1401 Note: *inactive* lanes are those whose :ref:`exec<amdgpu_synid_exec>` mask bit is zero.
1405 ======================================== ==================================================
1407 ======================================== ==================================================
1408 fi:0 Interaction with inactive lanes is controlled by
1409 :ref:`bound_ctrl<amdgpu_synid_bound_ctrl>`.
1411 fi:1 Fetch pre-exist values from inactive lanes.
1412 ======================================== ==================================================
1414 Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
1415 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1420 GFX8, GFX9 and GFX10 only.
1425 See a description :ref:`here<amdgpu_synid_clamp>`.
1430 See a description :ref:`here<amdgpu_synid_omod>`.
1432 GFX9 and GFX10 only.
1434 .. _amdgpu_synid_dst_sel:
1439 Selects which bits in the destination are affected. By default, all bits are affected.
1441 ======================================== ================================================
1443 ======================================== ================================================
1444 dst_sel:DWORD Use bits 31:0.
1445 dst_sel:BYTE_0 Use bits 7:0.
1446 dst_sel:BYTE_1 Use bits 15:8.
1447 dst_sel:BYTE_2 Use bits 23:16.
1448 dst_sel:BYTE_3 Use bits 31:24.
1449 dst_sel:WORD_0 Use bits 15:0.
1450 dst_sel:WORD_1 Use bits 31:16.
1451 ======================================== ================================================
1453 .. _amdgpu_synid_dst_unused:
1458 Controls what to do with the bits in the destination which are not selected
1459 by :ref:`dst_sel<amdgpu_synid_dst_sel>`.
1460 By default, unused bits are preserved.
1462 ======================================== ================================================
1464 ======================================== ================================================
1465 dst_unused:UNUSED_PAD Pad with zeros.
1466 dst_unused:UNUSED_SEXT Sign-extend upper bits, zero lower bits.
1467 dst_unused:UNUSED_PRESERVE Preserve bits.
1468 ======================================== ================================================
1470 .. _amdgpu_synid_src0_sel:
1475 Controls which bits in the src0 are used. By default, all bits are used.
1477 ======================================== ================================================
1479 ======================================== ================================================
1480 src0_sel:DWORD Use bits 31:0.
1481 src0_sel:BYTE_0 Use bits 7:0.
1482 src0_sel:BYTE_1 Use bits 15:8.
1483 src0_sel:BYTE_2 Use bits 23:16.
1484 src0_sel:BYTE_3 Use bits 31:24.
1485 src0_sel:WORD_0 Use bits 15:0.
1486 src0_sel:WORD_1 Use bits 31:16.
1487 ======================================== ================================================
1489 .. _amdgpu_synid_src1_sel:
1494 Controls which bits in the src1 are used. By default, all bits are used.
1496 ======================================== ================================================
1498 ======================================== ================================================
1499 src1_sel:DWORD Use bits 31:0.
1500 src1_sel:BYTE_0 Use bits 7:0.
1501 src1_sel:BYTE_1 Use bits 15:8.
1502 src1_sel:BYTE_2 Use bits 23:16.
1503 src1_sel:BYTE_3 Use bits 31:24.
1504 src1_sel:WORD_0 Use bits 15:0.
1505 src1_sel:WORD_1 Use bits 31:16.
1506 ======================================== ================================================
1508 .. _amdgpu_synid_sdwa_operand_modifiers:
1510 SDWA Operand Modifiers
1511 ----------------------
1513 Operand modifiers are not used separately. They are applied to source operands.
1515 GFX8, GFX9 and GFX10 only.
1520 See a description :ref:`here<amdgpu_synid_abs>`.
1525 See a description :ref:`here<amdgpu_synid_neg>`.
1527 .. _amdgpu_synid_sext:
1532 Sign-extends value of a (sub-dword) operand to fill all 32 bits.
1533 Has no effect for 32-bit operands.
1535 Valid for integer operands only.
1537 ======================================== ================================================
1539 ======================================== ================================================
1540 sext(<operand>) Sign-extend operand value.
1541 ======================================== ================================================
1553 .. _amdgpu_synid_vop3_op_sel:
1558 Selects the low [15:0] or high [31:16] operand bits for source and destination operands.
1559 By default, low bits are used for all operands.
1561 The number of values specified with the op_sel modifier must match the number of instruction
1562 operands (both source and destination). First value controls src0, second value controls src1
1563 and so on, except that the last value controls destination.
1564 The value 0 selects the low bits, while 1 selects the high bits.
1566 Note: op_sel modifier affects 16-bit operands only. For 32-bit operands the value specified
1567 by op_sel must be 0.
1569 GFX9 and GFX10 only.
1571 ======================================== ============================================================
1573 ======================================== ============================================================
1574 op_sel:[{0..1},{0..1}] Select operand bits for instructions with 1 source operand.
1575 op_sel:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
1576 op_sel:[{0..1},{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
1577 ======================================== ============================================================
1579 Note: numeric values may be specified as either
1580 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1581 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1590 .. _amdgpu_synid_dpp_op_sel:
1595 Special version of *op_sel* used for *permlane* opcodes to specify
1596 dpp-like mode bits - :ref:`fi<amdgpu_synid_fi16>` and
1597 :ref:`bound_ctrl<amdgpu_synid_bound_ctrl>`.
1601 ======================================== ============================================================
1603 ======================================== ============================================================
1604 op_sel:[{0..1},{0..1}] First bit specifies :ref:`fi<amdgpu_synid_fi16>`, second
1605 bit specifies :ref:`bound_ctrl<amdgpu_synid_bound_ctrl>`.
1606 ======================================== ============================================================
1608 Note: numeric values may be specified as either
1609 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1610 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1618 .. _amdgpu_synid_clamp:
1623 Clamp meaning depends on instruction.
1625 For *v_cmp* instructions, clamp modifier indicates that the compare signals
1626 if a floating point exception occurs. By default, signaling is disabled.
1627 Not supported by GFX7.
1629 For integer operations, clamp modifier indicates that the result must be clamped
1630 to the largest and smallest representable value. By default, there is no clamping.
1631 Integer clamping is not supported by GFX7.
1633 For floating point operations, clamp modifier indicates that the result must be clamped
1634 to the range [0.0, 1.0]. By default, there is no clamping.
1636 Note: clamp modifier is applied after :ref:`output modifiers<amdgpu_synid_omod>` (if any).
1638 ======================================== ================================================
1640 ======================================== ================================================
1641 clamp Enables clamping (or signaling).
1642 ======================================== ================================================
1644 .. _amdgpu_synid_omod:
1649 Specifies if an output modifier must be applied to the result.
1650 By default, no output modifiers are applied.
1652 Note: output modifiers are applied before :ref:`clamping<amdgpu_synid_clamp>` (if any).
1654 Output modifiers are valid for f32 and f64 floating point results only.
1655 They must not be used with f16.
1657 Note: *v_cvt_f16_f32* is an exception. This instruction produces f16 result
1658 but accepts output modifiers.
1660 ======================================== ================================================
1662 ======================================== ================================================
1663 mul:2 Multiply the result by 2.
1664 mul:4 Multiply the result by 4.
1665 div:2 Multiply the result by 0.5.
1666 ======================================== ================================================
1668 Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
1669 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1676 mul:x // x must be equal to 2 or 4
1678 .. _amdgpu_synid_vop3_operand_modifiers:
1680 VOP3 Operand Modifiers
1681 ----------------------
1683 Operand modifiers are not used separately. They are applied to source operands.
1685 .. _amdgpu_synid_abs:
1690 Computes the absolute value of its operand. Must be applied before :ref:`neg<amdgpu_synid_neg>`
1691 (if any). Valid for floating point operands only.
1693 ======================================== ====================================================
1695 ======================================== ====================================================
1696 abs(<operand>) Get the absolute value of a floating-point operand.
1697 \|<operand>| The same as above (an SP3 syntax).
1698 ======================================== ====================================================
1700 Note: avoid using SP3 syntax with operands specified as expressions because the trailing '|'
1701 may be misinterpreted. Such operands should be enclosed into additional parentheses as shown
1711 \|(x|y)| // additional parentheses are required
1713 .. _amdgpu_synid_neg:
1718 Computes the negative value of its operand. Must be applied after :ref:`abs<amdgpu_synid_abs>`
1719 (if any). Valid for floating point operands only.
1721 ================== ====================================================
1723 ================== ====================================================
1724 neg(<operand>) Get the negative value of a floating-point operand.
1725 The operand may include an optional
1726 :ref:`abs<amdgpu_synid_abs>` modifier.
1727 -<operand> The same as above (an SP3 syntax).
1728 ================== ====================================================
1730 Note: SP3 syntax is supported with limitations because of a potential ambiguity.
1731 Currently it is allowed in the following cases:
1733 * Before a register.
1734 * Before an :ref:`abs<amdgpu_synid_abs>` modifier.
1735 * Before an SP3 :ref:`abs<amdgpu_synid_abs>` modifier.
1737 In all other cases "-" is handled as a part of an expression that follows the sign.
1743 // Operands with negate modifiers
1751 // Operands without negate modifiers
1758 This section describes modifiers of *regular* VOP3P instructions.
1760 *v_mad_mix\** and *v_fma_mix\**
1761 instructions use these modifiers :ref:`in a special manner<amdgpu_synid_mad_mix>`.
1763 GFX9 and GFX10 only.
1765 .. _amdgpu_synid_op_sel:
1770 Selects the low [15:0] or high [31:16] operand bits as input to the operation
1771 which results in the lower-half of the destination.
1772 By default, low bits are used for all operands.
1774 The number of values specified by the *op_sel* modifier must match the number of source
1775 operands. First value controls src0, second value controls src1 and so on.
1777 The value 0 selects the low bits, while 1 selects the high bits.
1779 ================================= =============================================================
1781 ================================= =============================================================
1782 op_sel:[{0..1}] Select operand bits for instructions with 1 source operand.
1783 op_sel:[{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
1784 op_sel:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
1785 ================================= =============================================================
1787 Note: numeric values may be specified as either
1788 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1789 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1798 .. _amdgpu_synid_op_sel_hi:
1803 Selects the low [15:0] or high [31:16] operand bits as input to the operation
1804 which results in the upper-half of the destination.
1805 By default, high bits are used for all operands.
1807 The number of values specified by the *op_sel_hi* modifier must match the number of source
1808 operands. First value controls src0, second value controls src1 and so on.
1810 The value 0 selects the low bits, while 1 selects the high bits.
1812 =================================== =============================================================
1814 =================================== =============================================================
1815 op_sel_hi:[{0..1}] Select operand bits for instructions with 1 source operand.
1816 op_sel_hi:[{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
1817 op_sel_hi:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
1818 =================================== =============================================================
1820 Note: numeric values may be specified as either
1821 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1822 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1831 .. _amdgpu_synid_neg_lo:
1836 Specifies whether to change sign of operand values selected by
1837 :ref:`op_sel<amdgpu_synid_op_sel>`. These values are then used
1838 as input to the operation which results in the upper-half of the destination.
1840 The number of values specified by this modifier must match the number of source
1841 operands. First value controls src0, second value controls src1 and so on.
1843 The value 0 indicates that the corresponding operand value is used unmodified,
1844 the value 1 indicates that negative value of the operand must be used.
1846 By default, operand values are used unmodified.
1848 This modifier is valid for floating point operands only.
1850 ================================ ==================================================================
1852 ================================ ==================================================================
1853 neg_lo:[{0..1}] Select affected operands for instructions with 1 source operand.
1854 neg_lo:[{0..1},{0..1}] Select affected operands for instructions with 2 source operands.
1855 neg_lo:[{0..1},{0..1},{0..1}] Select affected operands for instructions with 3 source operands.
1856 ================================ ==================================================================
1858 Note: numeric values may be specified as either
1859 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1860 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1869 .. _amdgpu_synid_neg_hi:
1874 Specifies whether to change sign of operand values selected by
1875 :ref:`op_sel_hi<amdgpu_synid_op_sel_hi>`. These values are then used
1876 as input to the operation which results in the upper-half of the destination.
1878 The number of values specified by this modifier must match the number of source
1879 operands. First value controls src0, second value controls src1 and so on.
1881 The value 0 indicates that the corresponding operand value is used unmodified,
1882 the value 1 indicates that negative value of the operand must be used.
1884 By default, operand values are used unmodified.
1886 This modifier is valid for floating point operands only.
1888 =============================== ==================================================================
1890 =============================== ==================================================================
1891 neg_hi:[{0..1}] Select affected operands for instructions with 1 source operand.
1892 neg_hi:[{0..1},{0..1}] Select affected operands for instructions with 2 source operands.
1893 neg_hi:[{0..1},{0..1},{0..1}] Select affected operands for instructions with 3 source operands.
1894 =============================== ==================================================================
1896 Note: numeric values may be specified as either
1897 :ref:`integer numbers<amdgpu_synid_integer_number>` or
1898 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
1910 See a description :ref:`here<amdgpu_synid_clamp>`.
1912 .. _amdgpu_synid_mad_mix:
1914 VOP3P MAD_MIX/FMA_MIX Modifiers
1915 -------------------------------
1917 *v_mad_mix\** and *v_fma_mix\**
1918 instructions use *op_sel* and *op_sel_hi* modifiers
1919 in a manner different from *regular* VOP3P instructions.
1921 See a description below.
1923 GFX9 and GFX10 only.
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. First value controls src0, 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 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. First value controls src0, 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 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 These modifiers may only be used with GFX908 and GFX90A.
2010 .. _amdgpu_synid_cbsz:
2015 Specifies a broadcast mode.
2017 =============================== ==================================================================
2019 =============================== ==================================================================
2020 cbsz:[{0..7}] A broadcast mode.
2021 =============================== ==================================================================
2023 Note: numeric value may be specified as either
2024 an :ref:`integer number<amdgpu_synid_integer_number>` or
2025 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
2027 .. _amdgpu_synid_abid:
2032 Specifies matrix A group select.
2034 =============================== ==================================================================
2036 =============================== ==================================================================
2037 abid:[{0..15}] Matrix A group select id.
2038 =============================== ==================================================================
2040 Note: numeric value may be specified as either
2041 an :ref:`integer number<amdgpu_synid_integer_number>` or
2042 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
2044 .. _amdgpu_synid_blgp:
2049 Specifies matrix B lane group pattern.
2051 =============================== ==================================================================
2053 =============================== ==================================================================
2054 blgp:[{0..7}] Matrix B lane group pattern.
2055 =============================== ==================================================================
2057 Note: numeric value may be specified as either
2058 an :ref:`integer number<amdgpu_synid_integer_number>` or
2059 an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
2061 .. _amdgpu_synid_mfma_neg:
2066 Indicates operands that must be negated before the operation.
2067 The number of values specified by this modifier must match the number of source
2068 operands. First value controls src0, second value controls src1 and so on.
2070 The value 0 indicates that the corresponding operand value is used unmodified,
2071 the value 1 indicates that the operand value must be negated before the operation.
2073 By default, operand values are used unmodified.
2075 This modifier is valid for floating point operands only.
2077 =============================== ==================================================================
2079 =============================== ==================================================================
2080 neg:[{0..1},{0..1},{0..1}] Select operands which must be negated before the operation.
2081 =============================== ==================================================================
2083 Note: numeric values may be specified as either
2084 :ref:`integer numbers<amdgpu_synid_integer_number>` or
2085 :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.