From 84fcc4ab9b6e4dee5f8e64d8a04ec601713636ee Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Mon, 8 Mar 2021 19:13:12 +0000 Subject: [PATCH] core:ppc64 fix the build with the newer versions of Eigen on IBM/Power It also fixes the build when universal intrinsics is disabled via `-DDCV_ENABLE_INTRINSICS=OFF`. --- modules/core/include/opencv2/core/fast_math.hpp | 3 +++ modules/core/include/opencv2/core/vsx_utils.hpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/fast_math.hpp b/modules/core/include/opencv2/core/fast_math.hpp index 0f53cf5c1b90..eb4fbe213bb4 100644 --- a/modules/core/include/opencv2/core/fast_math.hpp +++ b/modules/core/include/opencv2/core/fast_math.hpp @@ -76,6 +76,9 @@ #if defined __PPC64__ && defined __GNUC__ && defined _ARCH_PWR8 \ && !defined(OPENCV_SKIP_INCLUDE_ALTIVEC_H) #include + #undef vector + #undef bool + #undef pixel #endif #if defined(CV_INLINE_ROUND_FLT) diff --git a/modules/core/include/opencv2/core/vsx_utils.hpp b/modules/core/include/opencv2/core/vsx_utils.hpp index d7962517df6f..68863ffb36f2 100644 --- a/modules/core/include/opencv2/core/vsx_utils.hpp +++ b/modules/core/include/opencv2/core/vsx_utils.hpp @@ -497,11 +497,13 @@ VSX_IMPL_CONV_EVEN_2_4(vec_uint4, vec_double2, vec_ctu, vec_ctuo) VSX_FINLINE(rt) fnm(const rg& a, int only_truncate) \ { \ assert(only_truncate == 0); \ - CV_UNUSED(only_truncate); \ + CV_UNUSED(only_truncate); \ return fn2(a); \ } VSX_IMPL_CONV_2VARIANT(vec_int4, vec_float4, vec_cts, vec_cts) + VSX_IMPL_CONV_2VARIANT(vec_uint4, vec_float4, vec_ctu, vec_ctu) VSX_IMPL_CONV_2VARIANT(vec_float4, vec_int4, vec_ctf, vec_ctf) + VSX_IMPL_CONV_2VARIANT(vec_float4, vec_uint4, vec_ctf, vec_ctf) // define vec_cts for converting double precision to signed doubleword // which isn't compatible with xlc but its okay since Eigen only uses it for gcc VSX_IMPL_CONV_2VARIANT(vec_dword2, vec_double2, vec_cts, vec_ctsl)