pan/midgard: Reorder bits check to fix 8-bit masks
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 16:17:03 +0000 (09:17 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 17:38:31 +0000 (10:38 -0700)
Coverity.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/disassemble.c

index be8c66fe2cc492686dc578e73b04c6b60b0bc377..9174bef33a8fc3291606a4fa4720016f5df2987f 100644 (file)
@@ -411,6 +411,11 @@ print_mask_vec16(uint8_t mask, midgard_dest_override override)
 static void
 print_mask(uint8_t mask, unsigned bits, midgard_dest_override override)
 {
+        if (bits == 8) {
+                print_mask_vec16(mask, override);
+                return;
+        }
+
         if (bits < 16) {
                 /* Shouldn't happen but with junk / out-of-spec shaders it
                  * would cause an infinite loop */
@@ -419,11 +424,6 @@ print_mask(uint8_t mask, unsigned bits, midgard_dest_override override)
                 return;
         }
 
-        if (bits == 8) {
-                print_mask_vec16(mask, override);
-                return;
-        }
-
         /* Skip 'complete' masks */
 
         if (bits >= 32 && mask == 0xFF) return;