diff options
-rw-r--r-- | meta-oe/recipes-support/opencv/opencv/0001-core-fixed-VSX-intrinsics-implementation.patch | 61 | ||||
-rw-r--r-- | meta-oe/recipes-support/opencv/opencv_4.11.0.bb | 7 |
2 files changed, 68 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-core-fixed-VSX-intrinsics-implementation.patch b/meta-oe/recipes-support/opencv/opencv/0001-core-fixed-VSX-intrinsics-implementation.patch new file mode 100644 index 0000000000..9fc89e4244 --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/0001-core-fixed-VSX-intrinsics-implementation.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 97f3f390661f2fd1168336820b89eb4383ce8528 Mon Sep 17 00:00:00 2001 | ||
2 | From: Maksim Shabunin <maksim.shabunin@gmail.com> | ||
3 | Date: Fri, 10 Jan 2025 18:34:11 +0300 | ||
4 | Subject: [PATCH] core: fixed VSX intrinsics implementation | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | [https://github.com/opencv/opencv/commit/97f3f390661f2fd1168336820b89eb4383ce8528] | ||
8 | |||
9 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
10 | --- | ||
11 | modules/core/include/opencv2/core/hal/intrin_vsx.hpp | 10 +++++----- | ||
12 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
13 | |||
14 | diff --git a/modules/core/include/opencv2/core/hal/intrin_vsx.hpp b/modules/core/include/opencv2/core/hal/intrin_vsx.hpp | ||
15 | index 2157e1e870..0a0915a22f 100644 | ||
16 | --- a/modules/core/include/opencv2/core/hal/intrin_vsx.hpp | ||
17 | +++ b/modules/core/include/opencv2/core/hal/intrin_vsx.hpp | ||
18 | @@ -262,7 +262,7 @@ OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_float64x2, double) | ||
19 | inline _Tpvec v_setzero_##suffix() { return _Tpvec(vec_splats((_Tp)0)); } \ | ||
20 | inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(vec_splats((_Tp)v));} \ | ||
21 | template <> inline _Tpvec v_setzero_() { return v_setzero_##suffix(); } \ | ||
22 | -template <> inline _Tpvec v_setall_(_Tp v) { return v_setall_##suffix(_Tp v); } \ | ||
23 | +template <> inline _Tpvec v_setall_(_Tp v) { return v_setall_##suffix(v); } \ | ||
24 | template<typename _Tpvec0> inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0 &a) \ | ||
25 | { return _Tpvec((cast)a.val); } | ||
26 | |||
27 | @@ -650,11 +650,11 @@ OPENCV_HAL_IMPL_VSX_SELECT(v_float64x2, vec_bdword2_c) | ||
28 | #define OPENCV_HAL_IMPL_VSX_INT_CMP_OP(_Tpvec) \ | ||
29 | inline _Tpvec v_eq(const _Tpvec& a, const _Tpvec& b) \ | ||
30 | { return _Tpvec(vec_cmpeq(a.val, b.val)); } \ | ||
31 | -inline _Tpvec V_ne(const _Tpvec& a, const _Tpvec& b) \ | ||
32 | +inline _Tpvec v_ne(const _Tpvec& a, const _Tpvec& b) \ | ||
33 | { return _Tpvec(vec_cmpne(a.val, b.val)); } \ | ||
34 | inline _Tpvec v_lt(const _Tpvec& a, const _Tpvec& b) \ | ||
35 | { return _Tpvec(vec_cmplt(a.val, b.val)); } \ | ||
36 | -inline _Tpvec V_gt(const _Tpvec& a, const _Tpvec& b) \ | ||
37 | +inline _Tpvec v_gt(const _Tpvec& a, const _Tpvec& b) \ | ||
38 | { return _Tpvec(vec_cmpgt(a.val, b.val)); } \ | ||
39 | inline _Tpvec v_le(const _Tpvec& a, const _Tpvec& b) \ | ||
40 | { return _Tpvec(vec_cmple(a.val, b.val)); } \ | ||
41 | @@ -1507,7 +1507,7 @@ inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, cons | ||
42 | inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b) | ||
43 | { return v_dotprod(a, b); } | ||
44 | inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) | ||
45 | -{ return v_int32x4(vec_msum(a.val, b.val, vec_int4_z)) + c; } | ||
46 | +{ return v_add(v_int32x4(vec_msum(a.val, b.val, vec_int4_z)), c); } | ||
47 | // 32 >> 64 | ||
48 | inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b) | ||
49 | { return v_dotprod(a, b); } | ||
50 | @@ -1518,7 +1518,7 @@ inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_ | ||
51 | inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b) | ||
52 | { return v_dotprod_expand(a, b); } | ||
53 | inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) | ||
54 | -{ return v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)) + c; } | ||
55 | +{ return v_add(v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)), c); } | ||
56 | |||
57 | inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b) | ||
58 | { | ||
59 | -- | ||
60 | 2.25.1 | ||
61 | |||
diff --git a/meta-oe/recipes-support/opencv/opencv_4.11.0.bb b/meta-oe/recipes-support/opencv/opencv_4.11.0.bb index 07b3a9d9e6..1613b6a3ed 100644 --- a/meta-oe/recipes-support/opencv/opencv_4.11.0.bb +++ b/meta-oe/recipes-support/opencv/opencv_4.11.0.bb | |||
@@ -31,6 +31,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=ht | |||
31 | file://download.patch \ | 31 | file://download.patch \ |
32 | file://0001-Make-ts-module-external.patch \ | 32 | file://0001-Make-ts-module-external.patch \ |
33 | file://0008-Do-not-embed-build-directory-in-binaries.patch \ | 33 | file://0008-Do-not-embed-build-directory-in-binaries.patch \ |
34 | file://0001-core-fixed-VSX-intrinsics-implementation.patch \ | ||
34 | " | 35 | " |
35 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" | 36 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" |
36 | 37 | ||
@@ -208,4 +209,10 @@ do_install:append() { | |||
208 | if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then | 209 | if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then |
209 | rm -rf ${D}${bindir}/setup_vars_opencv4.sh | 210 | rm -rf ${D}${bindir}/setup_vars_opencv4.sh |
210 | fi | 211 | fi |
212 | |||
213 | for fn in arithm.vsx3.cpp convert.vsx3.cpp; do | ||
214 | if [ -f ${B}/modules/core/$fn ]; then | ||
215 | sed -i -e 's,${S},/usr/src/debug/${PN}/${PV},g' ${B}/modules/core/$fn | ||
216 | fi | ||
217 | done | ||
211 | } | 218 | } |