Mesa (master): i965/fs: Replace usage is_tex() with regs_written() checks.

Eric Anholt anholt at kemper.freedesktop.org
Wed Jul 18 19:36:50 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jul  6 14:51:44 2012 -0700

i965/fs: Replace usage is_tex() with regs_written() checks.

In these places, we care about any sort of send that hits more than one reg,
not just textures.  We don't yet have anything else returning more than one
reg, so there's no change.

v2: Use mlen instead of is_tex() for the is-it-a-send check.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c6056ad..de049d5 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1063,8 +1063,10 @@ fs_visitor::split_virtual_grfs()
    foreach_list(node, &this->instructions) {
       fs_inst *inst = (fs_inst *)node;
 
-      /* Texturing produces 4 contiguous registers, so no splitting. */
-      if (inst->is_tex()) {
+      /* If there's a SEND message that requires contiguous destination
+       * registers, no splitting is allowed.
+       */
+      if (inst->regs_written() > 1) {
 	 split_grf[inst->dst.reg] = false;
       }
    }
@@ -1400,7 +1402,7 @@ fs_visitor::propagate_constants()
 	 if (scan_inst->dst.file == GRF &&
 	     scan_inst->dst.reg == inst->dst.reg &&
 	     (scan_inst->dst.reg_offset == inst->dst.reg_offset ||
-	      scan_inst->is_tex())) {
+	      scan_inst->regs_written() > 1)) {
 	    break;
 	 }
       }
@@ -1602,14 +1604,14 @@ fs_visitor::register_coalesce()
 	 if (scan_inst->dst.file == GRF) {
 	    if (scan_inst->dst.reg == inst->dst.reg &&
 		(scan_inst->dst.reg_offset == inst->dst.reg_offset ||
-		 scan_inst->is_tex())) {
+		 scan_inst->regs_written() > 1)) {
 	       interfered = true;
 	       break;
 	    }
 	    if (inst->src[0].file == GRF &&
 		scan_inst->dst.reg == inst->src[0].reg &&
 		(scan_inst->dst.reg_offset == inst->src[0].reg_offset ||
-		 scan_inst->is_tex())) {
+		 scan_inst->regs_written() > 1)) {
 	       interfered = true;
 	       break;
 	    }
@@ -1729,10 +1731,8 @@ fs_visitor::compute_to_mrf()
 	     * into a compute-to-MRF.
 	     */
 
-	    if (scan_inst->is_tex()) {
-	       /* texturing writes several continuous regs, so we can't
-		* compute-to-mrf that.
-		*/
+            /* SENDs can only write to GRFs, so no compute-to-MRF. */
+	    if (scan_inst->mlen) {
 	       break;
 	    }
 




More information about the mesa-commit mailing list