diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-03-09 19:29:34 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-10 09:29:34 +1100 |
| commit | 61d79facd1740264dadb6c62a0af21179bf6672b (patch) | |
| tree | 4e5769fb13b3dea1be5b5977c7fdad3a9d8db01f /ARMeilleure/Translation/Compiler.cs | |
| parent | e2bb5e8091125ec626fca0f1f7213463b68b54e6 (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/Translation/Compiler.cs')
| -rw-r--r-- | ARMeilleure/Translation/Compiler.cs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/ARMeilleure/Translation/Compiler.cs b/ARMeilleure/Translation/Compiler.cs index 4075a7f0..c2a2c746 100644 --- a/ARMeilleure/Translation/Compiler.cs +++ b/ARMeilleure/Translation/Compiler.cs @@ -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); - - CompiledFunction func = CodeGenerator.Generate(cctx); + CompilerContext cctx = new CompilerContext(cfg, argTypes, retType, options); - IntPtr codePtr = JitCache.Map(func); - - return Marshal.GetDelegateForFunctionPointer<T>(codePtr); + return CodeGenerator.Generate(cctx); } } }
\ No newline at end of file |
