<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 15, 2019 at 7:55 AM Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">v2:<br>
 - Do not propagate if the bit-size changes<br>
---<br>
 src/intel/compiler/brw_fs_cmod_propagation.cpp | 14 +++++++++-----<br>
 1 file changed, 9 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp<br>
index 7bb5c9afbc9..57d4e645c05 100644<br>
--- a/src/intel/compiler/brw_fs_cmod_propagation.cpp<br>
+++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp<br>
@@ -244,8 +244,7 @@ opt_cmod_propagation_local(const gen_device_info *devinfo,<br>
             /* CMP's result is the same regardless of dest type. */<br>
             if (inst->conditional_mod == BRW_CONDITIONAL_NZ &&<br>
                 scan_inst->opcode == BRW_OPCODE_CMP &&<br>
-                (inst->dst.type == BRW_REGISTER_TYPE_D ||<br>
-                 inst->dst.type == BRW_REGISTER_TYPE_UD)) {<br>
+                brw_reg_type_is_integer(inst->dst.type)) {<br>
                inst->remove(block);<br>
                progress = true;<br>
                break;<br>
@@ -258,9 +257,14 @@ opt_cmod_propagation_local(const gen_device_info *devinfo,<br>
                break;<br>
<br>
             /* Comparisons operate differently for ints and floats */<br>
-            if (scan_inst->dst.type != inst->dst.type &&<br>
-                (scan_inst->dst.type == BRW_REGISTER_TYPE_F ||<br>
-                 inst->dst.type == BRW_REGISTER_TYPE_F))<br>
+            if (brw_reg_type_is_floating_point(scan_inst->dst.type) !=<br>
+                brw_reg_type_is_floating_point(inst->dst.type))<br>
+               break;<br>
+<br>
+            /* Comparison result may be altered if the bit-size changes<br>
+             * since that affects range, denorms, etc<br>
+             */<br>
+            if (type_sz(scan_inst->dst.type) != type_sz(inst->dst.type))<br>
                break;<br>
<br>
             /* If the instruction generating inst's source also wrote the<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>