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

@ -9,11 +9,16 @@ namespace ARMeilleure.Translation
{
static class Compiler
{
public static T Compile<T>(
ControlFlowGraph cfg,
OperandType[] funcArgTypes,
OperandType funcReturnType,
CompilerOptions options)
public static T Compile<T>(ControlFlowGraph cfg, OperandType[] argTypes, OperandType retType, CompilerOptions options)
{
CompiledFunction func = CompileAndGetCf(cfg, argTypes, retType, options);
IntPtr codePtr = JitCache.Map(func);
return Marshal.GetDelegateForFunctionPointer<T>(codePtr);
}
public static CompiledFunction CompileAndGetCf(ControlFlowGraph cfg, OperandType[] argTypes, OperandType retType, CompilerOptions options)
{
Logger.StartPass(PassName.Dominance);
@ -35,13 +40,9 @@ namespace ARMeilleure.Translation
Logger.EndPass(PassName.SsaConstruction, cfg);
CompilerContext cctx = new CompilerContext(cfg, funcArgTypes, funcReturnType, options);
CompilerContext cctx = new CompilerContext(cfg, argTypes, retType, options);
CompiledFunction func = CodeGenerator.Generate(cctx);
IntPtr codePtr = JitCache.Map(func);
return Marshal.GetDelegateForFunctionPointer<T>(codePtr);
return CodeGenerator.Generate(cctx);
}
}
}