aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/mir.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-25 15:33:56 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-26 08:37:08 -0700
commitcb6dea6b4dcb665a917c03de2a174410410af8f6 (patch)
tree22b2ae03257f91b5bb3c6a515884136551265e3f /src/panfrost/midgard/mir.c
parentb6946d35c832979833559993121d1333482092f5 (diff)
pan/midgard: Share mir_nontrivial_outmod
To be used with redundant move elimination. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/mir.c')
-rw-r--r--src/panfrost/midgard/mir.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c
index 2c2d2fc8345..d8e52982b68 100644
--- a/src/panfrost/midgard/mir.c
+++ b/src/panfrost/midgard/mir.c
@@ -140,6 +140,22 @@ mir_nontrivial_source2_mod(midgard_instruction *ins)
return mir_nontrivial_mod(src2, is_int, ins->mask);
}
+bool
+mir_nontrivial_outmod(midgard_instruction *ins)
+{
+ bool is_int = midgard_is_integer_op(ins->alu.op);
+ unsigned mod = ins->alu.outmod;
+
+ /* Type conversion is a sort of outmod */
+ if (ins->alu.dest_override != midgard_dest_override_none)
+ return true;
+
+ if (is_int)
+ return mod != midgard_outmod_int_wrap;
+ else
+ return mod != midgard_outmod_none;
+}
+
/* Checks if an index will be used as a special register -- basically, if we're
* used as the input to a non-ALU op */