Module: Mesa
Branch: main
Commit: c2003535b9960718f4137acd57d89bd814ea5603
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2003535b9960718f4137acd57d89bd814ea5603

Author: Iago Toral Quiroga <[email protected]>
Date:   Tue Apr 25 09:32:27 2023 +0200

broadcom/compiler: return early for SFU op latency calculation

Since we are returning a fixed latency for these check for them
earlier and return early if they match.

Reviewed-by: Alejandro PiƱeiro <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22675>

---

 src/broadcom/compiler/qpu_schedule.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/broadcom/compiler/qpu_schedule.c 
b/src/broadcom/compiler/qpu_schedule.c
index 9061d2ed4f9..1b0d21463c4 100644
--- a/src/broadcom/compiler/qpu_schedule.c
+++ b/src/broadcom/compiler/qpu_schedule.c
@@ -1460,6 +1460,9 @@ instruction_latency(const struct v3d_device_info *devinfo,
             after_inst->type != V3D_QPU_INSTR_TYPE_ALU)
                 return latency;
 
+        if (v3d_qpu_instr_is_sfu(before_inst))
+                return 2;
+
         if (before_inst->alu.add.op != V3D_QPU_A_NOP &&
             before_inst->alu.add.magic_write) {
                 latency = MAX2(latency,
@@ -1476,9 +1479,6 @@ instruction_latency(const struct v3d_device_info *devinfo,
                                                    after_inst));
         }
 
-        if (v3d_qpu_instr_is_sfu(before_inst))
-                return 2;
-
         return latency;
 }
 

Reply via email to