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
This commit is contained in:
gdkchan 2020-03-09 19:29:34 -03:00 committed by GitHub
parent e2bb5e8091
commit 61d79facd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 538 additions and 86 deletions

View file

@ -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;
}
}
}
}