broadcom/vc5: Use XOR instead of SUB for execute flags comparisons.
authorEric Anholt <eric@anholt.net>
Fri, 12 Jan 2018 23:38:04 +0000 (15:38 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 13 Jan 2018 05:58:18 +0000 (21:58 -0800)
I think this should be equivalent other than power, and it's the kind of
comparison we use for nir_op_ieq.

src/broadcom/compiler/nir_to_vir.c

index 955083b717d01fbf4ffc9b47651b2e12c3d73e09..bc18b19f80210cda1d7eb803a329b8afdf9c0fa4 100644 (file)
@@ -1596,7 +1596,7 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
 static void
 ntq_activate_execute_for_block(struct v3d_compile *c)
 {
-        vir_PF(c, vir_SUB(c, c->execute, vir_uniform_ui(c, c->cur_block->index)),
+        vir_PF(c, vir_XOR(c, c->execute, vir_uniform_ui(c, c->cur_block->index)),
                V3D_QPU_PF_PUSHZ);
 
         vir_MOV_cond(c, V3D_QPU_COND_IFA, c->execute, vir_uniform_ui(c, 0));
@@ -1658,7 +1658,7 @@ ntq_emit_if(struct v3d_compile *c, nir_if *if_stmt)
                              vir_uniform_ui(c, after_block->index));
 
                 /* If everything points at ENDIF, then jump there immediately. */
-                vir_PF(c, vir_SUB(c, c->execute,
+                vir_PF(c, vir_XOR(c, c->execute,
                                   vir_uniform_ui(c, after_block->index)),
                        V3D_QPU_PF_PUSHZ);
                 vir_BRANCH(c, V3D_QPU_BRANCH_COND_ALLA);
@@ -1772,7 +1772,7 @@ ntq_emit_loop(struct v3d_compile *c, nir_loop *loop)
          *
          * XXX: Use the .ORZ flags update, instead.
          */
-        vir_PF(c, vir_SUB(c,
+        vir_PF(c, vir_XOR(c,
                           c->execute,
                           vir_uniform_ui(c, c->loop_cont_block->index)),
                V3D_QPU_PF_PUSHZ);