summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-07-17 21:27:00 +0900
committerTomaž Vajngerl <quikee@gmail.com>2019-07-18 02:28:54 +0200
commitcd5a160f151ee789fb44bd8c07a10e3e291253fe (patch)
tree45f3540d8dbc2671e17c6920cad5059e8df2d988 /include/tools
parent3f6e35d1da493809c900ccddf81db9ffe5936451 (diff)
include supported SIMD intrinsics headers automatically
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 <quikee@gmail.com>
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/simdsupport.hxx26
1 files changed, 18 insertions, 8 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 <emmintrin.h>
+#elif defined(LO_SSSE3_AVAILABLE)
+#include <tmmintrin.h>
+#elif defined(LO_AVX_AVAILABLE) || defined(LO_AVX2_AVAILABLE)
+#include <immintrin.h>
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */