pan/mdg: Separately pack constants to the upper half
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 11 May 2020 20:05:48 +0000 (16:05 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 May 2020 17:49:14 +0000 (17:49 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>

src/panfrost/midgard/midgard_schedule.c

index 18c36a8d290f7c718a9adacc2b52a2c1b8575d31..a365cfaf09ea76eb9db2006ab732468dcd48b8e9 100644 (file)
@@ -456,9 +456,18 @@ mir_adjust_constants(midgard_instruction *ins,
                 if (ins->src[src] != SSA_FIXED_REGISTER(REGISTER_CONSTANT))
                         continue;
 
-                if (!mir_adjust_constant(ins, src, &bundle_constant_mask,
+                /* First, try lower half (or whole for !16) */
+                if (mir_adjust_constant(ins, src, &bundle_constant_mask,
                                 comp_mapping[src], bundle_constants, false))
-                        return false;
+                        continue;
+
+                /* Next, try upper half */
+                if (mir_adjust_constant(ins, src, &bundle_constant_mask,
+                                comp_mapping[src], bundle_constants, true))
+                        continue;
+
+                /* Otherwise bail */
+                return false;
         }
 
         /* If non-destructive, we're done */