elk/algebraic: Protect SHUFFLE from OOB indices

Akin to b67230de63 ("intel/fs: Protect opt_algebraic from OOB BROADCAST
indices"), we need to protect SHUFFLE as well.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36779>
This commit is contained in:
Matt Turner 2025-08-14 10:47:34 -07:00 committed by Marge Bot
parent b4b692c486
commit 6fd4dc353c

View file

@ -2530,9 +2530,9 @@ elk_fs_visitor::opt_algebraic()
inst->sources = 1;
progress = true;
} else if (inst->src[1].file == IMM) {
const unsigned comp = inst->src[1].ud & (inst->exec_size - 1);
inst->opcode = ELK_OPCODE_MOV;
inst->src[0] = component(inst->src[0],
inst->src[1].ud);
inst->src[0] = component(inst->src[0], comp);
inst->sources = 1;
progress = true;
}