pan/mdg: Ensure fdot is scalar out in disasm
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 28 Apr 2020 21:44:19 +0000 (17:44 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Apr 2020 15:35:54 +0000 (15:35 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4793>

src/panfrost/midgard/disassemble.c

index 8c7f718674f260fc5509cc035e7645bbff69b12b..ddcd41706af348ebbf75d29626271d0fd577bc89 100644 (file)
@@ -631,6 +631,17 @@ print_vector_field(FILE *fp, const char *name, uint16_t *words, uint16_t reg_wor
                         fprintf(fp, "/* do%u */ ", override);
         }
 
+        /* Instructions like fdot4 do *not* replicate, ensure the
+         * mask is of only a single component */
+
+        unsigned rep = GET_CHANNEL_COUNT(alu_opcode_props[alu_field->op].props);
+
+        if (rep) {
+                unsigned comp_mask = condense_writemask(mask, bits_for_mode(mode));
+                unsigned num_comp = util_bitcount(comp_mask);
+                if (num_comp != 1)
+                        fprintf(fp, "/* err too many components */");
+        }
         print_mask(fp, mask, bits_for_mode(mode), override);
 
         fprintf(fp, ", ");