i965/fs: Use source's original type in register_coalesce().
authorMatt Turner <mattst88@gmail.com>
Fri, 15 Nov 2013 19:09:47 +0000 (11:09 -0800)
committerMatt Turner <mattst88@gmail.com>
Wed, 20 Nov 2013 23:04:52 +0000 (15:04 -0800)
Previously, register_coalesce() would modify

   mov   vgrf1:f  vgrf2:f
   cmp   null     vgrf3:d  vgrf1:d

to be

   cmp   null     vgrf3:d  vgrf2:f

and incorrectly use vgrf2's type in the instruction that the mov was
coalesced into.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 8b3f8df26f923b7d002027fe4e71c517418c8975..5b20b1cbbe6bd6f30de0edabaf81fe1e95c0d794 100644 (file)
@@ -2429,6 +2429,7 @@ fs_visitor::register_coalesce()
                scan_inst->src[i].reg == inst->dst.reg &&
                scan_inst->src[i].reg_offset == inst->dst.reg_offset) {
               fs_reg new_src = inst->src[0];
+               new_src.type = scan_inst->src[i].type;
                if (scan_inst->src[i].abs) {
                   new_src.negate = 0;
                   new_src.abs = 1;