diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2023-01-10 19:16:59 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-10 19:16:59 -0300 |
| commit | 5e0f8e873857ce3ca3f532aff0936beb28e412c8 (patch) | |
| tree | 576e5110c076b7d1f4d94e608ee21493f5b48879 /ARMeilleure/Translation/Compiler.cs | |
| parent | d16288a2a87f0979df30ba69d4fe10660177b6ac (diff) | |
Implement JIT Arm64 backend (#4114)
* Implement JIT Arm64 backend
* PPTC version bump
* Address some feedback from Arm64 JIT PR
* Address even more PR feedback
* Remove unused IsPageAligned function
* Sync Qc flag before calls
* Fix comment and remove unused enum
* Address riperiperi PR feedback
* Delete Breakpoint IR instruction that was only implemented for Arm64
Diffstat (limited to 'ARMeilleure/Translation/Compiler.cs')
| -rw-r--r-- | ARMeilleure/Translation/Compiler.cs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/ARMeilleure/Translation/Compiler.cs b/ARMeilleure/Translation/Compiler.cs index 817bd487..d4aa5cd9 100644 --- a/ARMeilleure/Translation/Compiler.cs +++ b/ARMeilleure/Translation/Compiler.cs @@ -1,8 +1,9 @@ using ARMeilleure.CodeGen; using ARMeilleure.CodeGen.Optimizations; -using ARMeilleure.CodeGen.X86; using ARMeilleure.Diagnostics; using ARMeilleure.IntermediateRepresentation; +using System; +using System.Runtime.InteropServices; namespace ARMeilleure.Translation { @@ -12,7 +13,8 @@ namespace ARMeilleure.Translation ControlFlowGraph cfg, OperandType[] argTypes, OperandType retType, - CompilerOptions options) + CompilerOptions options, + Architecture target) { CompilerContext cctx = new(cfg, argTypes, retType, options); @@ -49,7 +51,18 @@ namespace ARMeilleure.Translation Logger.EndPass(PassName.RegisterToLocal, cfg); } - return CodeGenerator.Generate(cctx); + if (target == Architecture.X64) + { + return CodeGen.X86.CodeGenerator.Generate(cctx); + } + else if (target == Architecture.Arm64) + { + return CodeGen.Arm64.CodeGenerator.Generate(cctx); + } + else + { + throw new NotImplementedException(target.ToString()); + } } } }
\ No newline at end of file |
