summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/arraysumAVX.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/arraysumAVX.cxx')
-rw-r--r--sc/source/core/tool/arraysumAVX.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/sc/source/core/tool/arraysumAVX.cxx b/sc/source/core/tool/arraysumAVX.cxx
index c55d71f22983..e256248047d0 100644
--- a/sc/source/core/tool/arraysumAVX.cxx
+++ b/sc/source/core/tool/arraysumAVX.cxx
@@ -20,7 +20,9 @@
namespace sc::op
{
-#ifdef LO_AVX_AVAILABLE // Old processors
+#ifdef LO_AVX_AVAILABLE
+
+bool hasAVXCode() { return true; }
using namespace AVX;
@@ -48,13 +50,10 @@ static inline void sumAVX(__m256d& sum, __m256d& err, const __m256d& value)
sum = t;
}
-#endif
-
/** Execute Kahan sum with AVX.
*/
KahanSumSimple executeAVX(size_t& i, size_t nSize, const double* pCurrent)
{
-#ifdef LO_AVX_AVAILABLE
// Make sure we don't fall out of bounds.
// This works by sums of 8 terms.
// So the 8'th term is i+7
@@ -107,14 +106,16 @@ KahanSumSimple executeAVX(size_t& i, size_t nSize, const double* pCurrent)
return { sums[0], errs[0] };
}
return { 0.0, 0.0 };
-#else
- (void)i;
- (void)nSize;
- (void)pCurrent;
- abort();
-#endif
}
+#else // LO_AVX_AVAILABLE
+
+bool hasAVXCode() { return false; }
+
+KahanSumSimple executeAVX(size_t&, size_t, const double*) { abort(); }
+
+#endif
+
} // end namespace sc::op
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */