diff --git a/Common/Arm64Emitter.cpp b/Common/Arm64Emitter.cpp index b2ae011b56..5dd3b4d07e 100644 --- a/Common/Arm64Emitter.cpp +++ b/Common/Arm64Emitter.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include "ppsspp_config.h" + #include #include #include @@ -12,13 +14,15 @@ #include #include "base/basictypes.h" -#include "ppsspp_config.h" #include "Arm64Emitter.h" #include "MathUtil.h" #include "CommonTypes.h" +#include "CommonWindows.h" #include "CPUDetect.h" +#include "CommonWindows.h" + #ifdef IOS #include #endif @@ -322,7 +326,11 @@ void ARM64XEmitter::FlushIcacheSection(u8* start, u8* end) #if defined(IOS) // Header file says this is equivalent to: sys_icache_invalidate(start, end - start); sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start); -#elif PPSSPP_ARCH(ARM64) +#elif PPSSPP_PLATFORM(WINDOWS) +#if !PPSSPP_PLATFORM(UWP) // Not available on UWP, which is very bad! + FlushInstructionCache(GetCurrentProcess(), start, end - start); +#endif +#elif PPSSPP_ARCH(ARM64) // Code from Dolphin, contributed by the Mono project. // Don't rely on GCC's __clear_cache implementation, as it caches diff --git a/Common/ArmEmitter.cpp b/Common/ArmEmitter.cpp index 906468d635..8f11037260 100644 --- a/Common/ArmEmitter.cpp +++ b/Common/ArmEmitter.cpp @@ -15,6 +15,8 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ +#include "ppsspp_config.h" + #include "base/logging.h" #include @@ -33,6 +35,10 @@ #include "ArmEmitter.h" #include "CPUDetect.h" +#ifdef _WIN32 +#include "CommonWindows.h" +#endif + // Want it in release builds too #ifdef __ANDROID__ #undef _dbg_assert_msg_ @@ -626,14 +632,18 @@ void ARMXEmitter::FlushIcacheSection(u8 *start, u8 *end) #if defined(IOS) // Header file says this is equivalent to: sys_icache_invalidate(start, end - start); sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start); -#elif !defined(_WIN32) -#if defined(ARM) +#elif PPSSPP_PLATFORM(WINDOWS) +#if !PPSSPP_PLATFORM(UWP) // Not available on UWP, which is very bad! + FlushInstructionCache(GetCurrentProcess(), start, end - start); +#endif +#elif PPSSPP_ARCH(ARM) + #if defined(__clang__) || defined(__ANDROID__) __clear_cache(start, end); #else __builtin___clear_cache(start, end); #endif -#endif + #endif } diff --git a/Core/MIPS/ARM/ArmCompVFPU.cpp b/Core/MIPS/ARM/ArmCompVFPU.cpp index 853c14305c..a56982a0fb 100644 --- a/Core/MIPS/ARM/ArmCompVFPU.cpp +++ b/Core/MIPS/ARM/ArmCompVFPU.cpp @@ -2171,6 +2171,10 @@ namespace MIPSComp DISABLE; } +#if PPSSPP_ARCH(ARM_HARDFP) + DISABLE; +#endif + int vd = _VD; int vs = _VS; diff --git a/Core/MIPS/ARM/ArmJit.cpp b/Core/MIPS/ARM/ArmJit.cpp index fe07231f48..a117c48c9c 100644 --- a/Core/MIPS/ARM/ArmJit.cpp +++ b/Core/MIPS/ARM/ArmJit.cpp @@ -83,7 +83,7 @@ ArmJit::ArmJit(MIPSState *mips) : blocks(mips, this), gpr(mips, &js, &jo), fpr(m AllocCodeSpace(1024 * 1024 * 16); // 32MB is the absolute max because that's what an ARM branch instruction can reach, backwards and forwards. GenerateFixedCode(); - INFO_LOG(JIT, "ARM JIT initialized: %d MB of code space", GetSpaceLeft() / 1024 * 1024); + INFO_LOG(JIT, "ARM JIT initialized: %d MB of code space", GetSpaceLeft() / (1024 * 1024)); js.startDefaultPrefix = mips_->HasDefaultPrefix(); } @@ -197,6 +197,15 @@ void ArmJit::CompileDelaySlot(int flags) void ArmJit::Compile(u32 em_address) { PROFILE_THIS_SCOPE("jitc"); + + // If I keep any of these, it works on UWP for ARM! +#if PPSSPP_PLATFORM(UWP) + INFO_LOG(JIT, "Compiling at %08x", em_address); +#endif + // Sleep(1); + // Unfortunately Microsoft forgot to expose FlushInstructionCache to UWP applications... even though they expose + // the ability to generate code :( This will work great on x86 but on ARM we're out of luck. + if (GetSpaceLeft() < 0x10000 || blocks.IsFull()) { ClearCache(); }