summaryrefslogtreecommitdiff
path: root/pngpriv.h
diff options
context:
space:
mode:
authorMatt Sarett <msarett@google.com>2016-02-17 11:43:34 -0500
committerMatt Sarett <msarett@google.com>2016-02-17 11:43:34 -0500
commit9a308a3344e395e79858716a65296cfb47a81ca1 (patch)
treed3a8b2da8d6024d925d0d686226a15767452500f /pngpriv.h
parent5bc58a0ebccc3cea72ddb4c6cbde6fd1925bc7ca (diff)
downloadlibpng-9a308a3344e395e79858716a65296cfb47a81ca1.tar.gz
Add intel opts to Makefile and configure.ac
Diffstat (limited to 'pngpriv.h')
-rw-r--r--pngpriv.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/pngpriv.h b/pngpriv.h
index f5c02de42..a402704f8 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -183,21 +183,33 @@
#endif /* PNG_ARM_NEON_OPT > 0 */
#ifndef PNG_INTEL_SSE_OPT
-# if defined(__SSE4_1__) || defined(__AVX__)
- /* We are not actually using AVX, but checking for AVX is the best
- way we can detect SSE4.1 and SSSE3 on MSVC.
- */
-# define PNG_INTEL_SSE_OPT 3
-# elif defined(__SSSE3__)
-# define PNG_INTEL_SSE_OPT 2
-# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
+ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
# define PNG_INTEL_SSE_OPT 1
# endif
#endif
#if PNG_INTEL_SSE_OPT > 0
-# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
+# ifndef PNG_INTEL_SSE_IMPLEMENTATION
+# if defined(__SSE4_1__) || defined(__AVX__)
+ /* We are not actually using AVX, but checking for AVX is the best
+ way we can detect SSE4.1 and SSSE3 on MSVC.
+ */
+# define PNG_INTEL_SSE_IMPLEMENTATION 3
+# elif defined(__SSSE3__)
+# define PNG_INTEL_SSE_IMPLEMENTATION 2
+# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+# define PNG_INTEL_SSE_IMPLEMENTATION 1
+# else
+# define PNG_INTEL_SSE_IMPLEMENTATION 0
+# endif
+# endif
+
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
+# endif
#endif
/* Is this a build of a DLL where compilation of the object modules requires