aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/IntermediateRepresentation
diff options
context:
space:
mode:
authorFicture Seven <FICTURE7@gmail.com>2020-08-05 02:52:33 +0400
committerGitHub <noreply@github.com>2020-08-05 08:52:33 +1000
commitee22517d92c48eab9643b6fc8ce4dac2b7e95f57 (patch)
tree5df92a3e83f9daafba44ad11862683af8185ffaf /ARMeilleure/IntermediateRepresentation
parenta33dc2f4919f7fdc8ea9db41c4c70c38cedfd3df (diff)
Improve branch operations (#1442)
* Add Compare instruction * Add BranchIf instruction * Use test when BranchIf & Compare against 0 * Propagate Compare into BranchIfTrue/False use - Propagate Compare operations into their BranchIfTrue/False use and turn these into a BranchIf. - Clean up Comparison enum. * Replace BranchIfTrue/False with BranchIf * Use BranchIf in EmitPtPointerLoad - Using BranchIf early instead of BranchIfTrue/False improves LCQ and reduces the amount of work needed by the Optimizer. EmitPtPointerLoader was a/the big producer of BranchIfTrue/False. - Fix asserts firing when assembling BitwiseAnd because of type mismatch in EmitStoreExclusive. This is harmless and should not cause any diffs. * Increment PPTC interval version * Improve IRDumper for BranchIf & Compare * Use BranchIf in EmitNativeCall * Clean up * Do not emit test when immediately preceded by and
Diffstat (limited to 'ARMeilleure/IntermediateRepresentation')
-rw-r--r--ARMeilleure/IntermediateRepresentation/Comparison.cs24
-rw-r--r--ARMeilleure/IntermediateRepresentation/Instruction.cs14
2 files changed, 26 insertions, 12 deletions
diff --git a/ARMeilleure/IntermediateRepresentation/Comparison.cs b/ARMeilleure/IntermediateRepresentation/Comparison.cs
new file mode 100644
index 00000000..628ce105
--- /dev/null
+++ b/ARMeilleure/IntermediateRepresentation/Comparison.cs
@@ -0,0 +1,24 @@
+namespace ARMeilleure.IntermediateRepresentation
+{
+ enum Comparison
+ {
+ Equal = 0,
+ NotEqual = 1,
+ Greater = 2,
+ LessOrEqual = 3,
+ GreaterUI = 4,
+ LessOrEqualUI = 5,
+ GreaterOrEqual = 6,
+ Less = 7,
+ GreaterOrEqualUI = 8,
+ LessUI = 9
+ }
+
+ static class ComparisonExtensions
+ {
+ public static Comparison Invert(this Comparison comp)
+ {
+ return (Comparison)((int)comp ^ 1);
+ }
+ }
+}
diff --git a/ARMeilleure/IntermediateRepresentation/Instruction.cs b/ARMeilleure/IntermediateRepresentation/Instruction.cs
index 8ffaf3dc..c583a2f2 100644
--- a/ARMeilleure/IntermediateRepresentation/Instruction.cs
+++ b/ARMeilleure/IntermediateRepresentation/Instruction.cs
@@ -8,23 +8,13 @@ namespace ARMeilleure.IntermediateRepresentation
BitwiseNot,
BitwiseOr,
Branch,
- BranchIfFalse,
- BranchIfTrue,
+ BranchIf,
ByteSwap,
Call,
+ Compare,
CompareAndSwap,
CompareAndSwap16,
CompareAndSwap8,
- CompareEqual,
- CompareGreater,
- CompareGreaterOrEqual,
- CompareGreaterOrEqualUI,
- CompareGreaterUI,
- CompareLess,
- CompareLessOrEqual,
- CompareLessOrEqualUI,
- CompareLessUI,
- CompareNotEqual,
ConditionalSelect,
ConvertI64ToI32,
ConvertToFP,