aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Decoders/Condition.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ChocolArm64/Decoders/Condition.cs')
-rw-r--r--ChocolArm64/Decoders/Condition.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/ChocolArm64/Decoders/Condition.cs b/ChocolArm64/Decoders/Condition.cs
index d1aa5772..3f341a98 100644
--- a/ChocolArm64/Decoders/Condition.cs
+++ b/ChocolArm64/Decoders/Condition.cs
@@ -19,4 +19,14 @@ namespace ChocolArm64.Decoders
Al = 14,
Nv = 15
}
+
+ static class ConditionExtensions
+ {
+ public static Condition Invert(this Condition cond)
+ {
+ //Bit 0 of all conditions is basically a negation bit, so
+ //inverting this bit has the effect of inverting the condition.
+ return (Condition)((int)cond ^ 1);
+ }
+ }
} \ No newline at end of file