i965: Don't overwrite the math function with conditional mod.
authorMatt Turner <mattst88@gmail.com>
Fri, 21 Nov 2014 20:20:53 +0000 (12:20 -0800)
committerMatt Turner <mattst88@gmail.com>
Mon, 24 Nov 2014 22:07:32 +0000 (14:07 -0800)
Ben was asking about the undocumented restriction that the math
instruction cannot use the dependency control hints. I went to reconfirm
and disabled the is_math() check in opt_set_dependency_control() and saw
that the disassembled math instructions with dependency hints had a
bogus math function. We were mistakenly overwriting it by setting an
empty conditional mod.

Unfortunately, this wasn't the cause of the aforementioned problem (I
reproduced it). This bug is benign, since we don't set dependeny hints
on math instructions -- but maybe some day.

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

index 4af9cbe83cbc3ae1236d7636002842d5e6b8345c..06b0f347ae469119f0b5defea8c7d77390509e7f 100644 (file)
@@ -2010,7 +2010,8 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
 
          brw_inst *last = &p->store[last_insn_offset / 16];
 
-         brw_inst_set_cond_modifier(brw, last, inst->conditional_mod);
+         if (inst->conditional_mod)
+            brw_inst_set_cond_modifier(brw, last, inst->conditional_mod);
          brw_inst_set_no_dd_clear(brw, last, inst->no_dd_clear);
          brw_inst_set_no_dd_check(brw, last, inst->no_dd_check);
       }
index d027fda85de39e407c9ba33c1c97d1e290a5e6a2..6a70a2f3839121610fde0ae55fc449f60d4ad849 100644 (file)
@@ -1509,7 +1509,8 @@ vec4_generator::generate_code(const cfg_t *cfg)
 
          brw_inst *last = &p->store[pre_emit_nr_insn];
 
-         brw_inst_set_cond_modifier(brw, last, inst->conditional_mod);
+         if (inst->conditional_mod)
+            brw_inst_set_cond_modifier(brw, last, inst->conditional_mod);
          brw_inst_set_no_dd_clear(brw, last, inst->no_dd_clear);
          brw_inst_set_no_dd_check(brw, last, inst->no_dd_check);
       }