intel/brw: Fix extract_imm for subregion reads of 64-bit immediates

We could be trying to extract a D/UD from a Q/UQ, for example.  We were
ignoring the top 32-bits, which is incorrect.

Fixes: 580e1c592d ("intel/brw: Introduce a new SSA-based copy propagation pass")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30884>
This commit is contained in:
Kenneth Graunke 2024-08-12 13:55:08 -07:00
parent 51c85e0363
commit da395e6985

View file

@ -1740,7 +1740,7 @@ extract_imm(brw_reg val, brw_reg_type type, unsigned offset)
assert(bitsize < brw_type_size_bits(val.type)); assert(bitsize < brw_type_size_bits(val.type));
val.ud = (val.ud >> (bitsize * offset)) & ((1u << bitsize) - 1); val.u64 = (val.u64 >> (bitsize * offset)) & ((1ull << bitsize) - 1);
return val; return val;
} }