From 3db322f3059c760c2b55b166565c044e0bc45fa0 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 16 Mar 2021 09:02:20 +0100 Subject: [PATCH] broadcom/compiler: fix end of tmu sequence detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TMUWT always terminates a TMU sequence. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/compiler/vir_register_allocate.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/broadcom/compiler/vir_register_allocate.c b/src/broadcom/compiler/vir_register_allocate.c index efa86444e76..41fc25729cb 100644 --- a/src/broadcom/compiler/vir_register_allocate.c +++ b/src/broadcom/compiler/vir_register_allocate.c @@ -46,18 +46,22 @@ static bool is_end_of_tmu_sequence(const struct v3d_device_info *devinfo, struct qinst *inst, struct qblock *block) { - if (!inst->qpu.sig.ldtmu && - !(inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && - inst->qpu.alu.add.op != V3D_QPU_A_TMUWT)) { - return false; + if (inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && + inst->qpu.alu.add.op == V3D_QPU_A_TMUWT) { + return true; } + if (!inst->qpu.sig.ldtmu) + return false; + list_for_each_entry_from(struct qinst, scan_inst, inst->link.next, &block->instructions, link) { - if (scan_inst->qpu.sig.ldtmu || - (inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && - inst->qpu.alu.add.op == V3D_QPU_A_TMUWT)) { + if (scan_inst->qpu.sig.ldtmu) return false; + + if (inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && + inst->qpu.alu.add.op == V3D_QPU_A_TMUWT) { + return true; } if (qinst_writes_tmu(devinfo, scan_inst))