Mesa (master): i965/fs: Take the shared mathbox into account in instruction scheduling.

Eric Anholt anholt at kemper.freedesktop.org
Thu Jan 20 01:36:53 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan 18 21:26:53 2011 -0800

i965/fs: Take the shared mathbox into account in instruction scheduling.

I don't have evidence for this amounting to any improvement,
but it does codify a bit more what we understand so far about
the pipeline.

---

 .../dri/i965/brw_fs_schedule_instructions.cpp      |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_fs_schedule_instructions.cpp
index 00aa99d..c8f0b27 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_schedule_instructions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_schedule_instructions.cpp
@@ -438,6 +438,21 @@ instruction_scheduler::schedule_instructions(fs_inst *next_block_header)
 	    instructions.push_tail(child);
 	 }
       }
+
+      /* Shared resource: the mathbox.  There's one per EU (on later
+       * generations, it's even more limited pre-gen6), so if we send
+       * something off to it then the next math isn't going to make
+       * progress until the first is done.
+       */
+      if (chosen->inst->is_math()) {
+	 foreach_iter(exec_list_iterator, iter, instructions) {
+	    schedule_node *n = (schedule_node *)iter.get();
+
+	    if (n->inst->is_math())
+	       n->unblocked_time = MAX2(n->unblocked_time,
+					time + chosen->latency);
+	 }
+      }
    }
 
    assert(instructions_to_schedule == 0);




More information about the mesa-commit mailing list