Mesa (master): vc4: Fix the test for skipping raw MOVs.

Eric Anholt anholt at kemper.freedesktop.org
Sun Oct 25 01:54:34 UTC 2015


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

Author: Eric Anholt <eric at anholt.net>
Date:   Sat Oct 24 16:30:30 2015 -0700

vc4: Fix the test for skipping raw MOVs.

I don't know what previous test was trying to do, but it dates back to the
first add of vc4_qpu_emit.c.  No change to shader-db.

---

 src/gallium/drivers/vc4/vc4_qir.c      |    8 ++++++++
 src/gallium/drivers/vc4/vc4_qir.h      |    1 +
 src/gallium/drivers/vc4/vc4_qpu_emit.c |    2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c
index e7d0d66..3d3989f 100644
--- a/src/gallium/drivers/vc4/vc4_qir.c
+++ b/src/gallium/drivers/vc4/vc4_qir.c
@@ -190,6 +190,14 @@ qir_is_mul(struct qinst *inst)
 }
 
 bool
+qir_is_raw_mov(struct qinst *inst)
+{
+        return (inst->op == QOP_MOV &&
+                !inst->dst.pack &&
+                !inst->src[0].pack);
+}
+
+bool
 qir_is_tex(struct qinst *inst)
 {
         return inst->op >= QOP_TEX_S && inst->op <= QOP_TEX_DIRECT;
diff --git a/src/gallium/drivers/vc4/vc4_qir.h b/src/gallium/drivers/vc4/vc4_qir.h
index fa1b50f..aa4d932 100644
--- a/src/gallium/drivers/vc4/vc4_qir.h
+++ b/src/gallium/drivers/vc4/vc4_qir.h
@@ -463,6 +463,7 @@ bool qir_has_side_effects(struct vc4_compile *c, struct qinst *inst);
 bool qir_has_side_effect_reads(struct vc4_compile *c, struct qinst *inst);
 bool qir_is_multi_instruction(struct qinst *inst);
 bool qir_is_mul(struct qinst *inst);
+bool qir_is_raw_mov(struct qinst *inst);
 bool qir_is_tex(struct qinst *inst);
 bool qir_depends_on_flags(struct qinst *inst);
 bool qir_writes_r4(struct qinst *inst);
diff --git a/src/gallium/drivers/vc4/vc4_qpu_emit.c b/src/gallium/drivers/vc4/vc4_qpu_emit.c
index 4c81deb..2055fa5 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_emit.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_emit.c
@@ -266,7 +266,7 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                 switch (qinst->op) {
                 case QOP_MOV:
                         /* Skip emitting the MOV if it's a no-op. */
-                        if (dst.mux == QPU_MUX_A || dst.mux == QPU_MUX_B ||
+                        if (qir_is_raw_mov(qinst) ||
                             dst.mux != src[0].mux || dst.addr != src[0].addr) {
                                 queue(c, qpu_a_MOV(dst, src[0]));
                         }




More information about the mesa-commit mailing list