summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-11-13 16:31:13 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-11-13 16:37:29 +0100
commit2af4da0ea9ee0b029e89cf5ab65d378d426d1af1 (patch)
treea9ccdfb1a2620566ddca932ce7135d18934496ca /sc
parent81860b908b0c6104d47886a172b65d8d31f59ec3 (diff)
improve compile time SSE2 detection, fix broken android build
Prereq. to enable runtime SSE2 detection is that the compiler supports it in the first place. MSVS and GCC use different compiler flags for this so use __LO_SSE2_AVAILABLE__ to make this build platform independent. emmintrin.h is unavailable on ARM Android so include this and compile the SSE2 specific code only when we are sure we can build SSE2 code (__LO_SSE2_AVAILABLE__ is defined). Change-Id: I212c4e0b99a314d087b9def822a81325b25f3469
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/inc/arraysumfunctor.hxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/core/inc/arraysumfunctor.hxx b/sc/source/core/inc/arraysumfunctor.hxx
index 776c5143732e..34ccd81aad5b 100644
--- a/sc/source/core/inc/arraysumfunctor.hxx
+++ b/sc/source/core/inc/arraysumfunctor.hxx
@@ -11,9 +11,12 @@
#ifndef INCLUDED_SC_SOURCE_CORE_INC_ARRAYSUMFUNCTOR_HXX
#define INCLUDED_SC_SOURCE_CORE_INC_ARRAYSUMFUNCTOR_HXX
-#include <emmintrin.h>
#include <tools/cpuid.hxx>
+#if defined(__LO_SSE2_AVAILABLE__)
+#include <emmintrin.h>
+#endif
+
namespace sc
{
@@ -67,6 +70,7 @@ public:
private:
inline double executeSSE2(size_t& i, const double* pCurrent) const
{
+#if defined(__LO_SSE2_AVAILABLE__)
double fSum = 0.0;
size_t nRealSize = mnSize - i;
size_t nUnrolledSize = nRealSize - (nRealSize % 8);
@@ -107,6 +111,11 @@ private:
fSum += temp;
}
return fSum;
+#else
+ (void) i;
+ (void) pCurrent;
+ return 0.0;
+#endif
}
inline double executeUnrolled(size_t& i, const double* pCurrent) const