From 16cd232dbc31fd594b8ce6b04576870b36d301f6 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 16 May 2020 18:03:25 -0700 Subject: [PATCH] freedreno/ir3/cp: fix cmps folding When we start doing cp iteratively, we hit the case that we've already `cmps.s.*` into a `cmps.s.ne p0.x, ...`.. when we try to do that again we can invert the logic condition. So check specifically the condition to prevent this. TODO we could maybe be more clever about this to combine conditions. But why isn't that happening in nir? For example, see dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.bool Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3_cp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c index a7ae834d18a..fd137301874 100644 --- a/src/freedreno/ir3/ir3_cp.c +++ b/src/freedreno/ir3/ir3_cp.c @@ -696,7 +696,8 @@ instr_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr) (instr->regs[0]->num == regid(REG_P0, 0)) && ssa(instr->regs[1]) && (instr->regs[2]->flags & IR3_REG_IMMED) && - (instr->regs[2]->iim_val == 0)) { + (instr->regs[2]->iim_val == 0) && + (instr->cat2.condition == IR3_COND_NE)) { struct ir3_instruction *cond = ssa(instr->regs[1]); switch (cond->opc) { case OPC_CMPS_S: -- 2.30.2