i965/vec4: Add argument index and type checks to SEL saturate propagation.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 18 Mar 2015 13:51:45 +0000 (15:51 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 23 Mar 2015 12:09:33 +0000 (14:09 +0200)
SEL saturate propagation already implicitly relies on these
assumptions.

Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp

index 73b4f53f04b064aef266a71d17ddc4c05fd48408..478ae09b6770b1c1cf31c6f6a6dd3b8e9521c5c4 100644 (file)
@@ -343,7 +343,10 @@ try_copy_propagate(struct brw_context *brw, vec4_instruction *inst,
        */
       switch(inst->opcode) {
       case BRW_OPCODE_SEL:
-         if (inst->src[1].file != IMM ||
+         if (arg != 0 ||
+             inst->src[0].type != BRW_REGISTER_TYPE_F ||
+             inst->src[1].file != IMM ||
+             inst->src[1].type != BRW_REGISTER_TYPE_F ||
              inst->src[1].fixed_hw_reg.dw1.f < 0.0 ||
              inst->src[1].fixed_hw_reg.dw1.f > 1.0) {
             return false;