From 4e4c9f5f5ac4373dca5177cfcecc484a476cbf36 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 11 May 2020 16:05:48 -0400 Subject: [PATCH] pan/mdg: Separately pack constants to the upper half Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/midgard_schedule.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 18c36a8d290..a365cfaf09e 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -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 */ -- 2.30.2