Skip to content

ir3: Limit the maximum imm offset in nir_opt_offset for shared vars

STL/LDL have 13 bits to store imm offset.

For LDL:

<field   low="1"  high="13" name="OFF" type="offset"/>

For STL:

	<derived name="OFF" width="13" type="offset">
		<expr>({OFF_HI} &lt;&lt; 8) | {OFF_LO}</expr>
	</derived>

Fixes crash in CS compilation in Monster Hunter World.

Fixes: b024102d ("freedreno/ir3: Use nir_opt_offset for removing constant adds for shared vars.")

Merge request reports