i965/vec4: do not predicate scratch writes for BRW_OPCODE_SEL instructions
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 31 Jul 2015 12:36:30 +0000 (14:36 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Fri, 7 Aug 2015 06:12:50 +0000 (08:12 +0200)
The dst is always written, in this case the predicate is only used to select
the value to write, so if we are spilling the dst we always want to write
whatever value we selected to scratch.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index c5c0d2c73e0369a2c3202aa8a92149616d791323..ba352be3ad5863ef58e127913ea861b8533b3e3a 100644 (file)
@@ -3482,7 +3482,8 @@ vec4_visitor::emit_scratch_write(bblock_t *block, vec4_instruction *inst,
    dst_reg dst = dst_reg(brw_writemask(brw_vec8_grf(0, 0),
                                       inst->dst.writemask));
    vec4_instruction *write = SCRATCH_WRITE(dst, temp, index);
-   write->predicate = inst->predicate;
+   if (inst->opcode != BRW_OPCODE_SEL)
+      write->predicate = inst->predicate;
    write->ir = inst->ir;
    write->annotation = inst->annotation;
    inst->insert_after(block, write);