From 94013c8e00ccf1bde9d02c2d86630e0df900c8e3 Mon Sep 17 00:00:00 2001 From: xperia64 Date: Mon, 28 Dec 2020 23:39:00 +0000 Subject: [PATCH] Merge ARM64 Dynarmic (#5620) * Point dynarmic to citra fork, update dynarmic to AArch64 merge branch * Enable dynarmic ARM64 support --- .gitmodules | 2 +- externals/CMakeLists.txt | 21 +++++++++------------ externals/dynarmic | 2 +- src/core/CMakeLists.txt | 2 +- src/core/core.cpp | 4 ++-- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.gitmodules b/.gitmodules index b247ccdbe..d4bc7837f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ url = https://github.com/philsquared/Catch.git [submodule "dynarmic"] path = externals/dynarmic - url = https://github.com/MerryMage/dynarmic.git + url = https://github.com/citra-emu/dynarmic.git [submodule "xbyak"] path = externals/xbyak url = https://github.com/herumi/xbyak.git diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index c3297571f..389220837 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -30,11 +30,16 @@ target_include_directories(catch-single-include INTERFACE catch/single_include) # Crypto++ add_subdirectory(cryptopp) -# Dynarmic +# Xbyak if (ARCHITECTURE_x86_64) - # Dynarmic will skip defining xbyak if it's already defined, we then define it below add_library(xbyak INTERFACE) - option(DYNARMIC_TESTS OFF) + target_include_directories(xbyak SYSTEM INTERFACE ./xbyak/xbyak) + target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES) +endif() + +# Dynarmic +if (ARCHITECTURE_x86_64 OR ARCHITECTURE_ARM64) + set(DYNARMIC_TESTS OFF) set(DYNARMIC_NO_BUNDLED_FMT ON) set(DYNARMIC_FRONTENDS "A32") add_subdirectory(dynarmic) @@ -74,14 +79,6 @@ target_include_directories(SoundTouch INTERFACE ./soundtouch/include) # Teakra add_subdirectory(teakra EXCLUDE_FROM_ALL) -# Xbyak -if (ARCHITECTURE_x86_64) - # Defined before "dynarmic" above - # add_library(xbyak INTERFACE) - target_include_directories(xbyak INTERFACE ./xbyak/xbyak) - target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES) -endif() - # Zstandard add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL) target_include_directories(libzstd_static INTERFACE ./zstd/lib) @@ -131,4 +128,4 @@ if (ENABLE_WEB_SERVICE) endif() # lodepng -add_subdirectory(lodepng) \ No newline at end of file +add_subdirectory(lodepng) diff --git a/externals/dynarmic b/externals/dynarmic index 58abdcce5..f9d84871f 160000 --- a/externals/dynarmic +++ b/externals/dynarmic @@ -1 +1 @@ -Subproject commit 58abdcce5b23ee14e4b7c0759af16cf055c563d4 +Subproject commit f9d84871fb6dd41c47945d649dc9017aa3762125 diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 133a33ef2..6ee110869 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -487,7 +487,7 @@ if (ENABLE_WEB_SERVICE) endif() endif() -if (ARCHITECTURE_x86_64) +if (ARCHITECTURE_x86_64 OR ARCHITECTURE_ARM64) target_sources(core PRIVATE arm/dynarmic/arm_dynarmic.cpp arm/dynarmic/arm_dynarmic.h diff --git a/src/core/core.cpp b/src/core/core.cpp index 6a34995fb..ee90da82f 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -13,7 +13,7 @@ #include "common/logging/log.h" #include "common/texture.h" #include "core/arm/arm_interface.h" -#ifdef ARCHITECTURE_x86_64 +#if defined(ARCHITECTURE_x86_64) || defined(ARCHITECTURE_ARM64) #include "core/arm/dynarmic/arm_dynarmic.h" #endif #include "core/arm/dyncom/arm_dyncom.h" @@ -365,7 +365,7 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, u32 system_mo *memory, *timing, [this] { PrepareReschedule(); }, system_mode, num_cores, n3ds_mode); if (Settings::values.use_cpu_jit) { -#ifdef ARCHITECTURE_x86_64 +#if defined(ARCHITECTURE_x86_64) || defined(ARCHITECTURE_ARM64) for (u32 i = 0; i < num_cores; ++i) { cpu_cores.push_back( std::make_shared(this, *memory, i, timing->GetTimer(i)));