pan/midgard: Remove prepacked_branch
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 31 Dec 2019 00:02:23 +0000 (19:02 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 31 Dec 2019 03:26:24 +0000 (03:26 +0000)
It's an ugly hack that's no longer used.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/compiler.h
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_emit.c
src/panfrost/midgard/midgard_print.c
src/panfrost/midgard/midgard_schedule.c
src/panfrost/midgard/mir.c

index 92712dde92b69c429f86933c1ea2afb4e400e089..85b7a87405e453ddb025630ac0bdcc20c3987c04 100644 (file)
@@ -109,7 +109,6 @@ typedef struct midgard_instruction {
 
         bool compact_branch;
         bool writeout;
-        bool prepacked_branch;
 
         /* Kind of a hack, but hint against aggressive DCE */
         bool dont_eliminate;
index 412e5b01c5b3e5bf1216e1ccdde5252981b538c7..9afe96f0cfc12bb95493cca3f3d81e65457d754a 100644 (file)
@@ -218,35 +218,6 @@ M_STORE(st_vary_32);
 M_LOAD(ld_cubemap_coords);
 M_LOAD(ld_compute_id);
 
-static midgard_instruction
-v_alu_br_compact_cond(midgard_jmp_writeout_op op, unsigned tag, signed offset, unsigned cond)
-{
-        midgard_branch_cond branch = {
-                .op = op,
-                .dest_tag = tag,
-                .offset = offset,
-                .cond = cond
-        };
-
-        uint16_t compact;
-        memcpy(&compact, &branch, sizeof(branch));
-
-        midgard_instruction ins = {
-                .type = TAG_ALU_4,
-                .unit = ALU_ENAB_BR_COMPACT,
-                .prepacked_branch = true,
-                .compact_branch = true,
-                .br_compact = compact,
-                .dest = ~0,
-                .src = { ~0, ~0, ~0, ~0 },
-        };
-
-        if (op == midgard_jmp_writeout_op_writeout)
-                ins.writeout = true;
-
-        return ins;
-}
-
 static midgard_instruction
 v_branch(bool conditional, bool invert)
 {
@@ -2459,7 +2430,6 @@ emit_loop(struct compiler_context *ctx, nir_loop *nloop)
                 mir_foreach_instr_in_block(block, ins) {
                         if (ins->type != TAG_ALU_4) continue;
                         if (!ins->compact_branch) continue;
-                        if (ins->prepacked_branch) continue;
 
                         /* We found a branch -- check the type to see if we need to do anything */
                         if (ins->branch.target_type != TARGET_BREAK) continue;
@@ -2752,8 +2722,6 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
 
                                 if (!midgard_is_branch_unit(ins->unit)) continue;
 
-                                if (ins->prepacked_branch) continue;
-
                                 /* Parse some basic branch info */
                                 bool is_compact = ins->unit == ALU_ENAB_BR_COMPACT;
                                 bool is_conditional = ins->branch.conditional;
index 2be6ecedc14e7125c6544881397c7a702227eff9..d5aba7f8612010405e7d1273f7980f012ad77728 100644 (file)
@@ -325,7 +325,7 @@ emit_alu_bundle(compiler_context *ctx,
                 midgard_instruction *ins = bundle->instructions[i];
 
                 /* Check if this instruction has registers */
-                if (ins->compact_branch || ins->prepacked_branch) continue;
+                if (ins->compact_branch) continue;
 
                 /* Otherwise, just emit the registers */
                 uint16_t reg_word = 0;
index 4f3a52ebb915de4450891a09c71ad80aeda3dd38..227b88c7055738576744c3f978a87422d068e3b8 100644 (file)
@@ -112,7 +112,7 @@ mir_print_instruction(midgard_instruction *ins)
                         "goto", "break", "continue", "discard"
                 };
 
-                if (ins->compact_branch && !ins->prepacked_branch)
+                if (ins->compact_branch)
                         name = branch_target_names[ins->branch.target_type];
 
                 if (ins->unit)
@@ -140,7 +140,7 @@ mir_print_instruction(midgard_instruction *ins)
                 assert(0);
         }
 
-        if (ins->invert || (ins->compact_branch && !ins->prepacked_branch && ins->branch.invert_conditional))
+        if (ins->invert || (ins->compact_branch && ins->branch.invert_conditional))
                 printf(".not");
 
         printf(" ");
index 9ee1f3b77c8618cbac931ce55d02eea9f4d7e473..d4239157ead1e0d62cefb1790ec46c17610a8afa 100644 (file)
@@ -551,7 +551,7 @@ mir_choose_instruction(
                         continue;
 
                 bool conditional = alu && !branch && OP_IS_CSEL(instructions[i]->alu.op);
-                conditional |= (branch && !instructions[i]->prepacked_branch && instructions[i]->branch.conditional);
+                conditional |= (branch && instructions[i]->branch.conditional);
 
                 if (conditional && no_cond)
                         continue;
@@ -873,7 +873,7 @@ mir_schedule_alu(
         mir_update_worklist(worklist, len, instructions, branch);
         bool writeout = branch && branch->writeout;
 
-        if (branch && !branch->prepacked_branch && branch->branch.conditional) {
+        if (branch && branch->branch.conditional) {
                 midgard_instruction *cond = mir_schedule_condition(ctx, &predicate, worklist, len, instructions, branch);
 
                 if (cond->unit == UNIT_VADD)
index eba772e13b1ac82c180369a97091889d1d81eb9e..f892094afced63bf15959b0290f5d67671782818 100644 (file)
@@ -482,7 +482,7 @@ mir_bytemask_of_read_components(midgard_instruction *ins, unsigned node)
                         return 0xFFFF;
 
                 /* Conditional branches read one 32-bit component = 4 bytes (TODO: multi branch??) */
-                if (ins->compact_branch && !ins->prepacked_branch && ins->branch.conditional && (i == 0))
+                if (ins->compact_branch && ins->branch.conditional && (i == 0))
                         return 0xF;
 
                 /* ALU ops act componentwise so we need to pay attention to