From da395e6985ab32978ebe120fe83ef05989c1a3e6 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 12 Aug 2024 13:55:08 -0700 Subject: [PATCH] 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: 580e1c592d90 ("intel/brw: Introduce a new SSA-based copy propagation pass") Reviewed-by: Caio Oliveira Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs_copy_propagation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp index e6375605bad..01f253dfcd4 100644 --- a/src/intel/compiler/brw_fs_copy_propagation.cpp +++ b/src/intel/compiler/brw_fs_copy_propagation.cpp @@ -1740,7 +1740,7 @@ extract_imm(brw_reg val, brw_reg_type type, unsigned offset) 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; }