From 5072584781121be88203bf8b9864cd3737741141 Mon Sep 17 00:00:00 2001 From: driver1998 Date: Sat, 4 May 2019 05:37:28 +0800 Subject: [PATCH] Fix neon headers for MSVC ARM64 MSVC uses arm64_neon.h for ARM64, arm_neon.h is ARM32 only. --- Common/ColorConvNEON.cpp | 4 ++++ Core/HW/StereoResampler.cpp | 4 ++++ Core/MIPS/IR/IRInterpreter.cpp | 4 ++++ Core/Util/AudioFormatNEON.cpp | 4 ++++ GPU/Common/TextureCacheCommon.cpp | 4 ++++ GPU/Common/TextureDecoderNEON.cpp | 4 ++++ GPU/GPUState.cpp | 4 ++++ ext/native/ext/libpng17/arm/filter_neon_intrinsics.c | 4 ++++ ext/native/math/dataconv.h | 6 +++++- 9 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Common/ColorConvNEON.cpp b/Common/ColorConvNEON.cpp index 3f6b235619..46a5cea5fd 100644 --- a/Common/ColorConvNEON.cpp +++ b/Common/ColorConvNEON.cpp @@ -18,7 +18,11 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include +#endif #include "ColorConvNEON.h" #include "Common.h" #include "CPUDetect.h" diff --git a/Core/HW/StereoResampler.cpp b/Core/HW/StereoResampler.cpp index 8b2fcfadd1..843c89c009 100644 --- a/Core/HW/StereoResampler.cpp +++ b/Core/HW/StereoResampler.cpp @@ -47,8 +47,12 @@ #include #endif #if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include #endif +#endif StereoResampler::StereoResampler() : m_bufsize(MAX_SAMPLES_DEFAULT) diff --git a/Core/MIPS/IR/IRInterpreter.cpp b/Core/MIPS/IR/IRInterpreter.cpp index 045b69f469..29e34249a9 100644 --- a/Core/MIPS/IR/IRInterpreter.cpp +++ b/Core/MIPS/IR/IRInterpreter.cpp @@ -10,8 +10,12 @@ #endif #if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include #endif +#endif #include "Core/Core.h" #include "Core/CoreTiming.h" diff --git a/Core/Util/AudioFormatNEON.cpp b/Core/Util/AudioFormatNEON.cpp index b3cc48ee5f..78c154c365 100644 --- a/Core/Util/AudioFormatNEON.cpp +++ b/Core/Util/AudioFormatNEON.cpp @@ -18,7 +18,11 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include +#endif #include "Common/Common.h" #include "Core/Util/AudioFormat.h" #include "Core/Util/AudioFormatNEON.h" diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 2da10add47..971fdfb645 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -35,8 +35,12 @@ #include #endif #if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include #endif +#endif // Videos should be updated every few frames, so we forget quickly. #define VIDEO_DECIMATE_AGE 4 diff --git a/GPU/Common/TextureDecoderNEON.cpp b/GPU/Common/TextureDecoderNEON.cpp index 2a4d065721..481144015d 100644 --- a/GPU/Common/TextureDecoderNEON.cpp +++ b/GPU/Common/TextureDecoderNEON.cpp @@ -21,7 +21,11 @@ #include "ext/xxhash.h" +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include +#endif #include "GPU/GPUState.h" #include "GPU/Common/TextureDecoder.h" diff --git a/GPU/GPUState.cpp b/GPU/GPUState.cpp index 7e3f3812ef..5ac8b8013a 100644 --- a/GPU/GPUState.cpp +++ b/GPU/GPUState.cpp @@ -28,8 +28,12 @@ #include #endif #if PPSSPP_ARCH(ARM_NEON) +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include #endif +#endif // This must be aligned so that the matrices within are aligned. alignas(16) GPUgstate gstate; diff --git a/ext/native/ext/libpng17/arm/filter_neon_intrinsics.c b/ext/native/ext/libpng17/arm/filter_neon_intrinsics.c index e7a09f4364..09c2516a60 100644 --- a/ext/native/ext/libpng17/arm/filter_neon_intrinsics.c +++ b/ext/native/ext/libpng17/arm/filter_neon_intrinsics.c @@ -17,7 +17,11 @@ /* This code requires -mfpu=neon on the command line: */ #if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */ +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include +#endif /* libpng row pointers are not necessarily aligned to any particular boundary, * however this code will only work with appropriate alignment. arm/arm_init.c diff --git a/ext/native/math/dataconv.h b/ext/native/math/dataconv.h index 30619fc3f9..fafe6a4a44 100644 --- a/ext/native/math/dataconv.h +++ b/ext/native/math/dataconv.h @@ -10,8 +10,12 @@ #include #endif #if PPSSPP_PLATFORM(ARM_NEON) +#if defined(_MSC_VER) && defined(_M_ARM64) +#include +#else #include #endif +#endif extern const float one_over_255_x4[4]; @@ -160,4 +164,4 @@ inline void ExpandFloat24x3ToFloat4(float dest[4], const uint32_t src[3]) { inline uint32_t BytesToUint32(uint8_t a, uint8_t b, uint8_t c, uint8_t d) { return (a) | (b << 8) | (c << 16) | (d << 24); -} \ No newline at end of file +}