pan/midgard: Remove prepacked_branch

It's an ugly hack that's no longer used.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-12-30 19:02:23 -05:00
parent 02f503ef00
commit a0d65d860d
6 changed files with 6 additions and 39 deletions

View 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;

View 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;

View 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;

View 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(" ");

View 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)

View 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