From ae7acde91f2e48d1d82de218ed9c721aace0c226 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 24 Jul 2019 12:53:58 -0700 Subject: [PATCH] pan/midgard: Emit st_vary registers in install_registers Now that we have its registers handled normally like the rest of the IR. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_ra.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/panfrost/midgard/midgard_ra.c b/src/panfrost/midgard/midgard_ra.c index 6640433c6f9..67a1795545d 100644 --- a/src/panfrost/midgard/midgard_ra.c +++ b/src/panfrost/midgard/midgard_ra.c @@ -649,9 +649,17 @@ install_registers_instr( } case TAG_LOAD_STORE_4: { - if (OP_IS_STORE_R26(ins->load_store.op)) { - /* TODO: use ssa_args for st_vary */ - ins->load_store.reg = 0; + bool fixed = args.src0 >= SSA_FIXED_MINIMUM; + + if (OP_IS_STORE_R26(ins->load_store.op) && fixed) { + ins->load_store.reg = SSA_REG_FROM_FIXED(args.src0); + } else if (OP_IS_STORE_VARY(ins->load_store.op)) { + struct phys_reg src = index_to_reg(ctx, g, args.src0); + assert(src.reg == 26 || src.reg == 27); + + ins->load_store.reg = src.reg - 26; + + /* TODO: swizzle/mask */ } else { /* Which physical register we read off depends on * whether we are loading or storing -- think about the -- 2.30.2