aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-03-09 19:29:34 -0300
committerGitHub <noreply@github.com>2020-03-10 09:29:34 +1100
commit61d79facd1740264dadb6c62a0af21179bf6672b (patch)
tree4e5769fb13b3dea1be5b5977c7fdad3a9d8db01f /ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
parente2bb5e8091125ec626fca0f1f7213463b68b54e6 (diff)
Optimize x64 loads and stores using complex addressing modes (#972)
* Optimize x64 loads and stores using complex addressing modes * This was meant to be used for testing
Diffstat (limited to 'ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs')
-rw-r--r--ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs b/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
index 1127ccd5..1dc6ad73 100644
--- a/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
+++ b/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
@@ -711,6 +711,20 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
{
operation.SetSource(index, register);
}
+ else if (source.Kind == OperandKind.Memory)
+ {
+ MemoryOperand memOp = (MemoryOperand)source;
+
+ if (memOp.BaseAddress == current.Local)
+ {
+ memOp.BaseAddress = register;
+ }
+
+ if (memOp.Index == current.Local)
+ {
+ memOp.Index = register;
+ }
+ }
}
for (int index = 0; index < operation.DestinationsCount; index++)
@@ -1011,6 +1025,20 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
{
yield return source;
}
+ else if (source.Kind == OperandKind.Memory)
+ {
+ MemoryOperand memOp = (MemoryOperand)source;
+
+ if (memOp.BaseAddress != null)
+ {
+ yield return memOp.BaseAddress;
+ }
+
+ if (memOp.Index != null)
+ {
+ yield return memOp.Index;
+ }
+ }
}
}