Get code to compile with older VS with partial AVX2 support.

This is inspired by
https://aomedia.googlesource.com/aom/+/b2f80f721fe87547e3bae73be550e3d75ba478ad/aom_ports/msvc.h#57
This was reported on https://github.com/opencv/opencv/pull/28139

Change-Id: Iad38d842ef1647fc1a578a851b3593281855e30e
This commit is contained in:
Vincent Rabaud
2025-12-08 10:20:49 +01:00
parent 934b7d7448
commit d7af7dd7cb

View File

@@ -94,6 +94,17 @@
#define WEBP_HAVE_AVX2
#endif
#if defined(WEBP_MSC_AVX2) && _MSC_VER <= 1900
#include <immintrin.h>
static WEBP_INLINE int _mm256_extract_epi32(__m256i a, const int i) {
return a.m256i_i32[i & 7];
}
static WEBP_INLINE int _mm256_cvtsi256_si32(__m256i a) {
return _mm256_extract_epi32(a, 0);
}
#endif
#undef WEBP_MSC_AVX2
#undef WEBP_MSC_SSE41
#undef WEBP_MSC_SSE2