From f8f9f3c43851695726bf32d07bbd176a082755fd Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Mon, 18 Oct 2021 14:56:15 +0200 Subject: [PATCH] fixed AVX compile error Some older compilers do not allow to pass a `const int` as an immediate. Use an unnamed enum instead. --- modules/core/include/opencv2/core/hal/intrin_avx.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/hal/intrin_avx.hpp b/modules/core/include/opencv2/core/hal/intrin_avx.hpp index 54e8927192..09ff566473 100644 --- a/modules/core/include/opencv2/core/hal/intrin_avx.hpp +++ b/modules/core/include/opencv2/core/hal/intrin_avx.hpp @@ -2379,7 +2379,7 @@ inline void v_load_deinterleave( const unsigned* ptr, v_uint32x8& a, v_uint32x8& __m256i ab0 = _mm256_loadu_si256((const __m256i*)ptr); __m256i ab1 = _mm256_loadu_si256((const __m256i*)(ptr + 8)); - const int sh = 0+2*4+1*16+3*64; + enum { sh = 0+2*4+1*16+3*64 }; __m256i p0 = _mm256_shuffle_epi32(ab0, sh); __m256i p1 = _mm256_shuffle_epi32(ab1, sh); __m256i pl = _mm256_permute2x128_si256(p0, p1, 0 + 2*16);