diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-05 11:22:49 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-05 11:22:49 -0700 |
commit | 3db49491978a72eaea8b4735f0ba805dbc87b7d7 (patch) | |
tree | 8dba255e59c1eea851abb390cbd6e42014c76a50 | |
parent | 28697583557e37e3dec95aa043411594e3c25623 (diff) |
pan/midgard: Extend SSA concurrency checks to other args
No glmark changes, but this seems like a good idea.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/panfrost/midgard/midgard_schedule.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index f59ef260d36..f69e86e2f46 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -72,23 +72,22 @@ can_run_concurrent_ssa(midgard_instruction *first, midgard_instruction *second) int source_mask = first->mask; /* As long as the second doesn't read from the first, we're okay */ - if (second->ssa_args.src[0] == source) { - if (first->type == TAG_ALU_4) { - /* Figure out which components we just read from */ - - int q = second->alu.src1; - midgard_vector_alu_src *m = (midgard_vector_alu_src *) &q; + for (unsigned i = 0; i < ARRAY_SIZE(second->ssa_args.src); ++i) { + if (second->ssa_args.src[i] != source) + continue; - /* Check if there are components in common, and fail if so */ - if (swizzle_to_access_mask(m->swizzle) & source_mask) - return false; - } else + if (first->type != TAG_ALU_4) return false; - } + /* Figure out which components we just read from */ - if (second->ssa_args.src[1] == source) - return false; + int q = (i == 0) ? second->alu.src1 : second->alu.src2; + midgard_vector_alu_src *m = (midgard_vector_alu_src *) &q; + + /* Check if there are components in common, and fail if so */ + if (swizzle_to_access_mask(m->swizzle) & source_mask) + return false; + } /* Otherwise, it's safe in that regard. Another data hazard is both * writing to the same place, of course */ |