Skip to content

ir3: add support for movs

Job Noorman requested to merge jnoorman/mesa:ir3-movs into main

movs works like subgroupBroadcast/OpGroupNonUniformBroadcast. The fiber id can either be an immediate or a value in a0.x. In the latter case the value has to be dynamically uniform or else the behavior is undefined. The dst register has to be shared or else the behavior seems to be equivalent to a normal mov (i.e., the fiber id is not taken into account anymore).

movs can do a cov on the broadcasted value. It works exactly like a normal cov except that using u8 as the src type does not seem to work at all.

Codegen for movs is trivial since it has the same semantics as nir_intrinsic_read_invocation.

ir3_cf is made aware of movs and supports folding any cov into it.

Sometimes, ir3_cp will fold a shared reg into movs's src in which case it behaves exactly the same as mov. ir3_cp is made aware of this and will transform such a movs into a mov to allow further optimizations. Since this situation would only happen if the src is convergent, it might make sense to add a NIR pass that removes nir_intrinsic_read_invocation whenever its src is convergent.

Merge request reports

Loading