intel/fs: Only propagate saturation if exec_size is the same.
authorRafael Antognolli <rafael.antognolli@intel.com>
Fri, 19 Oct 2018 22:33:50 +0000 (15:33 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Mon, 22 Apr 2019 23:53:55 +0000 (16:53 -0700)
Otherwise it could propagate the saturation from a SIMD16 instruction
into a SIMD8 instruction. With that, only part of the destination
register, which is the source of the move with saturation, would have
been updated.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/intel/compiler/brw_fs_saturate_propagation.cpp

index 1e1461063aef9b162f4dc3890a60653be22e3c6b..fe3fa7ecfead186d045df231f9b67f32baa698cc 100644 (file)
@@ -65,7 +65,8 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block,
 
       bool interfered = false;
       foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst) {
-         if (regions_overlap(scan_inst->dst, scan_inst->size_written,
+         if (scan_inst->exec_size == inst->exec_size &&
+             regions_overlap(scan_inst->dst, scan_inst->size_written,
                              inst->src[0], inst->size_read(0))) {
             if (scan_inst->is_partial_var_write(dispatch_width) ||
                 (scan_inst->dst.type != inst->dst.type &&