diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-26 11:52:30 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-30 10:35:09 -0700 |
commit | c45487b7705ab5176bab4f46537e6fcb61c9442e (patch) | |
tree | 9452863a704b8be9d7bef11e25b35814b51122ad /src/panfrost/midgard/mir.c | |
parent | 2d2abb08d0eaeb7bf25655bdff4ea8dccee9a504 (diff) |
pan/midgard: Extract simple source mod check
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/mir.c')
-rw-r--r-- | src/panfrost/midgard/mir.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c index 2d100728724..225b0680f3f 100644 --- a/src/panfrost/midgard/mir.c +++ b/src/panfrost/midgard/mir.c @@ -108,7 +108,7 @@ mir_single_use(compiler_context *ctx, unsigned value) return mir_use_count(ctx, value) <= 1; } -bool +static bool mir_nontrivial_raw_mod(midgard_vector_alu_src src, bool is_int) { if (is_int) @@ -133,6 +133,7 @@ mir_nontrivial_mod(midgard_vector_alu_src src, bool is_int, unsigned mask) return false; } + bool mir_nontrivial_source2_mod(midgard_instruction *ins) { @@ -145,6 +146,17 @@ mir_nontrivial_source2_mod(midgard_instruction *ins) } bool +mir_nontrivial_source2_mod_simple(midgard_instruction *ins) +{ + bool is_int = midgard_is_integer_op(ins->alu.op); + + midgard_vector_alu_src src2 = + vector_alu_from_unsigned(ins->alu.src2); + + return mir_nontrivial_raw_mod(src2, is_int) && !src2.half; +} + +bool mir_nontrivial_outmod(midgard_instruction *ins) { bool is_int = midgard_is_integer_op(ins->alu.op); |