broadcom/compiler: fix v3d_qpu_uses_sfu

We should check that the alu op is valid before testing the
write address.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22593>
This commit is contained in:
Iago Toral Quiroga
2023-04-24 08:48:39 +02:00
committed by Marge Bot
parent ee4e7b9d4d
commit 4a3be610d5

View File

@@ -664,12 +664,14 @@ v3d_qpu_uses_sfu(const struct v3d_qpu_instr *inst)
return true;
if (inst->type == V3D_QPU_INSTR_TYPE_ALU) {
if (inst->alu.add.magic_write &&
if (inst->alu.add.op != V3D_QPU_A_NOP &&
inst->alu.add.magic_write &&
v3d_qpu_magic_waddr_is_sfu(inst->alu.add.waddr)) {
return true;
}
if (inst->alu.mul.magic_write &&
if (inst->alu.mul.op != V3D_QPU_M_NOP &&
inst->alu.mul.magic_write &&
v3d_qpu_magic_waddr_is_sfu(inst->alu.mul.waddr)) {
return true;
}