summaryrefslogtreecommitdiffstats
path: root/src/broadcom/qpu/qpu_instr.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-12-28 16:31:07 -0800
committerEric Anholt <[email protected]>2019-01-02 14:12:29 -0800
commit5e9ee6e8419af5089809d4116022af2cb8ca9237 (patch)
treedca764a060a7b987ef978d2f7120718ad1687e2d /src/broadcom/qpu/qpu_instr.c
parent078dc176bcc2cc36c609d04affe073c3225bf4bf (diff)
v3d: Fold comparisons for IF conditions into the flags for the IF.
total instructions in shared programs: 6193810 -> 6192844 (-0.02%) instructions in affected programs: 800373 -> 799407 (-0.12%)
Diffstat (limited to 'src/broadcom/qpu/qpu_instr.c')
-rw-r--r--src/broadcom/qpu/qpu_instr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/broadcom/qpu/qpu_instr.c b/src/broadcom/qpu/qpu_instr.c
index 338a1887f03..add2d2a23c8 100644
--- a/src/broadcom/qpu/qpu_instr.c
+++ b/src/broadcom/qpu/qpu_instr.c
@@ -499,6 +499,23 @@ v3d_qpu_mul_op_num_src(enum v3d_qpu_mul_op op)
return 0;
}
+enum v3d_qpu_cond
+v3d_qpu_cond_invert(enum v3d_qpu_cond cond)
+{
+ switch (cond) {
+ case V3D_QPU_COND_IFA:
+ return V3D_QPU_COND_IFNA;
+ case V3D_QPU_COND_IFNA:
+ return V3D_QPU_COND_IFA;
+ case V3D_QPU_COND_IFB:
+ return V3D_QPU_COND_IFNB;
+ case V3D_QPU_COND_IFNB:
+ return V3D_QPU_COND_IFB;
+ default:
+ unreachable("Non-invertible cond");
+ }
+}
+
bool
v3d_qpu_magic_waddr_is_sfu(enum v3d_qpu_waddr waddr)
{