From 68317f0067c31b3336444ba657347e21d986f397 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 1 Sep 2018 19:56:35 -0700 Subject: [PATCH] Core: Match up NOEN define usage a bit more. Some compile parameters were resulting in us try to use a func we didn't compile. We should at least use the same defines in usage and definition. --- Common/ColorConv.cpp | 2 +- Core/Util/AudioFormat.cpp | 4 ++-- Core/Util/AudioFormat.h | 3 +++ Core/Util/AudioFormatNEON.cpp | 2 +- ext/native/math/fast/fast_math.c | 2 +- ext/native/math/fast/fast_matrix.h | 2 ++ ext/native/math/fast/fast_matrix_neon.S | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Common/ColorConv.cpp b/Common/ColorConv.cpp index c032fd4bc9..bf4276f1e3 100644 --- a/Common/ColorConv.cpp +++ b/Common/ColorConv.cpp @@ -643,7 +643,7 @@ Convert16bppTo16bppFunc ConvertRGB565ToBGR565 = &ConvertRGB565ToBGR565Basic; #endif void SetupColorConv() { -#if PPSSPP_ARCH(ARMV7) && PPSSPP_ARCH(ARM_NEON) +#if PPSSPP_ARCH(ARM_NEON) && !PPSSPP_ARCH(ARM64) if (cpu_info.bNEON) { ConvertRGBA4444ToABGR4444 = &ConvertRGBA4444ToABGR4444NEON; ConvertRGBA5551ToABGR1555 = &ConvertRGBA5551ToABGR1555NEON; diff --git a/Core/Util/AudioFormat.cpp b/Core/Util/AudioFormat.cpp index 2424b405d5..54610949f3 100644 --- a/Core/Util/AudioFormat.cpp +++ b/Core/Util/AudioFormat.cpp @@ -110,12 +110,12 @@ void ConvertS16ToF32(float *out, const s16 *in, size_t size) { } } -#ifndef _M_SSE +#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(ARMV7) && PPSSPP_ARCH(ARM_NEON) +#if PPSSPP_ARCH(ARM_NEON) && !PPSSPP_ARCH(ARM64) if (cpu_info.bNEON) { AdjustVolumeBlock = &AdjustVolumeBlockNEON; } diff --git a/Core/Util/AudioFormat.h b/Core/Util/AudioFormat.h index 7fc20eaf83..eb5098ad01 100644 --- a/Core/Util/AudioFormat.h +++ b/Core/Util/AudioFormat.h @@ -20,6 +20,7 @@ #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) @@ -71,6 +72,8 @@ 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; diff --git a/Core/Util/AudioFormatNEON.cpp b/Core/Util/AudioFormatNEON.cpp index 4653764b49..b3cc48ee5f 100644 --- a/Core/Util/AudioFormatNEON.cpp +++ b/Core/Util/AudioFormatNEON.cpp @@ -23,7 +23,7 @@ #include "Core/Util/AudioFormat.h" #include "Core/Util/AudioFormatNEON.h" -#if !defined(ARM) && !defined(ARM64) +#if !PPSSPP_ARCH(ARM) && !PPSSPP_ARCH(ARM64) #error Should not be compiled on non-ARM. #endif diff --git a/ext/native/math/fast/fast_math.c b/ext/native/math/fast/fast_math.c index 67506a1823..5363a32830 100644 --- a/ext/native/math/fast/fast_math.c +++ b/ext/native/math/fast/fast_math.c @@ -5,7 +5,7 @@ void InitFastMath(int enableNEON) { // Every architecture has its own define. This needs to be added to. if (enableNEON) { -#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__) +#if PPSSPP_ARCH(ARM_NEON) && !PPSSPP_ARCH(ARM64) fast_matrix_mul_4x4 = &fast_matrix_mul_4x4_neon; #endif } diff --git a/ext/native/math/fast/fast_matrix.h b/ext/native/math/fast/fast_matrix.h index 676ab1acea..41200404f6 100644 --- a/ext/native/math/fast/fast_matrix.h +++ b/ext/native/math/fast/fast_matrix.h @@ -18,6 +18,8 @@ extern void fast_matrix_mul_4x4_sse(float *dest, const float *a, const float *b) #if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) // Hard link to SSE implementations on x86/amd64 #define fast_matrix_mul_4x4 fast_matrix_mul_4x4_sse +#elif PPSSPP_ARCH(ARM64) +#define fast_matrix_mul_4x4 fast_matrix_mul_4x4_c #else extern fptr_fast_matrix_mul_4x4 fast_matrix_mul_4x4; #endif diff --git a/ext/native/math/fast/fast_matrix_neon.S b/ext/native/math/fast/fast_matrix_neon.S index 813b788471..746115314c 100644 --- a/ext/native/math/fast/fast_matrix_neon.S +++ b/ext/native/math/fast/fast_matrix_neon.S @@ -1,5 +1,5 @@ #include "ppsspp_config.h" -#if PPSSPP_ARCH(ARM) && PPSSPP_ARCH(ARM_NEON) +#if PPSSPP_ARCH(ARM_NEON) && !PPSSPP_ARCH(ARM64) .syntax unified // Allow both ARM and Thumb-2 instructions .text