</bitset>
<bitset name="#instruction-cat5" extends="#instruction">
- <override>
- <expr>{S2EN_BINDLESS}</expr>
- <doc>
- The s2en (indirect) or bindless case
- </doc>
- <display>
- {SY}{JP}{NAME}{3D}{A}{O}{P}{S}{S2EN}{UNIFORM}{NONUNIFORM}{BASE} {TYPE}({WRMASK}){DST_HALF}{DST}{SRC1}{SRC2}{SRC3}{A1}
- </display>
- <field name="BASE_HI" low="19" high="20" type="uint"/>
- <field name="SRC3" low="21" high="28" type="#cat5-src3">
- <param name="BINDLESS"/>
- <param name="DESC_MODE"/>
- <param name="HAS_SAMP"/>
- <param name="HAS_TEX"/>
- </field>
- <field name="DESC_MODE" low="29" high="31" type="#cat5-s2en-bindless-desc-mode"/>
- <field name="BASE" pos="47" type="#cat5-s2en-bindless-base">
- <param name="BINDLESS"/>
- <param name="BASE_HI"/>
- </field>
- <derived name="BINDLESS" expr="#cat5-s2enb-is-bindless" type="bool"/>
- <derived name="S2EN" expr="#cat5-s2enb-is-indirect" type="bool" display=".s2en"/>
- <derived name="UNIFORM" expr="#cat5-s2enb-is-uniform" type="bool" display=".uniform"/>
- <derived name="NONUNIFORM" expr="#cat5-s2enb-is-nonuniform" type="bool" display=".nonuniform"/>
- <derived name="A1" expr="#cat5-s2enb-uses_a1" type="bool" display=", a1.x"/>
- </override>
-
<doc>
The "normal" case, ie. not s2en (indirect) and/or bindless
</doc>
to figure out what this bit does
-->
<pattern low="17" high="18">0x</pattern>
- <assert low="19" high="20">00</assert> <!-- BASE_HI -->
+
<field name="SAMP" low="21" high="24" type="#cat5-samp">
<param name="HAS_SAMP"/>
</field>
<field name="S" pos="50" type="bool" display=".s"/>
<field name="S2EN_BINDLESS" pos="51" type="bool"/>
<field name="O" pos="52" type="bool" display=".o"/>
- <field name="P" pos="53" type="bool" display=".p"/>
<!-- OPC -->
<field name="JP" pos="59" type="bool" display="(jp)"/>
<field name="SY" pos="60" type="bool" display="(sy)"/>
<map name="S">!!(src->flags & IR3_INSTR_S)</map>
<map name="S2EN_BINDLESS">!!(src->flags & (IR3_INSTR_S2EN | IR3_INSTR_B))</map>
<map name="O">!!(src->flags & IR3_INSTR_O)</map>
- <map name="P">!!(src->flags & IR3_INSTR_P)</map>
<map name="DESC_MODE">extract_cat5_DESC_MODE(src)</map>
<!--
TODO the src order is currently a bit messy due to ir3 using srcs[0]
</encode>
</bitset>
-<bitset name="isam" extends="#instruction-cat5">
+<bitset name="#instruction-cat5-tex" extends="#instruction-cat5">
+ <override>
+ <expr>{S2EN_BINDLESS}</expr>
+ <doc>
+ The s2en (indirect) or bindless case
+ </doc>
+ <display>
+ {SY}{JP}{NAME}{3D}{A}{O}{P}{S}{S2EN}{UNIFORM}{NONUNIFORM}{BASE} {TYPE}({WRMASK}){DST_HALF}{DST}{SRC1}{SRC2}{SRC3}{A1}
+ </display>
+ <field name="BASE_HI" low="19" high="20" type="uint"/>
+ <field name="SRC3" low="21" high="28" type="#cat5-src3">
+ <param name="BINDLESS"/>
+ <param name="DESC_MODE"/>
+ <param name="HAS_SAMP"/>
+ <param name="HAS_TEX"/>
+ </field>
+ <field name="DESC_MODE" low="29" high="31" type="#cat5-s2en-bindless-desc-mode"/>
+ <field name="BASE" pos="47" type="#cat5-s2en-bindless-base">
+ <param name="BINDLESS"/>
+ <param name="BASE_HI"/>
+ </field>
+ <derived name="BINDLESS" expr="#cat5-s2enb-is-bindless" type="bool"/>
+ <derived name="S2EN" expr="#cat5-s2enb-is-indirect" type="bool" display=".s2en"/>
+ <derived name="UNIFORM" expr="#cat5-s2enb-is-uniform" type="bool" display=".uniform"/>
+ <derived name="NONUNIFORM" expr="#cat5-s2enb-is-nonuniform" type="bool" display=".nonuniform"/>
+ <derived name="A1" expr="#cat5-s2enb-uses_a1" type="bool" display=", a1.x"/>
+ </override>
+
+ <assert low="19" high="20">00</assert> <!-- BASE_HI -->
+ <field name="P" pos="53" type="bool" display=".p"/>
+
+ <encode>
+ <map name="P">!!(src->flags & IR3_INSTR_P)</map>
+ </encode>
+</bitset>
+
+<bitset name="isam" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00000</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="isaml" extends="#instruction-cat5">
+<bitset name="isaml" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00001</pattern>
<derived name="NUM_SRC" expr="#two" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="isamm" extends="#instruction-cat5">
+<bitset name="isamm" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00010</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="sam" extends="#instruction-cat5">
+<bitset name="sam" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00011</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="samb" extends="#instruction-cat5">
+<bitset name="samb" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00100</pattern>
<derived name="NUM_SRC" expr="#two" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="saml" extends="#instruction-cat5">
+<bitset name="saml" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00101</pattern>
<derived name="NUM_SRC" expr="#two" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="samgq" extends="#instruction-cat5">
+<bitset name="samgq" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00110</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="getlod" extends="#instruction-cat5">
+<bitset name="getlod" extends="#instruction-cat5-tex">
<pattern low="54" high="58">00111</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="conv" extends="#instruction-cat5">
+<bitset name="conv" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01000</pattern>
<derived name="NUM_SRC" expr="#two" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="convm" extends="#instruction-cat5">
+<bitset name="convm" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01001</pattern>
<derived name="NUM_SRC" expr="#two" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="getsize" extends="#instruction-cat5">
+<bitset name="getsize" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01010</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="getbuf" extends="#instruction-cat5">
+<bitset name="getbuf" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01011</pattern>
<derived name="NUM_SRC" expr="#zero" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="getpos" extends="#instruction-cat5">
+<bitset name="getpos" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01100</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="getinfo" extends="#instruction-cat5">
+<bitset name="getinfo" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01101</pattern>
<derived name="NUM_SRC" expr="#zero" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="dsx" extends="#instruction-cat5">
+<bitset name="dsx" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01110</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="dsy" extends="#instruction-cat5">
+<bitset name="dsy" extends="#instruction-cat5-tex">
<pattern low="54" high="58">01111</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="gather4r" extends="#instruction-cat5">
+<bitset name="gather4r" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10000</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="gather4g" extends="#instruction-cat5">
+<bitset name="gather4g" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10001</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="gather4b" extends="#instruction-cat5">
+<bitset name="gather4b" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10010</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="gather4a" extends="#instruction-cat5">
+<bitset name="gather4a" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10011</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="samgp0" extends="#instruction-cat5">
+<bitset name="samgp0" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10100</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="samgp1" extends="#instruction-cat5">
+<bitset name="samgp1" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10101</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="samgp2" extends="#instruction-cat5">
+<bitset name="samgp2" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10110</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="samgp3" extends="#instruction-cat5">
+<bitset name="samgp3" extends="#instruction-cat5-tex">
<pattern low="54" high="58">10111</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#true" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="dsxpp.1" extends="#instruction-cat5">
+<bitset name="dsxpp.1" extends="#instruction-cat5-tex">
<pattern low="54" high="58">11000</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#false" type="bool"/>
</bitset>
-<bitset name="dsypp.1" extends="#instruction-cat5">
+<bitset name="dsypp.1" extends="#instruction-cat5-tex">
<pattern low="54" high="58">11001</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#false" type="bool"/>
</bitset>
-<bitset name="rgetpos" extends="#instruction-cat5">
+<bitset name="rgetpos" extends="#instruction-cat5-tex">
<pattern low="54" high="58">11010</pattern>
<derived name="NUM_SRC" expr="#one" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
-<bitset name="rgetinfo" extends="#instruction-cat5">
+<bitset name="rgetinfo" extends="#instruction-cat5-tex">
<pattern low="54" high="58">11011</pattern>
<derived name="NUM_SRC" expr="#zero" type="uint"/>
<derived name="HAS_SAMP" expr="#false" type="bool"/>
<derived name="HAS_TYPE" expr="#true" type="bool"/>
</bitset>
+<bitset name="brcst.active" extends="#instruction-cat5">
+ <doc>
+ The subgroup is divided into (subgroup_size / CLUSTER_SIZE)
+ clusters. For each cluster brcst.active.w does:
+
+ Given a cluster of fibers f_0, f_1, ..., f_{CLUSTER_SIZE-1} brcst
+ broadcasts the SRC value from the fiber f_{CLUSTER_SIZE/2-1}
+ to fibers f_{CLUSTER_SIZE/2}, ..., f_{CLUSTER_SIZE-1}. The DST reg
+ in other fibers is unaffected. If fiber f_{CLUSTER_SIZE/2-1} is
+ inactive the value to broadcast is taken from lower fibers
+ f_{CLUSTER_SIZE/2-2}, f_{CLUSTER_SIZE/2-3}, ...
+ If all fibers f_0, f_1, ..., f_{CLUSTER_SIZE/2-1} are inactive
+ the DST reg remains unchanged for all fibers.
+
+ It is necessary in order to implement arithmetic subgroup
+ operations with prefix sum (https://en.wikipedia.org/wiki/Prefix_sum).
+
+ For brcst.active.w8 without inactive fibers:
+ Fiber | 0 1 2 3 4 5 6 7 | 8 9 10 11 12 13 14 15
+ SRC | s0 s1 s2 s3 ... s7 | s8 ... s11 ... s15
+ DST_before | d0 d1 ... d7 | d8 ... d15
+ DST_after | d0 d1 d2 d3 s3 s3 s3 s3 | d8 ... d11 s11 s11 s11 s11
+
+ If fibers 2 and 3 are inactive:
+ Fiber | 0 1 X X 4 5 6 7 | ...
+ SRC | s0 s1 X X ... s7 | ...
+ DST_before | d0 d1 ... d7 | ...
+ DST_after | d0 d1 X X s1 s1 s1 s1 | ...
+ </doc>
+
+ <gen min="600"/>
+
+ <display>
+ {SY}{JP}{NAME}.w{CLUSTER_SIZE} {TYPE}({WRMASK}){DST_HALF}{DST}{SRC1}
+ </display>
+
+ <field name="W" low="19" high="20" type="uint"/>
+ <pattern low="53" high="58">111110</pattern> <!-- OPC -->
+
+ <derived name="CLUSTER_SIZE" type="uint">
+ <expr>
+ 2 << {W}
+ </expr>
+ </derived>
+ <derived name="NUM_SRC" expr="#one" type="uint"/>
+ <derived name="HAS_SAMP" expr="#false" type="bool"/>
+ <derived name="HAS_TEX" expr="#false" type="bool"/>
+ <derived name="HAS_TYPE" expr="#true" type="bool"/>
+
+ <encode>
+ <map name="W">util_logbase2(src->cat5.cluster_size) - 1</map>
+ </encode>
+</bitset>
+
+<bitset name="#instruction-cat5-quad-shuffle" extends="#instruction-cat5">
+ <gen min="600"/>
+
+ <display>
+ {SY}{JP}{NAME} {TYPE}({WRMASK}){DST_HALF}{DST}{SRC1}{SRC2}
+ </display>
+
+ <pattern low="53" high="58">111111</pattern> <!-- OPC -->
+
+ <derived name="HAS_SAMP" expr="#false" type="bool"/>
+ <derived name="HAS_TEX" expr="#false" type="bool"/>
+ <derived name="HAS_TYPE" expr="#true" type="bool"/>
+</bitset>
+
+<bitset name="quad_shuffle.brcst" extends="#instruction-cat5-quad-shuffle">
+ <doc>subgroupQuadBroadcast</doc>
+
+ <pattern low="19" high="20">00</pattern> <!-- Quad-shuffle variant -->
+
+ <derived name="NUM_SRC" expr="#two" type="uint"/>
+</bitset>
+
+<bitset name="quad_shuffle.horiz" extends="#instruction-cat5-quad-shuffle">
+ <doc>subgroupQuadSwapHorizontal</doc>
+
+ <pattern low="19" high="20">01</pattern> <!-- Quad-shuffle variant -->
+
+ <derived name="NUM_SRC" expr="#one" type="uint"/>
+</bitset>
+
+<bitset name="quad_shuffle.vert" extends="#instruction-cat5-quad-shuffle">
+ <doc>subgroupQuadSwapVertical</doc>
+
+ <pattern low="19" high="20">10</pattern> <!-- Quad-shuffle variant -->
+
+ <derived name="NUM_SRC" expr="#one" type="uint"/>
+</bitset>
+
+<bitset name="quad_shuffle.diag" extends="#instruction-cat5-quad-shuffle">
+ <doc>subgroupQuadSwapDiagonal</doc>
+
+ <pattern low="19" high="20">11</pattern> <!-- Quad-shuffle variant -->
+
+ <derived name="NUM_SRC" expr="#one" type="uint"/>
+</bitset>
<!--
All the magic for conditionally displaying various srcs, etc