Mesa (master): i965: Fix reversed naming of the operations in compute-to-mrf optimization.

Eric Anholt anholt at kemper.freedesktop.org
Mon Jul 26 20:08:39 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jul 26 13:01:45 2010 -0700

i965: Fix reversed naming of the operations in compute-to-mrf optimization.

Also fix up comments, so that the difference between the two passes is
clarified.

---

 src/mesa/drivers/dri/i965/brw_eu.h       |    2 +-
 src/mesa/drivers/dri/i965/brw_optimize.c |   13 +++++++++----
 src/mesa/drivers/dri/i965/brw_wm_emit.c  |    2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index bc15173..ffdddd0 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -985,6 +985,6 @@ void brw_set_src1( struct brw_instruction *insn,
 /* brw_optimize.c */
 void brw_optimize(struct brw_compile *p);
 void brw_remove_duplicate_mrf_moves(struct brw_compile *p);
-void brw_remove_mrf_to_grf_moves(struct brw_compile *p);
+void brw_remove_grf_to_mrf_moves(struct brw_compile *p);
 
 #endif
diff --git a/src/mesa/drivers/dri/i965/brw_optimize.c b/src/mesa/drivers/dri/i965/brw_optimize.c
index e9bb25c..8aa6fb6 100644
--- a/src/mesa/drivers/dri/i965/brw_optimize.c
+++ b/src/mesa/drivers/dri/i965/brw_optimize.c
@@ -476,9 +476,11 @@ static void brw_remove_inst(struct brw_compile *p, const GLboolean *removeInst)
    p->nr_insn = nr_insn;
 }
 
-/* The gen code emitter generates a lot of duplications in the mrf-to-grf moves.
- * Here, we monitor same mov mrf-to-grf instrutions and remove them as soon as
- * none of the two operands have been written
+/* The gen code emitter generates a lot of duplications in the
+ * grf-to-mrf moves, for example when texture sampling with the same
+ * coordinates from multiple textures..  Here, we monitor same mov
+ * grf-to-mrf instrutions and remove repeated ones where the operands
+ * and dst ahven't changed in between.
  */
 void brw_remove_duplicate_mrf_moves(struct brw_compile *p)
 {
@@ -521,7 +523,10 @@ void brw_remove_duplicate_mrf_moves(struct brw_compile *p)
    free(removeInst);
 }
 
-void brw_remove_mrf_to_grf_moves(struct brw_compile *p)
+/* Replace moves to MRFs where the value moved is the result of a
+ * normal arithmetic operation with computation right into the MRF.
+ */
+void brw_remove_grf_to_mrf_moves(struct brw_compile *p)
 {
    int i, j, prev;
    struct brw_context *brw = p->brw;
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c
index d29dbce..d9fa2e6 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c
@@ -1716,7 +1716,7 @@ void brw_wm_emit( struct brw_wm_compile *c )
    if (p->brw->intel.gen == 5) {
      brw_remove_duplicate_mrf_moves(p);
      if (c->dispatch_width == 16)
-	brw_remove_mrf_to_grf_moves(p);
+	brw_remove_grf_to_mrf_moves(p);
    }
 
    if (INTEL_DEBUG & DEBUG_WM) {




More information about the mesa-commit mailing list