From 5db12ca54d5177e076e0b8d77dfbd06bac6cbbc6 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Sun, 18 Dec 2016 10:02:01 +0100 Subject: [PATCH] Fix arch detection for fast_matrix_mul Needed for iOS Simulator build --- CMakeLists.txt | 11 ++--------- ext/native/math/fast/fast_matrix.h | 5 ++++- ext/native/math/fast/fast_matrix_sse.c | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 909b897993..ec8a780429 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -714,15 +714,6 @@ endif() set(nativeExtra) set(nativeExtraLibs) -if(ARMV7) - set(nativeExtra ${nativeExtra} - ext/native/math/fast/fast_matrix_neon.S) -endif() -if((X86 OR X86_64) AND NOT MIPS) - set(nativeExtra ${nativeExtra} - ext/native/math/fast/fast_matrix_sse.c) -endif() - if(ANDROID) set(nativeExtra ${nativeExtra} @@ -956,6 +947,8 @@ add_library(native STATIC ext/native/input/input_state.cpp ext/native/math/fast/fast_math.c ext/native/math/fast/fast_matrix.c + ext/native/math/fast/fast_matrix_neon.S + ext/native/math/fast/fast_matrix_sse.c ext/native/math/curves.cpp ext/native/math/curves.h ext/native/math/expression_parser.cpp diff --git a/ext/native/math/fast/fast_matrix.h b/ext/native/math/fast/fast_matrix.h index 968739ba0b..676ab1acea 100644 --- a/ext/native/math/fast/fast_matrix.h +++ b/ext/native/math/fast/fast_matrix.h @@ -1,5 +1,7 @@ #pragma once +#include "ppsspp_config.h" + #ifdef __cplusplus extern "C" { #endif @@ -13,7 +15,8 @@ extern void fast_matrix_mul_4x4_c(float *dest, const float *a, const float *b); extern void fast_matrix_mul_4x4_neon(float *dest, const float *a, const float *b); extern void fast_matrix_mul_4x4_sse(float *dest, const float *a, const float *b); -#if defined(_M_IX86) || defined(_M_X64) // Hard link to SSE implementations on x86 +#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 #else extern fptr_fast_matrix_mul_4x4 fast_matrix_mul_4x4; diff --git a/ext/native/math/fast/fast_matrix_sse.c b/ext/native/math/fast/fast_matrix_sse.c index 9de79ce760..3b79dcdd4b 100644 --- a/ext/native/math/fast/fast_matrix_sse.c +++ b/ext/native/math/fast/fast_matrix_sse.c @@ -1,6 +1,6 @@ -#include "base/arch.h" +#include "ppsspp_config.h" -#if defined(_M_IX86) || defined(_M_X64) +#if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) #include