From 18a3a0d9151f97f7c1c0f29d80e770af17d54213 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 20 Apr 2023 12:49:22 +0200 Subject: [PATCH] broadcom/compiler: fix incorrect check for SFU op MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before testing the waddr for SFU we should first validate this is indeed a valid (not NOP) magic write. Use the helper we have for this which gets this right. total instructions in shared programs: 12898957 -> 12850958 (-0.37%) instructions in affected programs: 4328937 -> 4280938 (-1.11%) helped: 19974 HURT: 439 Instructions are helped. total max-temps in shared programs: 2211503 -> 2210893 (-0.03%) max-temps in affected programs: 12924 -> 12314 (-4.72%) helped: 509 HURT: 20 Max-temps are helped. total sfu-stalls in shared programs: 22233 -> 21975 (-1.16%) sfu-stalls in affected programs: 722 -> 464 (-35.73%) helped: 297 HURT: 54 Sfu-stalls are helped. total inst-and-stalls in shared programs: 12921190 -> 12872933 (-0.37%) inst-and-stalls in affected programs: 4337977 -> 4289720 (-1.11%) helped: 20015 HURT: 404 Inst-and-stalls are helped. total nops in shared programs: 333743 -> 305911 (-8.34%) nops in affected programs: 86902 -> 59070 (-32.03%) helped: 14545 HURT: 76 Nops are helped. Reviewed-by: Alejandro PiƱeiro cc: mesa-stable Part-of: --- src/broadcom/compiler/qpu_schedule.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/broadcom/compiler/qpu_schedule.c b/src/broadcom/compiler/qpu_schedule.c index bdf5eded6ab..c5742dbb9df 100644 --- a/src/broadcom/compiler/qpu_schedule.c +++ b/src/broadcom/compiler/qpu_schedule.c @@ -1641,12 +1641,8 @@ qpu_inst_before_thrsw_valid_in_delay_slot(struct v3d_compile *c, * thread. The simulator complains for safety, though it * would only occur for dead code in our case. */ - if (slot > 0 && - qinst->qpu.type == V3D_QPU_INSTR_TYPE_ALU && - (v3d_qpu_magic_waddr_is_sfu(qinst->qpu.alu.add.waddr) || - v3d_qpu_magic_waddr_is_sfu(qinst->qpu.alu.mul.waddr))) { + if (slot > 0 && v3d_qpu_instr_is_legacy_sfu(&qinst->qpu)) return false; - } if (slot > 0 && qinst->qpu.sig.ldvary) return false;