From fc3ff5853c18173592ce98118cb74c655eb27673 Mon Sep 17 00:00:00 2001 From: Xele02 Date: Thu, 13 Dec 2012 22:45:13 +0100 Subject: [PATCH] Update for android build --- Common/MathUtil.cpp | 10 ++++++++-- Common/MathUtil.h | 7 +++++++ android/jni/Android.mk | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Common/MathUtil.cpp b/Common/MathUtil.cpp index bc06cdac07..6225afa6be 100644 --- a/Common/MathUtil.cpp +++ b/Common/MathUtil.cpp @@ -22,10 +22,10 @@ #include namespace { - +#ifdef USE_SSE static u32 saved_sse_state = _mm_getcsr(); static const u32 default_sse_state = _mm_getcsr(); - +#endif } namespace MathUtil @@ -116,19 +116,25 @@ namespace MathUtil void LoadDefaultSSEState() { +#ifdef USE_SSE _mm_setcsr(default_sse_state); +#endif } void LoadSSEState() { +#ifdef USE_SSE _mm_setcsr(saved_sse_state); +#endif } void SaveSSEState() { +#ifdef USE_SSE saved_sse_state = _mm_getcsr(); +#endif } inline void MatrixMul(int n, const float *a, const float *b, float *result) diff --git a/Common/MathUtil.h b/Common/MathUtil.h index 4c5675bbc7..77aa57e8ec 100644 --- a/Common/MathUtil.h +++ b/Common/MathUtil.h @@ -20,7 +20,14 @@ #include "Common.h" +#ifndef ANDROID +#define USE_SSE +#endif + +#ifdef USE_SSE #include +#endif + #include namespace MathUtil diff --git a/android/jni/Android.mk b/android/jni/Android.mk index b691f6b076..1839645a4d 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -66,6 +66,7 @@ LOCAL_SRC_FILES := \ $(SRC)/Common/Timer.cpp \ $(SRC)/Common/ThunkARM.cpp \ $(SRC)/Common/Misc.cpp \ + $(SRC)/Common/MathUtil.cpp \ $(SRC)/GPU/Math3D.cpp \ $(SRC)/GPU/GPUState.cpp \ $(SRC)/GPU/GLES/Framebuffer.cpp \