intel/compiler: Only GE and L modifiers are commutative for SEL
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 30 Oct 2019 00:02:46 +0000 (17:02 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 17 Apr 2020 15:21:43 +0000 (08:21 -0700)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4582>

src/intel/compiler/brw_fs_copy_propagation.cpp

index bc5af9732b3117f9afe3e69d27f0ae7396868e18..a33043573a53a23f46b1f3545c660887bf35430a 100644 (file)
@@ -823,7 +823,11 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
          if (i == 1) {
             inst->src[i] = val;
             progress = true;
-         } else if (i == 0 && inst->src[1].file != IMM) {
+         } else if (i == 0 && inst->src[1].file != IMM &&
+                    (inst->conditional_mod == BRW_CONDITIONAL_NONE ||
+                     /* Only GE and L are commutative. */
+                     inst->conditional_mod == BRW_CONDITIONAL_GE ||
+                     inst->conditional_mod == BRW_CONDITIONAL_L)) {
             inst->src[0] = inst->src[1];
             inst->src[1] = val;