If we detect MOV X Y, register coalescing tries to rewrite future
instructions that use X to use Y instead.  However, if Y is smaller
than X, coalescing could get us into trouble.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_fs.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

This is probably...kinda bogus.  But it seems like we ought to have
something similar to this.

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 8b85f3b..b419538 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1288,7 +1288,8 @@ fs_visitor::register_coalesce()
          inst->saturate ||
          inst->dst.file != GRF || (inst->src[0].file != GRF &&
                                    inst->src[0].file != UNIFORM)||
-         inst->dst.type != inst->src[0].type)
+         inst->dst.type != inst->src[0].type ||
+         virtual_grf_sizes[inst->src[0].reg] < 
virtual_grf_sizes[inst->dst.reg])
         continue;
 
       bool has_source_modifiers = inst->src[0].abs || inst->src[0].negate;
-- 
1.7.6.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to