pan/bi: Default csel to "!= 0" mode
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sun, 22 Mar 2020 01:19:14 +0000 (21:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sun, 22 Mar 2020 03:32:35 +0000 (03:32 +0000)
This way we always have regular csel conditions instead of a weird
.always special case for 3-src CSEL mode.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4276>

src/panfrost/bifrost/bifrost_compile.c

index cdf25d5a81d4e3e39d84aacc47d7a353a5b45bc4..a00dabe71fb8c5f538368b50f2ada29fec52e3a9 100644 (file)
@@ -595,6 +595,11 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
         }
 
         if (alu.type == BI_CSEL) {
+                /* Default to csel3 */
+                alu.csel_cond = BI_COND_NE;
+                alu.src[3] = BIR_INDEX_ZERO;
+                alu.src_types[3] = alu.src_types[0];
+
                 bi_fuse_csel_cond(&alu, instr->src[0],
                                 &constants_left, &constant_shift);
         }