[Mesa-dev] [PATCH 1/2] i965/fs/gen7: Allow reads from MRFs.

Matt Turner mattst88 at gmail.com
Mon Apr 8 12:16:20 PDT 2013


Since they're actually GRFs, we can read from them.

total instructions in shared programs: 852751 -> 851371 (-0.16%)
instructions in affected programs:     227286 -> 225906 (-0.61%)
(no regressions)
---
 src/mesa/drivers/dri/i965/brw_fs.cpp |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c12ba45..57be319 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2121,16 +2121,18 @@ fs_visitor::compute_to_mrf()
 	 /* You can't read from an MRF, so if someone else reads our
 	  * MRF's source GRF that we wanted to rewrite, that stops us.
 	  */
-	 bool interfered = false;
-	 for (int i = 0; i < 3; i++) {
-	    if (scan_inst->src[i].file == GRF &&
-		scan_inst->src[i].reg == inst->src[0].reg &&
-		scan_inst->src[i].reg_offset == inst->src[0].reg_offset) {
-	       interfered = true;
-	    }
-	 }
-	 if (interfered)
-	    break;
+         if (intel->gen < 7) {
+            bool interfered = false;
+            for (int i = 0; i < 3; i++) {
+               if (scan_inst->src[i].file == GRF &&
+                   scan_inst->src[i].reg == inst->src[0].reg &&
+                   scan_inst->src[i].reg_offset == inst->src[0].reg_offset) {
+                  interfered = true;
+               }
+            }
+            if (interfered)
+               break;
+         }
 
 	 if (scan_inst->dst.file == MRF) {
 	    /* If somebody else writes our MRF here, we can't
-- 
1.7.8.6



More information about the mesa-dev mailing list