From a014fa765ca6078de7a8c00bdacaa48ab856b5a4 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: (cherry picked from commit 18a3a0d9151f97f7c1c0f29d80e770af17d54213) --- .pick_status.json | 2 +- src/broadcom/compiler/qpu_schedule.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 272d4655031..c02f1390264 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1594,7 +1594,7 @@ "description": "broadcom/compiler: fix incorrect check for SFU op", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/broadcom/compiler/qpu_schedule.c b/src/broadcom/compiler/qpu_schedule.c index 517c9eb5741..696b40496ef 100644 --- a/src/broadcom/compiler/qpu_schedule.c +++ b/src/broadcom/compiler/qpu_schedule.c @@ -1593,12 +1593,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;