From 5e0f8e873857ce3ca3f532aff0936beb28e412c8 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 10 Jan 2023 19:16:59 -0300 Subject: 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 --- ARMeilleure/Translation/Compiler.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'ARMeilleure/Translation/Compiler.cs') 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 -- cgit v1.2.3