pan/midgard: Emit st_vary registers in install_registers
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 24 Jul 2019 19:53:58 +0000 (12:53 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 25 Jul 2019 13:37:22 +0000 (06:37 -0700)
Now that we have its registers handled normally like the rest of the IR.

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

index 6640433c6f91174e081f10c4cb3882a7e103fd5e..67a1795545d1b6d04b6c0755d4aa17f7a45ae1c3 100644 (file)
@@ -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