From a68ddd0a8d2fa7a7e4e23c467bd0a34a105c9a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 12 Apr 2022 22:56:05 +0200 Subject: [PATCH] Merge separate NEON functions into the normal functions. We no longer support non-NEON ARM. It's nice also to have the NEON and SSE implementations "close" to each other, easier to port optimizations back and forth etc. --- CMakeLists.txt | 7 - Common/Common.vcxproj | 11 - Common/Common.vcxproj.filters | 6 - Common/Data/Convert/ColorConv.cpp | 102 +++++-- Common/Data/Convert/ColorConv.h | 38 +-- Common/Data/Convert/ColorConvNEON.cpp | 118 --------- Common/Data/Convert/ColorConvNEON.h | 24 -- Core/Core.vcxproj | 20 -- Core/Core.vcxproj.filters | 6 - Core/Util/AudioFormat.cpp | 61 +++-- Core/Util/AudioFormat.h | 13 +- Core/Util/AudioFormatNEON.cpp | 78 ------ Core/Util/AudioFormatNEON.h | 22 -- GPU/Common/TextureDecoder.cpp | 336 ++++++++++++++++++++---- GPU/Common/TextureDecoder.h | 47 ++-- GPU/Common/TextureDecoderNEON.cpp | 295 --------------------- GPU/Common/TextureDecoderNEON.h | 27 -- GPU/D3D11/TextureCacheD3D11.cpp | 2 - GPU/Directx9/TextureCacheDX9.cpp | 1 - GPU/GLES/TextureCacheGLES.cpp | 2 - GPU/GPU.vcxproj | 20 -- GPU/GPU.vcxproj.filters | 6 - GPU/GPUCommon.cpp | 1 - GPU/Vulkan/TextureCacheVulkan.cpp | 1 - UI/NativeApp.cpp | 2 - UWP/CommonUWP/CommonUWP.vcxproj | 4 +- UWP/CommonUWP/CommonUWP.vcxproj.filters | 4 +- UWP/CoreUWP/CoreUWP.vcxproj | 4 +- UWP/CoreUWP/CoreUWP.vcxproj.filters | 8 +- UWP/GPU_UWP/GPU_UWP.vcxproj | 4 +- UWP/GPU_UWP/GPU_UWP.vcxproj.filters | 4 +- android/jni/Android.mk | 6 - libretro/Makefile.common | 10 +- unittest/UnitTest.cpp | 2 - 34 files changed, 437 insertions(+), 855 deletions(-) delete mode 100644 Common/Data/Convert/ColorConvNEON.cpp delete mode 100644 Common/Data/Convert/ColorConvNEON.h delete mode 100644 Core/Util/AudioFormatNEON.cpp delete mode 100644 Core/Util/AudioFormatNEON.h delete mode 100644 GPU/Common/TextureDecoderNEON.cpp delete mode 100644 GPU/Common/TextureDecoderNEON.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 01a5fd8c77..7f77287304 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,7 +433,6 @@ set(CommonARM Common/ArmCPUDetect.cpp Common/ArmEmitter.h Common/ArmEmitter.cpp - Common/Data/Convert/ColorConvNEON.cpp ) source_group(ARM FILES ${CommonARM}) @@ -1515,9 +1514,6 @@ if(WIN32) list(APPEND GPU_IMPLS ${GPU_D3D9} ${GPU_D3D11}) endif() -if(ARMV7 OR ARM64) - set(GPU_NEON GPU/Common/TextureDecoderNEON.cpp) -endif() set(GPU_SOURCES ${GPU_IMPLS} ${GPU_NEON} @@ -1976,8 +1972,6 @@ add_library(${CoreLibName} ${CoreLinkType} Core/ThreadPools.h Core/Util/AudioFormat.cpp Core/Util/AudioFormat.h - Core/Util/AudioFormatNEON.cpp - Core/Util/AudioFormatNEON.h Core/Util/GameManager.cpp Core/Util/GameManager.h Core/Util/PortManager.cpp @@ -1986,7 +1980,6 @@ add_library(${CoreLibName} ${CoreLinkType} Core/Util/BlockAllocator.h Core/Util/PPGeDraw.cpp Core/Util/PPGeDraw.h - ${CORE_NEON} ${GPU_SOURCES} ext/disarm.cpp ${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index 4ea9625d78..2de108081d 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -476,7 +476,6 @@ - @@ -814,16 +813,6 @@ - - true - true - true - false - false - true - false - false - diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index 5e8ec13477..e8306ae9f3 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -374,9 +374,6 @@ GPU - - Data\Convert - Data\Convert @@ -768,9 +765,6 @@ GPU - - Data\Convert - Data\Convert diff --git a/Common/Data/Convert/ColorConv.cpp b/Common/Data/Convert/ColorConv.cpp index a13bdc0e00..489a3f172f 100644 --- a/Common/Data/Convert/ColorConv.cpp +++ b/Common/Data/Convert/ColorConv.cpp @@ -18,8 +18,6 @@ #include "ppsspp_config.h" #include "Common/Data/Convert/ColorConv.h" #include "Common/Data/Convert/SmallDataConvert.h" -// NEON is in a separate file so that it can be compiled with a runtime check. -#include "Common/Data/Convert/ColorConvNEON.h" #include "Common/Common.h" #include "Common/CPUDetect.h" @@ -28,6 +26,14 @@ #include #endif +#if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) +#include +#else +#include +#endif +#endif + inline u16 RGBA8888toRGB565(u32 px) { return ((px >> 3) & 0x001F) | ((px >> 5) & 0x07E0) | ((px >> 8) & 0xF800); } @@ -134,8 +140,6 @@ void convert5551_dx9(u16* data, u32* out, int width, int l, int u) { } } - - void ConvertBGRA8888ToRGBA8888(u32 *dst, const u32 *src, u32 numPixels) { #ifdef _M_SSE const __m128i maskGA = _mm_set1_epi32(0xFF00FF00); @@ -540,7 +544,7 @@ void ConvertRGB565ToBGRA8888(u32 *dst, const u16 *src, u32 numPixels) { } } -void ConvertRGBA4444ToABGR4444Basic(u16 *dst, const u16 *src, u32 numPixels) { +void ConvertRGBA4444ToABGR4444(u16 *dst, const u16 *src, u32 numPixels) { #ifdef _M_SSE const __m128i mask0040 = _mm_set1_epi16(0x00F0); @@ -560,6 +564,28 @@ void ConvertRGBA4444ToABGR4444Basic(u16 *dst, const u16 *src, u32 numPixels) { } // The remainder is done in chunks of 2, SSE was chunks of 8. u32 i = sseChunks * 8 / 2; +#elif PPSSPP_ARCH(ARM_NEON) + const uint16x8_t mask0040 = vdupq_n_u16(0x00F0); + + if (((uintptr_t)dst & 15) == 0 && ((uintptr_t)src & 15) == 0) { + u32 simdable = (numPixels / 8) * 8; + for (u32 i = 0; i < simdable; i += 8) { + uint16x8_t c = vld1q_u16(src); + + const uint16x8_t a = vshrq_n_u16(c, 12); + const uint16x8_t b = vandq_u16(vshrq_n_u16(c, 4), mask0040); + const uint16x8_t g = vshlq_n_u16(vandq_u16(c, mask0040), 4); + const uint16x8_t r = vshlq_n_u16(c, 12); + + uint16x8_t res = vorrq_u16(vorrq_u16(r, g), vorrq_u16(b, a)); + vst1q_u16(dst, res); + + src += 8; + dst += 8; + } + numPixels -= simdable; + } + u32 i = 0; // already moved the pointers forward #else u32 i = 0; #endif @@ -584,7 +610,7 @@ void ConvertRGBA4444ToABGR4444Basic(u16 *dst, const u16 *src, u32 numPixels) { } } -void ConvertRGBA5551ToABGR1555Basic(u16 *dst, const u16 *src, u32 numPixels) { +void ConvertRGBA5551ToABGR1555(u16 *dst, const u16 *src, u32 numPixels) { #ifdef _M_SSE const __m128i maskB = _mm_set1_epi16(0x003E); const __m128i maskG = _mm_set1_epi16(0x07C0); @@ -605,6 +631,29 @@ void ConvertRGBA5551ToABGR1555Basic(u16 *dst, const u16 *src, u32 numPixels) { } // The remainder is done in chunks of 2, SSE was chunks of 8. u32 i = sseChunks * 8 / 2; +#elif PPSSPP_ARCH(ARM_NEON) + const uint16x8_t maskB = vdupq_n_u16(0x003E); + const uint16x8_t maskG = vdupq_n_u16(0x07C0); + + if (((uintptr_t)dst & 15) == 0 && ((uintptr_t)src & 15) == 0) { + u32 simdable = (numPixels / 8) * 8; + for (u32 i = 0; i < simdable; i += 8) { + uint16x8_t c = vld1q_u16(src); + + const uint16x8_t a = vshrq_n_u16(c, 15); + const uint16x8_t b = vandq_u16(vshrq_n_u16(c, 9), maskB); + const uint16x8_t g = vandq_u16(vshlq_n_u16(c, 1), maskG); + const uint16x8_t r = vshlq_n_u16(c, 11); + + uint16x8_t res = vorrq_u16(vorrq_u16(r, g), vorrq_u16(b, a)); + vst1q_u16(dst, res); + + src += 8; + dst += 8; + } + numPixels -= simdable; + } + u32 i = 0; #else u32 i = 0; #endif @@ -629,7 +678,7 @@ void ConvertRGBA5551ToABGR1555Basic(u16 *dst, const u16 *src, u32 numPixels) { } } -void ConvertRGB565ToBGR565Basic(u16 *dst, const u16 *src, u32 numPixels) { +void ConvertRGB565ToBGR565(u16 *dst, const u16 *src, u32 numPixels) { #ifdef _M_SSE const __m128i maskG = _mm_set1_epi16(0x07E0); @@ -648,6 +697,28 @@ void ConvertRGB565ToBGR565Basic(u16 *dst, const u16 *src, u32 numPixels) { } // The remainder is done in chunks of 2, SSE was chunks of 8. u32 i = sseChunks * 8 / 2; +#elif PPSSPP_ARCH(ARM_NEON) + const uint16x8_t maskG = vdupq_n_u16(0x07E0); + + if (((uintptr_t)dst & 15) == 0 && ((uintptr_t)src & 15) == 0) { + u32 simdable = (numPixels / 8) * 8; + for (u32 i = 0; i < simdable; i += 8) { + uint16x8_t c = vld1q_u16(src); + + const uint16x8_t b = vshrq_n_u16(c, 11); + const uint16x8_t g = vandq_u16(c, maskG); + const uint16x8_t r = vshlq_n_u16(c, 11); + + uint16x8_t res = vorrq_u16(vorrq_u16(r, g), b); + vst1q_u16(dst, res); + + src += 8; + dst += 8; + } + numPixels -= simdable; + } + + u32 i = 0; #else u32 i = 0; #endif @@ -684,20 +755,3 @@ void ConvertBGRA5551ToABGR1555(u16 *dst, const u16 *src, u32 numPixels) { dst[i] = (c >> 15) | (c << 1); } } - -// Reuse the logic from the header - if these aren't defined, we need externs. -#ifndef ConvertRGBA4444ToABGR4444 -Convert16bppTo16bppFunc ConvertRGBA4444ToABGR4444 = &ConvertRGBA4444ToABGR4444Basic; -Convert16bppTo16bppFunc ConvertRGBA5551ToABGR1555 = &ConvertRGBA5551ToABGR1555Basic; -Convert16bppTo16bppFunc ConvertRGB565ToBGR565 = &ConvertRGB565ToBGR565Basic; -#endif - -void SetupColorConv() { -#if PPSSPP_ARCH(ARM_NEON) && !PPSSPP_ARCH(ARM64) - if (cpu_info.bNEON) { - ConvertRGBA4444ToABGR4444 = &ConvertRGBA4444ToABGR4444NEON; - ConvertRGBA5551ToABGR1555 = &ConvertRGBA5551ToABGR1555NEON; - ConvertRGB565ToBGR565 = &ConvertRGB565ToBGR565NEON; - } -#endif -} diff --git a/Common/Data/Convert/ColorConv.h b/Common/Data/Convert/ColorConv.h index e695f3ce8f..7ba629c637 100644 --- a/Common/Data/Convert/ColorConv.h +++ b/Common/Data/Convert/ColorConv.h @@ -19,9 +19,6 @@ #include "ppsspp_config.h" #include "Common/CommonTypes.h" -#include "Common/Data/Convert/ColorConvNEON.h" - -void SetupColorConv(); inline u8 Convert4To8(u8 v) { // Swizzle bits: 00001234 -> 12341234 @@ -103,11 +100,6 @@ void convert5551_dx9(u16* data, u32* out, int width, int l, int u); // TODO: Need to revisit the naming convention of these. Seems totally backwards // now that we've standardized on Draw::DataFormat. -typedef void (*Convert16bppTo16bppFunc)(u16 *dst, const u16 *src, u32 numPixels); -typedef void (*Convert16bppTo32bppFunc)(u32 *dst, const u16 *src, u32 numPixels); -typedef void (*Convert32bppTo16bppFunc)(u16 *dst, const u32 *src, u32 numPixels); -typedef void (*Convert32bppTo32bppFunc)(u32 *dst, const u32 *src, u32 numPixels); - void ConvertBGRA8888ToRGBA8888(u32 *dst, const u32 *src, u32 numPixels); #define ConvertRGBA8888ToBGRA8888 ConvertBGRA8888ToRGBA8888 void ConvertBGRA8888ToRGB888(u8 *dst, const u32 *src, u32 numPixels); @@ -133,31 +125,7 @@ void ConvertRGBA4444ToBGRA8888(u32 *dst, const u16 *src, u32 numPixels); void ConvertRGBA5551ToBGRA8888(u32 *dst, const u16 *src, u32 numPixels); void ConvertRGB565ToBGRA8888(u32 *dst, const u16 *src, u32 numPixels); -void ConvertRGBA4444ToABGR4444Basic(u16 *dst, const u16 *src, u32 numPixels); -void ConvertRGBA5551ToABGR1555Basic(u16 *dst, const u16 *src, u32 numPixels); -void ConvertRGB565ToBGR565Basic(u16 *dst, const u16 *src, u32 numPixels); +void ConvertRGBA4444ToABGR4444(u16 *dst, const u16 *src, u32 numPixels); +void ConvertRGBA5551ToABGR1555(u16 *dst, const u16 *src, u32 numPixels); +void ConvertRGB565ToBGR565(u16 *dst, const u16 *src, u32 numPixels); void ConvertBGRA5551ToABGR1555(u16 *dst, const u16 *src, u32 numPixels); - -#if PPSSPP_ARCH(ARM64) -#define ConvertRGBA4444ToABGR4444 ConvertRGBA4444ToABGR4444NEON -#elif !PPSSPP_ARCH(ARM) -#define ConvertRGBA4444ToABGR4444 ConvertRGBA4444ToABGR4444Basic -#else -extern Convert16bppTo16bppFunc ConvertRGBA4444ToABGR4444; -#endif - -#if PPSSPP_ARCH(ARM64) -#define ConvertRGBA5551ToABGR1555 ConvertRGBA5551ToABGR1555NEON -#elif !PPSSPP_ARCH(ARM) -#define ConvertRGBA5551ToABGR1555 ConvertRGBA5551ToABGR1555Basic -#else -extern Convert16bppTo16bppFunc ConvertRGBA5551ToABGR1555; -#endif - -#if PPSSPP_ARCH(ARM64) -#define ConvertRGB565ToBGR565 ConvertRGB565ToBGR565NEON -#elif !PPSSPP_ARCH(ARM) -#define ConvertRGB565ToBGR565 ConvertRGB565ToBGR565Basic -#else -extern Convert16bppTo16bppFunc ConvertRGB565ToBGR565; -#endif diff --git a/Common/Data/Convert/ColorConvNEON.cpp b/Common/Data/Convert/ColorConvNEON.cpp deleted file mode 100644 index c071e34e44..0000000000 --- a/Common/Data/Convert/ColorConvNEON.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) 2015- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#include "ppsspp_config.h" -#if PPSSPP_ARCH(ARM_NEON) - -#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) -#include -#else -#include -#endif -#include "Common/Data/Convert/ColorConvNEON.h" -#include "Common/CommonTypes.h" -#include "Common/CPUDetect.h" - -// TODO: More NEON color conversion funcs. - -void ConvertRGBA4444ToABGR4444NEON(u16 *dst, const u16 *src, u32 numPixels) { - const uint16x8_t mask0040 = vdupq_n_u16(0x00F0); - - if (((uintptr_t)dst & 15) == 0 && ((uintptr_t)src & 15) == 0) { - u32 simdable = (numPixels / 8) * 8; - for (u32 i = 0; i < simdable; i += 8) { - uint16x8_t c = vld1q_u16(src); - - const uint16x8_t a = vshrq_n_u16(c, 12); - const uint16x8_t b = vandq_u16(vshrq_n_u16(c, 4), mask0040); - const uint16x8_t g = vshlq_n_u16(vandq_u16(c, mask0040), 4); - const uint16x8_t r = vshlq_n_u16(c, 12); - - uint16x8_t res = vorrq_u16(vorrq_u16(r, g), vorrq_u16(b, a)); - vst1q_u16(dst, res); - - src += 8; - dst += 8; - } - numPixels -= simdable; - } - - // Finish off the rest, if there were any outside the simdable range. - if (numPixels > 0) { - // Note that we've already moved src/dst forward. - ConvertRGBA4444ToABGR4444Basic(dst, src, numPixels); - } -} - -void ConvertRGBA5551ToABGR1555NEON(u16 *dst, const u16 *src, u32 numPixels) { - const uint16x8_t maskB = vdupq_n_u16(0x003E); - const uint16x8_t maskG = vdupq_n_u16(0x07C0); - - if (((uintptr_t)dst & 15) == 0 && ((uintptr_t)src & 15) == 0) { - u32 simdable = (numPixels / 8) * 8; - for (u32 i = 0; i < simdable; i += 8) { - uint16x8_t c = vld1q_u16(src); - - const uint16x8_t a = vshrq_n_u16(c, 15); - const uint16x8_t b = vandq_u16(vshrq_n_u16(c, 9), maskB); - const uint16x8_t g = vandq_u16(vshlq_n_u16(c, 1), maskG); - const uint16x8_t r = vshlq_n_u16(c, 11); - - uint16x8_t res = vorrq_u16(vorrq_u16(r, g), vorrq_u16(b, a)); - vst1q_u16(dst, res); - - src += 8; - dst += 8; - } - numPixels -= simdable; - } - - // Finish off the rest, if there were any outside the simdable range. - if (numPixels > 0) { - // Note that we've already moved src/dst forward. - ConvertRGBA5551ToABGR1555Basic(dst, src, numPixels); - } -} - -void ConvertRGB565ToBGR565NEON(u16 *dst, const u16 *src, u32 numPixels) { - const uint16x8_t maskG = vdupq_n_u16(0x07E0); - - if (((uintptr_t)dst & 15) == 0 && ((uintptr_t)src & 15) == 0) { - u32 simdable = (numPixels / 8) * 8; - for (u32 i = 0; i < simdable; i += 8) { - uint16x8_t c = vld1q_u16(src); - - const uint16x8_t b = vshrq_n_u16(c, 11); - const uint16x8_t g = vandq_u16(c, maskG); - const uint16x8_t r = vshlq_n_u16(c, 11); - - uint16x8_t res = vorrq_u16(vorrq_u16(r, g), b); - vst1q_u16(dst, res); - - src += 8; - dst += 8; - } - numPixels -= simdable; - } - // Finish off the rest, if there were any outside the simdable range. - if (numPixels > 0) { - // Note that we've already moved src/dst forward. - ConvertRGB565ToBGR565Basic(dst, src, numPixels); - } -} - -#endif // PPSSPP_ARCH(ARM_NEON) diff --git a/Common/Data/Convert/ColorConvNEON.h b/Common/Data/Convert/ColorConvNEON.h deleted file mode 100644 index e80fbbd324..0000000000 --- a/Common/Data/Convert/ColorConvNEON.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2015- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#pragma once - -#include "Common/Data/Convert/ColorConv.h" - -void ConvertRGBA4444ToABGR4444NEON(u16 *dst, const u16 *src, u32 numPixels); -void ConvertRGBA5551ToABGR1555NEON(u16 *dst, const u16 *src, u32 numPixels); -void ConvertRGB565ToBGR565NEON(u16 *dst, const u16 *src, u32 numPixels); diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index bac27ba59e..05bdb72eae 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -991,16 +991,6 @@ - - true - true - true - false - false - true - false - false - @@ -1354,16 +1344,6 @@ - - true - true - true - false - false - true - false - false - diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 4a4ec1cf44..e7a1ff33e2 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -577,9 +577,6 @@ HLE\Libraries - - Util - Util @@ -1663,9 +1660,6 @@ Util - - Util - Ext\sfmt19937 diff --git a/Core/Util/AudioFormat.cpp b/Core/Util/AudioFormat.cpp index e118c509b4..8129327db3 100644 --- a/Core/Util/AudioFormat.cpp +++ b/Core/Util/AudioFormat.cpp @@ -19,13 +19,25 @@ #include "Common/Common.h" #include "Common/CPUDetect.h" #include "Core/Util/AudioFormat.h" -#include "Core/Util/AudioFormatNEON.h" #ifdef _M_SSE #include #endif -void AdjustVolumeBlockStandard(s16 *out, s16 *in, size_t size, int leftVol, int rightVol) { +#if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) +#include +#else +#include +#endif +#endif // PPSSPP_ARCH(ARM_NEON) + +// TODO: This shouldn't be a global. +#if PPSSPP_ARCH(ARM_NEON) +alignas(16) static s16 volumeValues[4] = {}; +#endif + +void AdjustVolumeBlock(s16 *out, s16 *in, size_t size, int leftVol, int rightVol) { #ifdef _M_SSE if (leftVol <= 0x7fff && -leftVol <= 0x8000 && rightVol <= 0x7fff && -rightVol <= 0x8000) { __m128i volume = _mm_set_epi16(leftVol, rightVol, leftVol, rightVol, leftVol, rightVol, leftVol, rightVol); @@ -67,7 +79,36 @@ void AdjustVolumeBlockStandard(s16 *out, s16 *in, size_t size, int leftVol, int } } #endif + +#elif PPSSPP_ARCH(ARM_NEON) + if (leftVol <= 0xFFFF && -leftVol <= 0x10000 && rightVol <= 0xFFFF && -rightVol <= 0x10000) { + // Note: vqshrn_n_s32 takes a const argument, so we always go with 1 here, 15 there. + volumeValues[0] = leftVol >> 1; + volumeValues[1] = rightVol >> 1; + volumeValues[2] = leftVol >> 1; + volumeValues[3] = rightVol >> 1; + + const int16x4_t vol = vld1_s16(volumeValues); + while (size >= 16) { + int16x8_t indata1 = vld1q_s16(in); + int16x8_t indata2 = vld1q_s16(in + 8); + + int32x4_t outh1 = vmull_s16(vget_high_s16(indata1), vol); + int32x4_t outh2 = vmull_s16(vget_high_s16(indata2), vol); + int32x4_t outl1 = vmull_s16(vget_low_s16(indata1), vol); + int32x4_t outl2 = vmull_s16(vget_low_s16(indata2), vol); + + int16x8_t outdata1 = vcombine_s16(vqshrn_n_s32(outl1, 15), vqshrn_n_s32(outh1, 15)); + int16x8_t outdata2 = vcombine_s16(vqshrn_n_s32(outl2, 15), vqshrn_n_s32(outh2, 15)); + vst1q_s16(out, outdata1); + vst1q_s16(out + 8, outdata2); + in += 16; + out += 16; + size -= 16; + } + } #endif + if (leftVol <= 0x7fff && -leftVol <= 0x8000 && rightVol <= 0x7fff && -rightVol <= 0x8000) { for (size_t i = 0; i < size; i += 2) { out[i] = ApplySampleVolume(in[i], leftVol); @@ -110,19 +151,3 @@ void ConvertS16ToF32(float *out, const s16 *in, size_t size) { out[i] = in[i] * (1.0f / 32767.0f); } } - -#if !defined(_M_SSE) && !PPSSPP_ARCH(ARM64) -AdjustVolumeBlockFunc AdjustVolumeBlock = &AdjustVolumeBlockStandard; - -// This has to be done after CPUDetect has done its magic. -void SetupAudioFormats() { -#if PPSSPP_ARCH(ARM_NEON) && !PPSSPP_ARCH(ARM64) - if (cpu_info.bNEON) { - AdjustVolumeBlock = &AdjustVolumeBlockNEON; - } -#endif -} -#else -void SetupAudioFormats() { -} -#endif diff --git a/Core/Util/AudioFormat.h b/Core/Util/AudioFormat.h index eb5098ad01..8774e83546 100644 --- a/Core/Util/AudioFormat.h +++ b/Core/Util/AudioFormat.h @@ -20,7 +20,6 @@ #include "ppsspp_config.h" #include "Common/Common.h" #include "Common/CommonTypes.h" -#include "Core/Util/AudioFormatNEON.h" #define IS_LITTLE_ENDIAN (*(const u16 *)"\0\xff" >= 0x100) @@ -66,15 +65,5 @@ static inline s16 ApplySampleVolume20Bit(s16 sample, int vol20) { return clamp_s16((sample * (vol20 >> 4)) >> 12); } -void SetupAudioFormats(); -void AdjustVolumeBlockStandard(s16 *out, s16 *in, size_t size, int leftVol, int rightVol); +void AdjustVolumeBlock(s16 *out, s16 *in, size_t size, int leftVol, int rightVol); void ConvertS16ToF32(float *ou, const s16 *in, size_t size); - -#ifdef _M_SSE -#define AdjustVolumeBlock AdjustVolumeBlockStandard -#elif PPSSPP_ARCH(ARM64) -#define AdjustVolumeBlock AdjustVolumeBlockNEON -#else -typedef void (*AdjustVolumeBlockFunc)(s16 *out, s16 *in, size_t size, int leftVol, int rightVol); -extern AdjustVolumeBlockFunc AdjustVolumeBlock; -#endif diff --git a/Core/Util/AudioFormatNEON.cpp b/Core/Util/AudioFormatNEON.cpp deleted file mode 100644 index e2e72c209f..0000000000 --- a/Core/Util/AudioFormatNEON.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2012- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#include "ppsspp_config.h" -#if PPSSPP_ARCH(ARM_NEON) - -#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) -#include -#else -#include -#endif -#include "Common/CommonTypes.h" -#include "Core/Util/AudioFormat.h" -#include "Core/Util/AudioFormatNEON.h" - -#if !PPSSPP_ARCH(ARM) && !PPSSPP_ARCH(ARM64) -#error Should not be compiled on non-ARM. -#endif - -alignas(16) static s16 volumeValues[4] = {}; - -void AdjustVolumeBlockNEON(s16 *out, s16 *in, size_t size, int leftVol, int rightVol) { - if (leftVol <= 0xFFFF && -leftVol <= 0x10000 && rightVol <= 0xFFFF && -rightVol <= 0x10000) { - // Note: vqshrn_n_s32 takes a const argument, so we always go with 1 here, 15 there. - volumeValues[0] = leftVol >> 1; - volumeValues[1] = rightVol >> 1; - volumeValues[2] = leftVol >> 1; - volumeValues[3] = rightVol >> 1; - - const int16x4_t vol = vld1_s16(volumeValues); - - while (size >= 16) { - int16x8_t indata1 = vld1q_s16(in); - int16x8_t indata2 = vld1q_s16(in + 8); - - int32x4_t outh1 = vmull_s16(vget_high_s16(indata1), vol); - int32x4_t outh2 = vmull_s16(vget_high_s16(indata2), vol); - int32x4_t outl1 = vmull_s16(vget_low_s16(indata1), vol); - int32x4_t outl2 = vmull_s16(vget_low_s16(indata2), vol); - - int16x8_t outdata1 = vcombine_s16(vqshrn_n_s32(outl1, 15), vqshrn_n_s32(outh1, 15)); - int16x8_t outdata2 = vcombine_s16(vqshrn_n_s32(outl2, 15), vqshrn_n_s32(outh2, 15)); - vst1q_s16(out, outdata1); - vst1q_s16(out + 8, outdata2); - in += 16; - out += 16; - size -= 16; - } - } - - if (leftVol <= 0x7fff && -leftVol <= 0x8000 && rightVol <= 0x7fff && -rightVol <= 0x8000) { - for (size_t i = 0; i < size; i += 2) { - out[i] = ApplySampleVolume(in[i], leftVol); - out[i + 1] = ApplySampleVolume(in[i + 1], rightVol); - } - } else { - for (size_t i = 0; i < size; i += 2) { - out[i] = ApplySampleVolume20Bit(in[i], leftVol); - out[i + 1] = ApplySampleVolume20Bit(in[i + 1], rightVol); - } - } -} - -#endif // PPSSPP_ARCH(ARM_NEON) diff --git a/Core/Util/AudioFormatNEON.h b/Core/Util/AudioFormatNEON.h deleted file mode 100644 index 1ebc70148e..0000000000 --- a/Core/Util/AudioFormatNEON.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2012- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#pragma once - -#include "Common/CommonTypes.h" - -void AdjustVolumeBlockNEON(s16 *out, s16 *in, size_t size, int leftVol, int rightVol); diff --git a/GPU/Common/TextureDecoder.cpp b/GPU/Common/TextureDecoder.cpp index 7cd89f58f4..daa82e9ca7 100644 --- a/GPU/Common/TextureDecoder.cpp +++ b/GPU/Common/TextureDecoder.cpp @@ -16,7 +16,9 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "ppsspp_config.h" + #include "ext/xxhash.h" + #include "Common/Common.h" #include "Common/Data/Convert/ColorConv.h" #include "Common/CPUDetect.h" @@ -25,12 +27,21 @@ #include "GPU/GPU.h" #include "GPU/GPUState.h" #include "GPU/Common/TextureDecoder.h" -// NEON is in a separate file so that it can be compiled with a runtime check. -#include "GPU/Common/TextureDecoderNEON.h" #ifdef _M_SSE #include #include +#endif + +#if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) +#include +#else +#include +#endif +#endif + +#ifdef _M_SSE u32 QuickTexHashSSE2(const void *checkp, u32 size) { u32 check = 0; @@ -66,6 +77,107 @@ u32 QuickTexHashSSE2(const void *checkp, u32 size) { } #endif +#if PPSSPP_ARCH(ARM_NEON) + +alignas(16) static const u16 QuickTexHashInitial[8] = { 0xc00bU, 0x9bd9U, 0x4b73U, 0xb651U, 0x4d9bU, 0x4309U, 0x0083U, 0x0001U }; + +u32 QuickTexHashNEON(const void *checkp, u32 size) { + u32 check = 0; + __builtin_prefetch(checkp, 0, 0); + + if (((intptr_t)checkp & 0xf) == 0 && (size & 0x3f) == 0) { +#if PPSSPP_PLATFORM(IOS) || PPSSPP_ARCH(ARM64) || defined(_MSC_VER) || !PPSSPP_ARCH(ARMV7) + uint32x4_t cursor = vdupq_n_u32(0); + uint16x8_t cursor2 = vld1q_u16(QuickTexHashInitial); + uint16x8_t update = vdupq_n_u16(0x2455U); + + const u32 *p = (const u32 *)checkp; + const u32 *pend = p + size / 4; + while (p < pend) { + cursor = vreinterpretq_u32_u16(vmlaq_u16(vreinterpretq_u16_u32(cursor), vreinterpretq_u16_u32(vld1q_u32(&p[4 * 0])), cursor2)); + cursor = veorq_u32(cursor, vld1q_u32(&p[4 * 1])); + cursor = vaddq_u32(cursor, vld1q_u32(&p[4 * 2])); + cursor = veorq_u32(cursor, vreinterpretq_u32_u16(vmulq_u16(vreinterpretq_u16_u32(vld1q_u32(&p[4 * 3])), cursor2))); + cursor2 = vaddq_u16(cursor2, update); + + p += 4 * 4; + } + + cursor = vaddq_u32(cursor, vreinterpretq_u32_u16(cursor2)); + uint32x2_t mixed = vadd_u32(vget_high_u32(cursor), vget_low_u32(cursor)); + check = vget_lane_u32(mixed, 0) + vget_lane_u32(mixed, 1); +#else + // TODO: Why does this crash on iOS, but only certain devices? + // It's faster than the above, but I guess it sucks to be using an iPhone. + // As of 2020 clang, it's still faster by ~1.4%. + + // d0/d1 (q0) - cursor + // d2/d3 (q1) - cursor2 + // d4/d5 (q2) - update + // d16-d23 (q8-q11) - memory transfer + asm volatile ( + // Initialize cursor. + "vmov.i32 q0, #0\n" + + // Initialize cursor2. + "movw r0, 0xc00b\n" + "movt r0, 0x9bd9\n" + "movw r1, 0x4b73\n" + "movt r1, 0xb651\n" + "vmov d2, r0, r1\n" + "movw r0, 0x4d9b\n" + "movt r0, 0x4309\n" + "movw r1, 0x0083\n" + "movt r1, 0x0001\n" + "vmov d3, r0, r1\n" + + // Initialize update. + "movw r0, 0x2455\n" + "vdup.i16 q2, r0\n" + + // This is where we end. + "add r0, %1, %2\n" + + // Okay, do the memory hashing. + "QuickTexHashNEON_next:\n" + "pld [%2, #0xc0]\n" + "vldmia %2!, {d16-d23}\n" + "vmla.i16 q0, q1, q8\n" + "vmul.i16 q11, q11, q1\n" + "veor.i32 q0, q0, q9\n" + "cmp %2, r0\n" + "vadd.i32 q0, q0, q10\n" + "vadd.i16 q1, q1, q2\n" + "veor.i32 q0, q0, q11\n" + "blo QuickTexHashNEON_next\n" + + // Now let's get the result. + "vadd.i32 q0, q0, q1\n" + "vadd.i32 d0, d0, d1\n" + "vmov r0, r1, d0\n" + "add %0, r0, r1\n" + + : "=r"(check) + : "r"(size), "r"(checkp) + : "r0", "r1", "d0", "d1", "d2", "d3", "d4", "d5", "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", "cc" + ); +#endif + } else { + const u32 size_u32 = size / 4; + const u32 *p = (const u32 *)checkp; + for (u32 i = 0; i < size_u32; i += 4) { + check += p[i + 0]; + check ^= p[i + 1]; + check += p[i + 2]; + check ^= p[i + 3]; + } + } + + return check; +} + +#endif // PPSSPP_ARCH(ARM_NEON) + // Masks to downalign bufw to 16 bytes, and wrap at 2048. static const u32 textureAlignMask16[16] = { 0x7FF & ~(((8 * 16) / 16) - 1), //GE_TFMT_5650, @@ -99,6 +211,7 @@ u32 GetTextureBufw(int level, u32 texaddr, GETextureFormat format) { return bufw; } +// Is this compatible with QuickTexHashNEON/SSE? u32 QuickTexHashNonSSE(const void *checkp, u32 size) { u32 check = 0; @@ -150,39 +263,7 @@ u32 QuickTexHashNonSSE(const void *checkp, u32 size) { return check; } -#if !PPSSPP_ARCH(ARM64) && !defined(_M_SSE) -static u32 QuickTexHashBasic(const void *checkp, u32 size) { -#if PPSSPP_ARCH(ARM) && defined(__GNUC__) - __builtin_prefetch(checkp, 0, 0); - - u32 check; - asm volatile ( - // Let's change size to the end address. - "add %1, %1, %2\n" - "mov r6, #0\n" - - ".align 2\n" - - // If we have zero sized input, we'll return garbage. Oh well, shouldn't happen. - "QuickTexHashBasic_next:\n" - "ldmia %2!, {r2-r5}\n" - "add r6, r6, r2\n" - "eor r6, r6, r3\n" - "cmp %2, %1\n" - "add r6, r6, r4\n" - "eor r6, r6, r5\n" - "blo QuickTexHashBasic_next\n" - - ".align 2\n" - - "QuickTexHashBasic_done:\n" - "mov %0, r6\n" - - : "=r"(check) - : "r"(size), "r"(checkp) - : "r2", "r3", "r4", "r5", "r6" - ); -#else +u32 QuickTexHashBasic(const void *checkp, u32 size) { u32 check = 0; const u32 size_u32 = size / 4; const u32 *p = (const u32 *)checkp; @@ -192,11 +273,9 @@ static u32 QuickTexHashBasic(const void *checkp, u32 size) { check += p[i + 2]; check ^= p[i + 3]; } -#endif return check; } -#endif void DoSwizzleTex16(const u32 *ysrcp, u8 *texptr, int bxc, int byc, u32 pitch) { // ysrcp is in 32-bits, so this is convenient. @@ -252,11 +331,12 @@ void DoSwizzleTex16(const u32 *ysrcp, u8 *texptr, int bxc, int byc, u32 pitch) { } } -void DoUnswizzleTex16Basic(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch) { +void DoUnswizzleTex16(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch) { // ydestp is in 32-bits, so this is convenient. const u32 pitchBy32 = pitch >> 2; #ifdef _M_SSE + // This check is pretty much a given, right? if (((uintptr_t)ydestp & 0xF) == 0 && (pitch & 0xF) == 0) { const __m128i *src = (const __m128i *)texptr; // The pitch parameter is in bytes, so shift down for 128-bit. @@ -287,6 +367,37 @@ void DoUnswizzleTex16Basic(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 ydestp += pitchBy32 * 8; } } else +#elif PPSSPP_ARCH(ARM_NEON) + if (((uintptr_t)ydestp & 0xF) == 0 && (pitch & 0xF) == 0) { + // TODO: Does this really do anything meaningful? + __builtin_prefetch(texptr, 0, 0); + + const u32 *src = (const u32 *)texptr; + for (int by = 0; by < byc; by++) { + u32 *xdest = ydestp; + for (int bx = 0; bx < bxc; bx++) { + u32 *dest = xdest; + for (int n = 0; n < 2; n++) { + // Textures are always 16-byte aligned so this is fine. + uint32x4_t temp1 = vld1q_u32(src); + uint32x4_t temp2 = vld1q_u32(src + 4); + uint32x4_t temp3 = vld1q_u32(src + 8); + uint32x4_t temp4 = vld1q_u32(src + 12); + vst1q_u32(dest, temp1); + dest += pitchBy32; + vst1q_u32(dest, temp2); + dest += pitchBy32; + vst1q_u32(dest, temp3); + dest += pitchBy32; + vst1q_u32(dest, temp4); + dest += pitchBy32; + src += 16; + } + xdest += 4; + } + ydestp += pitchBy32 * 8; + } + } else #endif { const u32 *src = (const u32 *)texptr; @@ -306,23 +417,6 @@ void DoUnswizzleTex16Basic(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 } } -#if !PPSSPP_ARCH(ARM64) && !defined(_M_SSE) -QuickTexHashFunc DoQuickTexHash = &QuickTexHashBasic; -QuickTexHashFunc StableQuickTexHash = &QuickTexHashNonSSE; -UnswizzleTex16Func DoUnswizzleTex16 = &DoUnswizzleTex16Basic; -#endif - -// This has to be done after CPUDetect has done its magic. -void SetupTextureDecoder() { -#if PPSSPP_ARCH(ARM_NEON) && !PPSSPP_ARCH(ARM64) - if (cpu_info.bNEON) { - DoQuickTexHash = &QuickTexHashNEON; - StableQuickTexHash = &QuickTexHashNEON; - DoUnswizzleTex16 = &DoUnswizzleTex16NEON; - } -#endif -} - // S3TC / DXT Decoder class DXTDecoder { public: @@ -661,6 +755,138 @@ CheckAlphaResult CheckAlphaRGBA5551SSE2(const u32 *pixelData, int stride, int w, return CHECKALPHA_FULL; } + +#endif // _M_SSE + +#if PPSSPP_ARCH(ARM_NEON) + +static inline bool VectorIsNonZeroNEON(const uint32x4_t &v) { + u64 low = vgetq_lane_u64(vreinterpretq_u64_u32(v), 0); + u64 high = vgetq_lane_u64(vreinterpretq_u64_u32(v), 1); + + return (low | high) != 0; +} + +#ifndef _MSC_VER +// MSVC consider this function the same as the one above! uint16x8_t is typedef'd to the same type as uint32x4_t. +static inline bool VectorIsNonZeroNEON(const uint16x8_t &v) { + u64 low = vgetq_lane_u64(vreinterpretq_u64_u16(v), 0); + u64 high = vgetq_lane_u64(vreinterpretq_u64_u16(v), 1); + + return (low | high) != 0; +} +#endif + +CheckAlphaResult CheckAlphaRGBA8888NEON(const u32 *pixelData, int stride, int w, int h) { + const u32 *p = (const u32 *)pixelData; + + const uint32x4_t mask = vdupq_n_u32(0xFF000000); + uint32x4_t bits = mask; + for (int y = 0; y < h; ++y) { + for (int i = 0; i < w; i += 4) { + const uint32x4_t a = vld1q_u32(&p[i]); + bits = vandq_u32(bits, a); + } + + uint32x4_t result = veorq_u32(bits, mask); + if (VectorIsNonZeroNEON(result)) { + return CHECKALPHA_ANY; + } + + p += stride; + } + + return CHECKALPHA_FULL; +} + +CheckAlphaResult CheckAlphaABGR4444NEON(const u32 *pixelData, int stride, int w, int h) { + const u16 *p = (const u16 *)pixelData; + + const uint16x8_t mask = vdupq_n_u16((u16)0x000F); + uint16x8_t bits = mask; + for (int y = 0; y < h; ++y) { + for (int i = 0; i < w; i += 8) { + const uint16x8_t a = vld1q_u16(&p[i]); + bits = vandq_u16(bits, a); + } + + uint16x8_t result = veorq_u16(bits, mask); + if (VectorIsNonZeroNEON(result)) { + return CHECKALPHA_ANY; + } + + p += stride; + } + + return CHECKALPHA_FULL; +} + +CheckAlphaResult CheckAlphaABGR1555NEON(const u32 *pixelData, int stride, int w, int h) { + const u16 *p = (const u16 *)pixelData; + + const uint16x8_t mask = vdupq_n_u16((u16)0x0001); + uint16x8_t bits = mask; + for (int y = 0; y < h; ++y) { + for (int i = 0; i < w; i += 8) { + const uint16x8_t a = vld1q_u16(&p[i]); + bits = vandq_u16(bits, a); + } + + uint16x8_t result = veorq_u16(bits, mask); + if (VectorIsNonZeroNEON(result)) { + return CHECKALPHA_ANY; + } + + p += stride; + } + + return CHECKALPHA_FULL; +} + +CheckAlphaResult CheckAlphaRGBA4444NEON(const u32 *pixelData, int stride, int w, int h) { + const u16 *p = (const u16 *)pixelData; + + const uint16x8_t mask = vdupq_n_u16((u16)0xF000); + uint16x8_t bits = mask; + for (int y = 0; y < h; ++y) { + for (int i = 0; i < w; i += 8) { + const uint16x8_t a = vld1q_u16(&p[i]); + bits = vandq_u16(bits, a); + } + + uint16x8_t result = veorq_u16(bits, mask); + if (VectorIsNonZeroNEON(result)) { + return CHECKALPHA_ANY; + } + + p += stride; + } + + return CHECKALPHA_FULL; +} + +CheckAlphaResult CheckAlphaRGBA5551NEON(const u32 *pixelData, int stride, int w, int h) { + const u16 *p = (const u16 *)pixelData; + + const uint16x8_t mask = vdupq_n_u16((u16)0x8000); + uint16x8_t bits = mask; + for (int y = 0; y < h; ++y) { + for (int i = 0; i < w; i += 8) { + const uint16x8_t a = vld1q_u16(&p[i]); + bits = vandq_u16(bits, a); + } + + uint16x8_t result = veorq_u16(bits, mask); + if (VectorIsNonZeroNEON(result)) { + return CHECKALPHA_ANY; + } + + p += stride; + } + + return CHECKALPHA_FULL; +} + #endif CheckAlphaResult CheckAlphaRGBA8888Basic(const u32 *pixelData, int stride, int w, int h) { diff --git a/GPU/Common/TextureDecoder.h b/GPU/Common/TextureDecoder.h index 2b03bc4102..ca1a2e4ca0 100644 --- a/GPU/Common/TextureDecoder.h +++ b/GPU/Common/TextureDecoder.h @@ -17,25 +17,24 @@ #pragma once +#include "ppsspp_config.h" + +#include "Common/Common.h" +#include "Common/Swap.h" +#include "Core/MemMap.h" +#include "Core/ConfigValues.h" +#include "GPU/ge_constants.h" +#include "GPU/GPUState.h" + enum CheckAlphaResult { // These are intended to line up with TexCacheEntry::STATUS_ALPHA_UNKNOWN, etc. CHECKALPHA_FULL = 0, CHECKALPHA_ANY = 4, }; -#include "ppsspp_config.h" -#include "Common/Common.h" -#include "Common/Swap.h" -#include "Core/MemMap.h" -#include "Core/ConfigValues.h" -#include "GPU/ge_constants.h" -#include "GPU/Common/TextureDecoderNEON.h" -#include "GPU/GPUState.h" - -void SetupTextureDecoder(); - -// Pitch must be aligned to 16 bits (as is the case on a PSP) +// For both of these, pitch must be aligned to 16 bits (as is the case on a PSP). void DoSwizzleTex16(const u32 *ysrcp, u8 *texptr, int bxc, int byc, u32 pitch); +void DoUnswizzleTex16(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch); // For SSE, we statically link the SSE2 algorithms. #if defined(_M_SSE) @@ -43,22 +42,22 @@ u32 QuickTexHashSSE2(const void *checkp, u32 size); #define DoQuickTexHash QuickTexHashSSE2 #define StableQuickTexHash QuickTexHashSSE2 -// Pitch must be aligned to 16 bytes (as is the case on a PSP) -void DoUnswizzleTex16Basic(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch); -#define DoUnswizzleTex16 DoUnswizzleTex16Basic +// For ARM/ARM64, NEON is mandatory, so we also statically link. +#elif PPSSPP_ARCH(ARM_NEON) + +u32 QuickTexHashNEON(const void *checkp, u32 size); -// For ARM64, NEON is mandatory, so we also statically link. -#elif PPSSPP_ARCH(ARM64) #define DoQuickTexHash QuickTexHashNEON #define StableQuickTexHash QuickTexHashNEON -#define DoUnswizzleTex16 DoUnswizzleTex16NEON -#else -typedef u32 (*QuickTexHashFunc)(const void *checkp, u32 size); -extern QuickTexHashFunc DoQuickTexHash; -extern QuickTexHashFunc StableQuickTexHash; -typedef void (*UnswizzleTex16Func)(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch); -extern UnswizzleTex16Func DoUnswizzleTex16; +#else + +u32 QuickTexHashBasic(const void *checkp, u32 size); +u32 QuickTexHashNonSSE(const void *checkp, u32 size); + +#define DoQuickTexHash QuickTexHashBasic +#define StableQuickTexHash QuickTexHashNonSSE + #endif CheckAlphaResult CheckAlphaRGBA8888Basic(const u32 *pixelData, int stride, int w, int h); diff --git a/GPU/Common/TextureDecoderNEON.cpp b/GPU/Common/TextureDecoderNEON.cpp deleted file mode 100644 index e0a427e65a..0000000000 --- a/GPU/Common/TextureDecoderNEON.cpp +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) 2012- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#include "ppsspp_config.h" - -#if PPSSPP_ARCH(ARM_NEON) - -#include "ext/xxhash.h" - -#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) -#include -#else -#include -#endif - -#include "GPU/GPUState.h" -#include "GPU/Common/TextureDecoder.h" - -alignas(16) static const u16 QuickTexHashInitial[8] = {0xc00bU, 0x9bd9U, 0x4b73U, 0xb651U, 0x4d9bU, 0x4309U, 0x0083U, 0x0001U}; - -#ifdef _MSC_VER -#define __builtin_prefetch(a,b,c) -#endif - -u32 QuickTexHashNEON(const void *checkp, u32 size) { - u32 check = 0; - __builtin_prefetch(checkp, 0, 0); - - if (((intptr_t)checkp & 0xf) == 0 && (size & 0x3f) == 0) { -#if PPSSPP_PLATFORM(IOS) || PPSSPP_ARCH(ARM64) || defined(_MSC_VER) || !PPSSPP_ARCH(ARMV7) - uint32x4_t cursor = vdupq_n_u32(0); - uint16x8_t cursor2 = vld1q_u16(QuickTexHashInitial); - uint16x8_t update = vdupq_n_u16(0x2455U); - - const u32 *p = (const u32 *)checkp; - const u32 *pend = p + size / 4; - while (p < pend) { - cursor = vreinterpretq_u32_u16(vmlaq_u16(vreinterpretq_u16_u32(cursor), vreinterpretq_u16_u32(vld1q_u32(&p[4 * 0])), cursor2)); - cursor = veorq_u32(cursor, vld1q_u32(&p[4 * 1])); - cursor = vaddq_u32(cursor, vld1q_u32(&p[4 * 2])); - cursor = veorq_u32(cursor, vreinterpretq_u32_u16(vmulq_u16(vreinterpretq_u16_u32(vld1q_u32(&p[4 * 3])), cursor2))); - cursor2 = vaddq_u16(cursor2, update); - - p += 4 * 4; - } - - cursor = vaddq_u32(cursor, vreinterpretq_u32_u16(cursor2)); - uint32x2_t mixed = vadd_u32(vget_high_u32(cursor), vget_low_u32(cursor)); - check = vget_lane_u32(mixed, 0) + vget_lane_u32(mixed, 1); -#else - // TODO: Why does this crash on iOS, but only certain devices? - // It's faster than the above, but I guess it sucks to be using an iPhone. - // As of 2020 clang, it's still faster by ~1.4%. - - // d0/d1 (q0) - cursor - // d2/d3 (q1) - cursor2 - // d4/d5 (q2) - update - // d16-d23 (q8-q11) - memory transfer - asm volatile ( - // Initialize cursor. - "vmov.i32 q0, #0\n" - - // Initialize cursor2. - "movw r0, 0xc00b\n" - "movt r0, 0x9bd9\n" - "movw r1, 0x4b73\n" - "movt r1, 0xb651\n" - "vmov d2, r0, r1\n" - "movw r0, 0x4d9b\n" - "movt r0, 0x4309\n" - "movw r1, 0x0083\n" - "movt r1, 0x0001\n" - "vmov d3, r0, r1\n" - - // Initialize update. - "movw r0, 0x2455\n" - "vdup.i16 q2, r0\n" - - // This is where we end. - "add r0, %1, %2\n" - - // Okay, do the memory hashing. - "QuickTexHashNEON_next:\n" - "pld [%2, #0xc0]\n" - "vldmia %2!, {d16-d23}\n" - "vmla.i16 q0, q1, q8\n" - "vmul.i16 q11, q11, q1\n" - "veor.i32 q0, q0, q9\n" - "cmp %2, r0\n" - "vadd.i32 q0, q0, q10\n" - "vadd.i16 q1, q1, q2\n" - "veor.i32 q0, q0, q11\n" - "blo QuickTexHashNEON_next\n" - - // Now let's get the result. - "vadd.i32 q0, q0, q1\n" - "vadd.i32 d0, d0, d1\n" - "vmov r0, r1, d0\n" - "add %0, r0, r1\n" - - : "=r"(check) - : "r"(size), "r"(checkp) - : "r0", "r1", "d0", "d1", "d2", "d3", "d4", "d5", "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", "cc" - ); -#endif - } else { - const u32 size_u32 = size / 4; - const u32 *p = (const u32 *)checkp; - for (u32 i = 0; i < size_u32; i += 4) { - check += p[i + 0]; - check ^= p[i + 1]; - check += p[i + 2]; - check ^= p[i + 3]; - } - } - - return check; -} - -void DoUnswizzleTex16NEON(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch) { - // ydestp is in 32-bits, so this is convenient. - const u32 pitchBy32 = pitch >> 2; - - __builtin_prefetch(texptr, 0, 0); - __builtin_prefetch(ydestp, 1, 1); - - const u32 *src = (const u32 *)texptr; - for (int by = 0; by < byc; by++) { - u32 *xdest = ydestp; - for (int bx = 0; bx < bxc; bx++) { - u32 *dest = xdest; - for (int n = 0; n < 2; n++) { - // Textures are always 16-byte aligned so this is fine. - uint32x4_t temp1 = vld1q_u32(src); - uint32x4_t temp2 = vld1q_u32(src + 4); - uint32x4_t temp3 = vld1q_u32(src + 8); - uint32x4_t temp4 = vld1q_u32(src + 12); - vst1q_u32(dest, temp1); - dest += pitchBy32; - vst1q_u32(dest, temp2); - dest += pitchBy32; - vst1q_u32(dest, temp3); - dest += pitchBy32; - vst1q_u32(dest, temp4); - dest += pitchBy32; - src += 16; - } - xdest += 4; - } - ydestp += pitchBy32 * 8; - } -} - -static inline bool VectorIsNonZeroNEON(const uint32x4_t &v) { - u64 low = vgetq_lane_u64(vreinterpretq_u64_u32(v), 0); - u64 high = vgetq_lane_u64(vreinterpretq_u64_u32(v), 1); - - return (low | high) != 0; -} - -#ifndef _MSC_VER -// MSVC consider this function the same as the one above! uint16x8_t is typedef'd to the same type as uint32x4_t. -static inline bool VectorIsNonZeroNEON(const uint16x8_t &v) { - u64 low = vgetq_lane_u64(vreinterpretq_u64_u16(v), 0); - u64 high = vgetq_lane_u64(vreinterpretq_u64_u16(v), 1); - - return (low | high) != 0; -} -#endif - -CheckAlphaResult CheckAlphaRGBA8888NEON(const u32 *pixelData, int stride, int w, int h) { - const u32 *p = (const u32 *)pixelData; - - const uint32x4_t mask = vdupq_n_u32(0xFF000000); - uint32x4_t bits = mask; - for (int y = 0; y < h; ++y) { - for (int i = 0; i < w; i += 4) { - const uint32x4_t a = vld1q_u32(&p[i]); - bits = vandq_u32(bits, a); - } - - uint32x4_t result = veorq_u32(bits, mask); - if (VectorIsNonZeroNEON(result)) { - return CHECKALPHA_ANY; - } - - p += stride; - } - - return CHECKALPHA_FULL; -} - -CheckAlphaResult CheckAlphaABGR4444NEON(const u32 *pixelData, int stride, int w, int h) { - const u16 *p = (const u16 *)pixelData; - - const uint16x8_t mask = vdupq_n_u16((u16)0x000F); - uint16x8_t bits = mask; - for (int y = 0; y < h; ++y) { - for (int i = 0; i < w; i += 8) { - const uint16x8_t a = vld1q_u16(&p[i]); - bits = vandq_u16(bits, a); - } - - uint16x8_t result = veorq_u16(bits, mask); - if (VectorIsNonZeroNEON(result)) { - return CHECKALPHA_ANY; - } - - p += stride; - } - - return CHECKALPHA_FULL; -} - -CheckAlphaResult CheckAlphaABGR1555NEON(const u32 *pixelData, int stride, int w, int h) { - const u16 *p = (const u16 *)pixelData; - - const uint16x8_t mask = vdupq_n_u16((u16)0x0001); - uint16x8_t bits = mask; - for (int y = 0; y < h; ++y) { - for (int i = 0; i < w; i += 8) { - const uint16x8_t a = vld1q_u16(&p[i]); - bits = vandq_u16(bits, a); - } - - uint16x8_t result = veorq_u16(bits, mask); - if (VectorIsNonZeroNEON(result)) { - return CHECKALPHA_ANY; - } - - p += stride; - } - - return CHECKALPHA_FULL; -} - -CheckAlphaResult CheckAlphaRGBA4444NEON(const u32 *pixelData, int stride, int w, int h) { - const u16 *p = (const u16 *)pixelData; - - const uint16x8_t mask = vdupq_n_u16((u16)0xF000); - uint16x8_t bits = mask; - for (int y = 0; y < h; ++y) { - for (int i = 0; i < w; i += 8) { - const uint16x8_t a = vld1q_u16(&p[i]); - bits = vandq_u16(bits, a); - } - - uint16x8_t result = veorq_u16(bits, mask); - if (VectorIsNonZeroNEON(result)) { - return CHECKALPHA_ANY; - } - - p += stride; - } - - return CHECKALPHA_FULL; -} - -CheckAlphaResult CheckAlphaRGBA5551NEON(const u32 *pixelData, int stride, int w, int h) { - const u16 *p = (const u16 *)pixelData; - - const uint16x8_t mask = vdupq_n_u16((u16)0x8000); - uint16x8_t bits = mask; - for (int y = 0; y < h; ++y) { - for (int i = 0; i < w; i += 8) { - const uint16x8_t a = vld1q_u16(&p[i]); - bits = vandq_u16(bits, a); - } - - uint16x8_t result = veorq_u16(bits, mask); - if (VectorIsNonZeroNEON(result)) { - return CHECKALPHA_ANY; - } - - p += stride; - } - - return CHECKALPHA_FULL; -} - -#endif diff --git a/GPU/Common/TextureDecoderNEON.h b/GPU/Common/TextureDecoderNEON.h deleted file mode 100644 index 6d3b5cf45a..0000000000 --- a/GPU/Common/TextureDecoderNEON.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2012- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#include "GPU/Common/TextureDecoder.h" - -u32 QuickTexHashNEON(const void *checkp, u32 size); -void DoUnswizzleTex16NEON(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch); - -CheckAlphaResult CheckAlphaRGBA8888NEON(const u32 *pixelData, int stride, int w, int h); -CheckAlphaResult CheckAlphaABGR4444NEON(const u32 *pixelData, int stride, int w, int h); -CheckAlphaResult CheckAlphaABGR1555NEON(const u32 *pixelData, int stride, int w, int h); -CheckAlphaResult CheckAlphaRGBA4444NEON(const u32 *pixelData, int stride, int w, int h); -CheckAlphaResult CheckAlphaRGBA5551NEON(const u32 *pixelData, int stride, int w, int h); diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 199f408e4a..722eae29b4 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -126,8 +126,6 @@ TextureCacheD3D11::TextureCacheD3D11(Draw::DrawContext *draw) HRESULT result = 0; - SetupTextureDecoder(); - nextTexture_ = nullptr; } diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 26f15e6998..23334baf8b 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -69,7 +69,6 @@ TextureCacheDX9::TextureCacheDX9(Draw::DrawContext *draw) } else { maxAnisotropyLevel = pCaps.MaxAnisotropy; } - SetupTextureDecoder(); nextTexture_ = nullptr; device_->CreateVertexDeclaration(g_FramebufferVertexElements, &pFramebufferVertexDecl); diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 160b435b27..df9d3f88b9 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -49,8 +49,6 @@ TextureCacheGLES::TextureCacheGLES(Draw::DrawContext *draw) : TextureCacheCommon(draw) { render_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); - SetupTextureDecoder(); - nextTexture_ = nullptr; std::vector entries; diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index a7877051d0..76bf48ac5e 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -354,16 +354,6 @@ - - true - true - true - false - false - true - false - false - @@ -493,16 +483,6 @@ - - true - true - true - false - false - true - false - false - diff --git a/GPU/GPU.vcxproj.filters b/GPU/GPU.vcxproj.filters index 7351bb3b08..b0e829d136 100644 --- a/GPU/GPU.vcxproj.filters +++ b/GPU/GPU.vcxproj.filters @@ -105,9 +105,6 @@ Common - - Common - Common @@ -353,9 +350,6 @@ Common - - Common - Common diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index bb860f75f2..be7742de6f 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -382,7 +382,6 @@ GPUCommon::GPUCommon(GraphicsContext *gfxCtx, Draw::DrawContext *draw) : static_assert(sizeof(DisplayList) == 456, "Bad DisplayList size"); Reinitialize(); - SetupColorConv(); gstate.Reset(); gstate_c.Reset(); gpuStats.Reset(); diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index d8369eb2ba..afb8a5ba40 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -183,7 +183,6 @@ TextureCacheVulkan::TextureCacheVulkan(Draw::DrawContext *draw, VulkanContext *v computeShaderManager_(vulkan), samplerCache_(vulkan) { DeviceRestore(draw); - SetupTextureDecoder(); } TextureCacheVulkan::~TextureCacheVulkan() { diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 52a43b6f3c..021a2f94bb 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -467,8 +467,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch InitFastMath(cpu_info.bNEON); g_threadManager.Init(cpu_info.num_cores, cpu_info.logical_cpu_count); - SetupAudioFormats(); - g_Discord.SetPresenceMenu(); // Make sure UI state is MENU. diff --git a/UWP/CommonUWP/CommonUWP.vcxproj b/UWP/CommonUWP/CommonUWP.vcxproj index 3349afd9e6..90eb76d7a5 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj +++ b/UWP/CommonUWP/CommonUWP.vcxproj @@ -461,7 +461,6 @@ - @@ -578,7 +577,6 @@ - @@ -642,4 +640,4 @@ - \ No newline at end of file + diff --git a/UWP/CommonUWP/CommonUWP.vcxproj.filters b/UWP/CommonUWP/CommonUWP.vcxproj.filters index 740747dfd4..b663fdb11c 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj.filters +++ b/UWP/CommonUWP/CommonUWP.vcxproj.filters @@ -93,7 +93,6 @@ - @@ -390,7 +389,6 @@ - @@ -711,4 +709,4 @@ Math\lin - \ No newline at end of file + diff --git a/UWP/CoreUWP/CoreUWP.vcxproj b/UWP/CoreUWP/CoreUWP.vcxproj index 8c1be3ec8f..d1e9ec4366 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj +++ b/UWP/CoreUWP/CoreUWP.vcxproj @@ -581,7 +581,6 @@ - @@ -840,7 +839,6 @@ - @@ -5329,4 +5327,4 @@ - \ No newline at end of file + diff --git a/UWP/CoreUWP/CoreUWP.vcxproj.filters b/UWP/CoreUWP/CoreUWP.vcxproj.filters index 9e0f8ab7ed..466e7867e9 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj.filters +++ b/UWP/CoreUWP/CoreUWP.vcxproj.filters @@ -239,9 +239,6 @@ Util - - Util - Util @@ -1230,9 +1227,6 @@ Util - - Util - Util @@ -1767,4 +1761,4 @@ Ext\gason - \ No newline at end of file + diff --git a/UWP/GPU_UWP/GPU_UWP.vcxproj b/UWP/GPU_UWP/GPU_UWP.vcxproj index a97aa2d25b..1ebb9f9fb2 100644 --- a/UWP/GPU_UWP/GPU_UWP.vcxproj +++ b/UWP/GPU_UWP/GPU_UWP.vcxproj @@ -398,7 +398,6 @@ - @@ -458,7 +457,6 @@ - @@ -530,4 +528,4 @@ - \ No newline at end of file + diff --git a/UWP/GPU_UWP/GPU_UWP.vcxproj.filters b/UWP/GPU_UWP/GPU_UWP.vcxproj.filters index 069e5eab00..3e3b2ca600 100644 --- a/UWP/GPU_UWP/GPU_UWP.vcxproj.filters +++ b/UWP/GPU_UWP/GPU_UWP.vcxproj.filters @@ -17,7 +17,6 @@ - @@ -79,7 +78,6 @@ - @@ -122,4 +120,4 @@ - \ No newline at end of file + diff --git a/android/jni/Android.mk b/android/jni/Android.mk index bff3e7f199..841da00018 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -59,10 +59,7 @@ endif ifeq ($(findstring armeabi-v7a,$(TARGET_ARCH_ABI)),armeabi-v7a) ARCH_FILES := \ - $(SRC)/GPU/Common/TextureDecoderNEON.cpp.neon \ - $(SRC)/Core/Util/AudioFormatNEON.cpp.neon \ $(SRC)/Common/ArmEmitter.cpp \ - $(SRC)/Common/Data/Convert/ColorConvNEON.cpp.neon \ $(SRC)/Common/Math/fast/fast_matrix_neon.S.neon \ $(SRC)/Core/MIPS/ARM/ArmCompALU.cpp \ $(SRC)/Core/MIPS/ARM/ArmCompBranch.cpp \ @@ -86,10 +83,7 @@ endif ifeq ($(findstring arm64-v8a,$(TARGET_ARCH_ABI)),arm64-v8a) ARCH_FILES := \ - $(SRC)/GPU/Common/TextureDecoderNEON.cpp \ - $(SRC)/Core/Util/AudioFormatNEON.cpp \ $(SRC)/Common/Arm64Emitter.cpp \ - $(SRC)/Common/Data/Convert/ColorConvNEON.cpp \ $(SRC)/Core/MIPS/ARM64/Arm64CompALU.cpp \ $(SRC)/Core/MIPS/ARM64/Arm64CompBranch.cpp \ $(SRC)/Core/MIPS/ARM64/Arm64CompFPU.cpp \ diff --git a/libretro/Makefile.common b/libretro/Makefile.common index f00325a8ea..8db7ab9345 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -627,10 +627,7 @@ ifeq ($(WITH_DYNAREC),1) ifeq ($(HAVE_NEON),1) SOURCES_CXX += \ $(COREDIR)/MIPS/ARM/ArmCompVFPUNEON.cpp \ - $(COREDIR)/MIPS/ARM/ArmCompVFPUNEONUtil.cpp \ - $(COREDIR)/Util/AudioFormatNEON.cpp \ - $(COMMONDIR)/Data/Convert/ColorConvNEON.cpp \ - $(GPUDIR)/Common/TextureDecoderNEON.cpp + $(COREDIR)/MIPS/ARM/ArmCompVFPUNEONUtil.cpp SOURCES_C += $(EXTDIR)/libpng17/arm/arm_init.c \ $(EXTDIR)/libpng17/arm/filter_neon_intrinsics.c @@ -656,10 +653,7 @@ ifeq ($(WITH_DYNAREC),1) ifeq ($(HAVE_NEON),1) SOURCES_CXX += \ $(COREDIR)/MIPS/ARM/ArmCompVFPUNEON.cpp \ - $(COREDIR)/MIPS/ARM/ArmCompVFPUNEONUtil.cpp \ - $(COREDIR)/Util/AudioFormatNEON.cpp \ - $(COMMONDIR)/Data/Convert/ColorConvNEON.cpp \ - $(GPUDIR)/Common/TextureDecoderNEON.cpp + $(COREDIR)/MIPS/ARM/ArmCompVFPUNEONUtil.cpp SOURCES_C += $(EXTDIR)/libpng17/arm/arm_init.c \ $(EXTDIR)/libpng17/arm/filter_neon_intrinsics.c diff --git a/unittest/UnitTest.cpp b/unittest/UnitTest.cpp index ec5a92a845..d115554c0d 100644 --- a/unittest/UnitTest.cpp +++ b/unittest/UnitTest.cpp @@ -474,8 +474,6 @@ private: }; bool TestQuickTexHash() { - SetupTextureDecoder(); - static const int BUF_SIZE = 1024; AlignedMem buf(BUF_SIZE, 16);