Skip to content

agx: Handle some NIR pack opcodes natively

Alyssa Rosenzweig requested to merge alyssa/mesa:agx/packing into main

Top patch is from !21673 (merged), just included here for the algebraic infrastructure.

We should handle nir_op_unpack_32_2x16_split_* natively, since we can generate
better code with agx_subdivide (coalescing the ops away) than the bitshift

That said, we do need some extra instructions for the floating point

No shader-db changes (which makes sense because we're targetting the GLES3.0
shader-db, which doesn't have the packing GLSL functions).

The real motivation of this change isn't optimizing some GLSL pack functions,
though, it's avoiding a code regression from using NIR's memory bit size
lowering in a future MR. That lowering will turn things like "load i16vec4" into
"load i32vec2 + unpack_32_2x16", so we need to be able to coalesce that unpack.
  • a fix to make sure this really does get coalesced.

Merge request reports