From cd5a160f151ee789fb44bd8c07a10e3e291253fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Wed, 17 Jul 2019 21:27:00 +0900 Subject: [PATCH] include supported SIMD intrinsics headers automatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we include simdsupport.hxx, this now includes the supported intrinsics headers automatically, so this removes the need to do it ourselves. Change-Id: Icc406316a7e27b7b5fd5905f51664f4fe47e5468 Reviewed-on: https://gerrit.libreoffice.org/75783 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/tools/simdsupport.hxx | 26 ++++++++++++++++++-------- sc/source/core/inc/arraysumfunctor.hxx | 8 -------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/include/tools/simdsupport.hxx b/include/tools/simdsupport.hxx index 74afc9300b1a..4ef7a698089e 100644 --- a/include/tools/simdsupport.hxx +++ b/include/tools/simdsupport.hxx @@ -24,7 +24,7 @@ // SSE2 is required for X64 #if (defined(_M_X64) || defined(_M_IX86_FP) && _M_IX86_FP >= 2) #define LO_SSE2_AVAILABLE -#endif +#endif // end SSE2 // compiled with /arch:AVX #if defined(__AVX__) @@ -33,30 +33,40 @@ #endif #define LO_SSSE3_AVAILABLE #define LO_AVX_AVAILABLE -#endif +#endif // defined(__AVX__) // compiled with /arch:AVX2 #if defined(__AVX2__) #define LO_AVX2_AVAILABLE -#endif +#endif // defined(__AVX2__) -#else // Clang and GCC +#else // compiler Clang and GCC #if defined(__SSE2__) || defined(__x86_64__) // SSE2 is required for X64 #define LO_SSE2_AVAILABLE -#endif +#endif // defined(__SSE2__) #if defined(__SSSE3__) #define LO_SSSE3_AVAILABLE -#endif +#endif // defined(__SSSE3__) + #if defined(__AVX__) #define LO_AVX_AVAILABLE +#endif // defined(__AVX__) -#endif #if defined(__AVX2__) #define LO_AVX2_AVAILABLE -#endif +#endif // defined(__AVX2__) +#endif // end compiler Clang and GCC + +// If we detect any SIMD intrinsics, include the headers automatically +#if defined(LO_SSE2_AVAILABLE) +#include +#elif defined(LO_SSSE3_AVAILABLE) +#include +#elif defined(LO_AVX_AVAILABLE) || defined(LO_AVX2_AVAILABLE) +#include #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/inc/arraysumfunctor.hxx b/sc/source/core/inc/arraysumfunctor.hxx index b4da4d9d4064..7ef8a7face05 100644 --- a/sc/source/core/inc/arraysumfunctor.hxx +++ b/sc/source/core/inc/arraysumfunctor.hxx @@ -18,14 +18,6 @@ #include #include -#if defined(LO_SSE2_AVAILABLE) -#ifdef _WIN32 -#include -#else -#include -#endif -#endif - namespace sc {