broadcom/vc5: Add a QPU helper for instructions using the TLB.
authorEric Anholt <eric@anholt.net>
Mon, 19 Mar 2018 18:30:27 +0000 (11:30 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 19 Mar 2018 23:42:59 +0000 (16:42 -0700)
This will be used for detecting last thread segment in register spilling.

src/broadcom/qpu/qpu_instr.c
src/broadcom/qpu/qpu_instr.h

index 978d470cc648e6e989984b85dc7bb59b742e4d2e..213a0826a592e75e02bb24434bc38ada078040d0 100644 (file)
@@ -568,6 +568,28 @@ v3d_qpu_add_op_writes_vpm(enum  v3d_qpu_add_op op)
         }
 }
 
+bool
+v3d_qpu_uses_tlb(const struct v3d_qpu_instr *inst)
+{
+        if (inst->sig.ldtlb ||
+            inst->sig.ldtlbu)
+                return true;
+
+        if (inst->type == V3D_QPU_INSTR_TYPE_ALU) {
+                if (inst->alu.add.magic_write &&
+                    v3d_qpu_magic_waddr_is_tlb(inst->alu.add.waddr)) {
+                        return true;
+                }
+
+                if (inst->alu.mul.magic_write &&
+                    v3d_qpu_magic_waddr_is_tlb(inst->alu.mul.waddr)) {
+                        return true;
+                }
+        }
+
+        return false;
+}
+
 bool
 v3d_qpu_writes_tmu(const struct v3d_qpu_instr *inst)
 {
index 9568857f1102d8419ae75a05bb740c8123e0e39c..e5e9a9a3f1f68d1f86f672b949e38ec9bebf1165 100644 (file)
@@ -437,6 +437,7 @@ bool v3d_qpu_magic_waddr_is_tmu(enum v3d_qpu_waddr waddr) ATTRIBUTE_CONST;
 bool v3d_qpu_magic_waddr_is_tlb(enum v3d_qpu_waddr waddr) ATTRIBUTE_CONST;
 bool v3d_qpu_magic_waddr_is_vpm(enum v3d_qpu_waddr waddr) ATTRIBUTE_CONST;
 bool v3d_qpu_magic_waddr_is_tsy(enum v3d_qpu_waddr waddr) ATTRIBUTE_CONST;
+bool v3d_qpu_uses_tlb(const struct v3d_qpu_instr *inst) ATTRIBUTE_CONST;
 bool v3d_qpu_writes_tmu(const struct v3d_qpu_instr *inst) ATTRIBUTE_CONST;
 bool v3d_qpu_writes_r3(const struct v3d_device_info *devinfo,
                        const struct v3d_qpu_instr *instr) ATTRIBUTE_CONST;