From 8397fd679189ac5276102a5289a5f568c133be6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 29 Apr 2024 11:13:35 +0200 Subject: [PATCH] Also disable the GPU JIT tests on ARM64, not applicable --- Common/CPUDetect.cpp | 28 ++++++++++++++++++++++++++++ Common/CPUDetect.h | 2 ++ GPU/Software/Sampler.cpp | 1 + UI/DebugOverlay.cpp | 1 + UI/DevScreens.cpp | 28 ---------------------------- UI/DevScreens.h | 1 - unittest/TestArm64Emitter.cpp | 2 +- unittest/TestSoftwareGPUJit.cpp | 10 ++++++++++ unittest/UnitTest.cpp | 5 +++++ 9 files changed, 48 insertions(+), 30 deletions(-) diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index 057a892390..2cbe99b4cf 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -542,3 +542,31 @@ std::string CPUInfo::Summarize() { } #endif // PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) + +const char *GetCompilerABI() { +#if PPSSPP_ARCH(ARMV7) + return "armeabi-v7a"; +#elif PPSSPP_ARCH(ARM) + return "armeabi"; +#elif PPSSPP_ARCH(ARM64) + return "arm64"; +#elif PPSSPP_ARCH(X86) + return "x86"; +#elif PPSSPP_ARCH(AMD64) + return "x86-64"; +#elif PPSSPP_ARCH(RISCV64) + //https://github.com/riscv/riscv-toolchain-conventions#cc-preprocessor-definitions + //https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md#abi-related-preprocessor-definitions + #if defined(__riscv_float_abi_single) + return "lp64f"; + #elif defined(__riscv_float_abi_double) + return "lp64d"; + #elif defined(__riscv_float_abi_quad) + return "lp64q"; + #elif defined(__riscv_float_abi_soft) + return "lp64"; + #endif +#else + return "other"; +#endif +} diff --git a/Common/CPUDetect.h b/Common/CPUDetect.h index e4f0a567a4..20bb523415 100644 --- a/Common/CPUDetect.h +++ b/Common/CPUDetect.h @@ -161,3 +161,5 @@ private: }; extern CPUInfo cpu_info; + +const char *GetCompilerABI(); diff --git a/GPU/Software/Sampler.cpp b/GPU/Software/Sampler.cpp index 60afbd39a9..9dee5a656a 100644 --- a/GPU/Software/Sampler.cpp +++ b/GPU/Software/Sampler.cpp @@ -181,6 +181,7 @@ NearestFunc SamplerJitCache::GetByID(const SamplerID &id, size_t key, BinManager } if (!binner) { + printf("No binner, can't compile\n"); // Can't compile, let's try to do it later when there's an opportunity. compileQueue_.insert(id); return nullptr; diff --git a/UI/DebugOverlay.cpp b/UI/DebugOverlay.cpp index 6a54cc882b..9e402144ac 100644 --- a/UI/DebugOverlay.cpp +++ b/UI/DebugOverlay.cpp @@ -2,6 +2,7 @@ #include "Common/GPU/thin3d.h" #include "Common/System/System.h" #include "Common/Data/Text/I18n.h" +#include "Common/CPUDetect.h" #include "Core/MIPS/MIPS.h" #include "Core/HW/Display.h" #include "Core/FrameTiming.h" diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 3c5aea442b..0d614b61ff 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -452,34 +452,6 @@ UI::EventReturn JitDebugScreen::OnDisableAll(UI::EventParams &e) { return UI::EVENT_DONE; } -const char *GetCompilerABI() { -#if PPSSPP_ARCH(ARMV7) - return "armeabi-v7a"; -#elif PPSSPP_ARCH(ARM) - return "armeabi"; -#elif PPSSPP_ARCH(ARM64) - return "arm64"; -#elif PPSSPP_ARCH(X86) - return "x86"; -#elif PPSSPP_ARCH(AMD64) - return "x86-64"; -#elif PPSSPP_ARCH(RISCV64) - //https://github.com/riscv/riscv-toolchain-conventions#cc-preprocessor-definitions - //https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md#abi-related-preprocessor-definitions - #if defined(__riscv_float_abi_single) - return "lp64f"; - #elif defined(__riscv_float_abi_double) - return "lp64d"; - #elif defined(__riscv_float_abi_quad) - return "lp64q"; - #elif defined(__riscv_float_abi_soft) - return "lp64"; - #endif -#else - return "other"; -#endif -} - void SystemInfoScreen::update() { TabbedUIDialogScreenWithGameBackground::update(); g_OSD.NudgeSidebar(); diff --git a/UI/DevScreens.h b/UI/DevScreens.h index 0321aab1a3..29fbf5690b 100644 --- a/UI/DevScreens.h +++ b/UI/DevScreens.h @@ -264,6 +264,5 @@ protected: }; void DrawProfile(UIContext &ui); -const char *GetCompilerABI(); void AddOverlayList(UI::ViewGroup *items, ScreenManager *screenManager); diff --git a/unittest/TestArm64Emitter.cpp b/unittest/TestArm64Emitter.cpp index a795cfbb2f..66d373f16b 100644 --- a/unittest/TestArm64Emitter.cpp +++ b/unittest/TestArm64Emitter.cpp @@ -282,7 +282,7 @@ bool TestArm64Emitter() { emitter.EORI2R(X1, X3, 0x3F0000003F0, INVALID_REG); RET(CheckLast(emitter, "d21c1461 eor x1, x3, #0x3f0000003f0")); - printf("yay!\n"); + printf("ARM64 emitter test completed!\n"); //emitter.ANDI2R(W1, W3, 0xFF00FF00FF00FF00ULL, INVALID_REG); //RET(CheckLast(emitter, "00000000 and x1, x3, 0xFF00FF00FF00FF00")); diff --git a/unittest/TestSoftwareGPUJit.cpp b/unittest/TestSoftwareGPUJit.cpp index 5d7c6946d4..ab2f5ff73c 100644 --- a/unittest/TestSoftwareGPUJit.cpp +++ b/unittest/TestSoftwareGPUJit.cpp @@ -24,6 +24,7 @@ #include "GPU/Software/SoftGpu.h" static bool TestSamplerJit() { +#if PPSSPP_ARCH(AMD64) using namespace Sampler; SamplerJitCache *cache = new SamplerJitCache(); BinManager binner; @@ -108,9 +109,14 @@ static bool TestSamplerJit() { delete cache; return successes == count && !HitAnyAsserts(); +#else + // Don't test sampler jit, not supported. + return true; +#endif } static bool TestPixelJit() { +#if PPSSPP_ARCH(AMD64) using namespace Rasterizer; PixelJitCache *cache = new PixelJitCache(); BinManager binner; @@ -159,6 +165,10 @@ static bool TestPixelJit() { delete [] zb_data; delete cache; return successes == count && !HitAnyAsserts(); +#else + // Not yet supported + return true; +#endif } bool TestSoftwareGPUJit() { diff --git a/unittest/UnitTest.cpp b/unittest/UnitTest.cpp index ec2d0f5b94..0fa08b8ed8 100644 --- a/unittest/UnitTest.cpp +++ b/unittest/UnitTest.cpp @@ -1061,6 +1061,10 @@ TestItem availableTests[] = { int main(int argc, const char *argv[]) { SetCurrentThreadName("UnitTest"); + printf("CPU name: %s\n", cpu_info.cpu_string); + printf("ABI: %s\n", GetCompilerABI()); + + // In case we're on ARM, assume these are available. cpu_info.bNEON = true; cpu_info.bVFP = true; cpu_info.bVFPv3 = true; @@ -1096,6 +1100,7 @@ int main(int argc, const char *argv[]) { printf("%d tests passed.\n", passes); } if (fails > 0) { + printf("%d tests failed!\n", fails); return 2; } } else if (testFunc == nullptr) {