pan/bi(t): Fix SELECT tests
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 27 Apr 2020 18:14:34 +0000 (14:14 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Apr 2020 17:17:48 +0000 (17:17 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4789>

src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/test/bi_interpret.c
src/panfrost/bifrost/test/bi_test_pack.c

index ee85fad6fe2761c2e59cef8e0a12539ab2c83b01..5ae911e35484f361512d906037db68062d0059bf 100644 (file)
@@ -1279,7 +1279,7 @@ bi_pack_add_tex_compact(bi_clause *clause, bi_instruction *ins, struct bi_regist
 static unsigned
 bi_pack_add_select(bi_instruction *ins, struct bi_registers *regs)
 {
-        unsigned size = nir_alu_type_get_type_size(ins->dest_type);
+        unsigned size = nir_alu_type_get_type_size(ins->src_types[0]);
         assert(size == 16);
 
         unsigned swiz = (ins->swizzle[0][0] | (ins->swizzle[1][0] << 1));
index 182a012bd78ace9834a6b7d4dbd51443bb5ad49b..449770bf833e0529a0ea65157bb097e9f30f5ff2 100644 (file)
@@ -530,10 +530,10 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA)
        }
 
         case BI_SELECT: {
-                if (ins->dest_type == nir_type_uint16) {
+                if (ins->src_types[0] == nir_type_uint16) {
                         for (unsigned c = 0; c < 2; ++c)
                                 dest.u16[c] = srcs[c].u16[ins->swizzle[c][0]];
-                } else if (ins->dest_type == nir_type_uint8) {
+                } else if (ins->src_types[0] == nir_type_uint8) {
                         for (unsigned c = 0; c < 4; ++c)
                                 dest.u8[c] = srcs[c].u8[ins->swizzle[c][0]];
                 } else {
index cdbb1a27eddccace42b9403a24100410f99d0d58..a4d86855eb997d1512470b8920611adaab65b868 100644 (file)
@@ -543,6 +543,6 @@ bit_packing(struct panfrost_device *dev, enum bit_debug debug)
         bit_fma_mscale_helper(dev, mscale_input, debug);
 
         for (unsigned sz = 8; sz <= 16; sz *= 2) {
-                bit_select_helper(dev, (uint32_t *) input32, 8, debug);
+                bit_select_helper(dev, (uint32_t *) input32, sz, debug);
         }
 }