pan/midgard: Implement predicate->unit

This allows ALUs to select for each unit of the bundle separately.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-09-27 08:19:51 -04:00
parent 5a9a48b81a
commit 6f92288e85

View file

@ -885,6 +885,9 @@ mir_choose_instruction(
{
/* Parse the predicate */
unsigned tag = predicate->tag;
bool alu = tag == TAG_ALU_4;
unsigned unit = predicate->unit;
bool branch = alu && (unit == ALU_ENAB_BR_COMPACT);
/* Iterate to find the best instruction satisfying the predicate */
unsigned i;
@ -899,6 +902,12 @@ mir_choose_instruction(
if (predicate->exclude != ~0 && instructions[i]->dest == predicate->exclude)
continue;
if (alu && !branch && !(alu_opcode_props[instructions[i]->alu.op].props & unit))
continue;
if (branch && !instructions[i]->compact_branch)
continue;
/* Simulate in-order scheduling */
if ((signed) i < best_index)
continue;