Mesa (master): i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.

Eric Anholt anholt at kemper.freedesktop.org
Wed Aug 8 23:43:23 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Aug  6 15:02:34 2012 -0700

i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.

I don't know if it was possible to trigger this bug -- we don't merge
saturates into the math instruction because we're bad at coalescing currently,
and there's nothing generating these with predicates.  Still, let's avoid
future bugs when we do smarter codegen.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
index 21eafcb..e63e08d 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
@@ -348,7 +348,11 @@ vec4_visitor::generate_math2_gen4(vec4_instruction *inst,
    struct brw_reg &op0 = is_int_div ? src1 : src0;
    struct brw_reg &op1 = is_int_div ? src0 : src1;
 
+   brw_push_insn_state(p);
+   brw_set_saturate(p, false);
+   brw_set_predicate_control(p, BRW_PREDICATE_NONE);
    brw_MOV(p, retype(brw_message_reg(inst->base_mrf + 1), op1.type), op1);
+   brw_pop_insn_state(p);
 
    brw_math(p,
 	    dst,




More information about the mesa-commit mailing list