diff --git a/intel/filter_sse2_intrinsics.c b/intel/filter_sse2_intrinsics.c index 01fea3cc1..9e7484923 100644 --- a/intel/filter_sse2_intrinsics.c +++ b/intel/filter_sse2_intrinsics.c @@ -14,11 +14,7 @@ #if PNG_INTEL_SSE_OPT > 0 -#if defined(_MSC_VER) && defined(_WIN64) -#include -#else -#include -#endif +#include // Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d). // They're positioned like this: diff --git a/pngpriv.h b/pngpriv.h index cf7b29974..f5c02de42 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -183,9 +183,12 @@ #endif /* PNG_ARM_NEON_OPT > 0 */ #ifndef PNG_INTEL_SSE_OPT -# if defined(__SSE4_1__) +# 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(__SSE3__) || defined(__SSSE3__) +# elif defined(__SSSE3__) # define PNG_INTEL_SSE_OPT 2 # elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)