Condition.cs 683 B

1234567891011121314151617181920212223242526272829303132
  1. namespace ARMeilleure.Decoders
  2. {
  3. enum Condition
  4. {
  5. Eq = 0,
  6. Ne = 1,
  7. GeUn = 2,
  8. LtUn = 3,
  9. Mi = 4,
  10. Pl = 5,
  11. Vs = 6,
  12. Vc = 7,
  13. GtUn = 8,
  14. LeUn = 9,
  15. Ge = 10,
  16. Lt = 11,
  17. Gt = 12,
  18. Le = 13,
  19. Al = 14,
  20. Nv = 15
  21. }
  22. static class ConditionExtensions
  23. {
  24. public static Condition Invert(this Condition cond)
  25. {
  26. // Bit 0 of all conditions is basically a negation bit, so
  27. // inverting this bit has the effect of inverting the condition.
  28. return (Condition)((int)cond ^ 1);
  29. }
  30. }
  31. }