i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.
authorEric Anholt <eric@anholt.net>
Mon, 6 Aug 2012 22:02:34 +0000 (15:02 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 8 Aug 2012 23:21:31 +0000 (16:21 -0700)
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@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp

index 21eafcbcb5df1f74d9a4596d314843d5d9ef8055..e63e08dc7da74698d540ef7c380566ef9b2e4fcc 100644 (file)
@@ -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,