Mesa (master): i965: Don' t overwrite the math function with conditional mod.

Matt Turner mattst88 at kemper.freedesktop.org
Mon Nov 24 22:12:35 UTC 2014


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Nov 21 12:20:53 2014 -0800

i965: Don't overwrite the math function with conditional mod.

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 at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs_generator.cpp   |    3 ++-
 src/mesa/drivers/dri/i965/brw_vec4_generator.cpp |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 4af9cbe..06b0f34 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -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);
       }
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index d027fda..6a70a2f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -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);
       }




More information about the mesa-commit mailing list