mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #26109 from WanliZhong:univ_intrin_operator2warpper
Replace operators with wrapper functions on universal intrinsics backends #26109 This PR aims to replace the operators(logic, arithmetic, bit) with wrapper functions(v_add, v_eq, v_and...) ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
@@ -2618,8 +2618,8 @@ public:
|
||||
v_uint32 r0, r1, r2, r3;
|
||||
v_expand(vx_load(S0), r0, r1);
|
||||
v_expand(vx_load(S1), r2, r3);
|
||||
r0 += r2; r1 += r3;
|
||||
v_rshr_pack_store<2>(D, r0 + v_rotate_left<1>(r1, r0));
|
||||
r0 = v_add(r0, r2); r1 = v_add(r1, r3);
|
||||
v_rshr_pack_store<2>(D, v_add(r0, v_rotate_left<1>(r1, r0)));
|
||||
}
|
||||
#else
|
||||
v_rshr_pack_store<2>(D, v_add(v_add(v_add(v_load_expand(S0), v_load_expand(S0 + 3)), v_load_expand(S1)), v_load_expand(S1 + 3)));
|
||||
|
||||
@@ -130,9 +130,9 @@ struct Integral_SIMD<uchar, int, double>
|
||||
el8 = v_add(el8, v_rotate_left<1>(el8));
|
||||
el8 = v_add(el8, v_rotate_left<2>(el8));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8 += v_rotate_left<4>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<4>(el8));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8 += v_rotate_left<8>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<8>(el8));
|
||||
#endif
|
||||
#endif
|
||||
v_expand(el8, el4l, el4h);
|
||||
@@ -188,11 +188,11 @@ struct Integral_SIMD<uchar, int, double>
|
||||
el8_1 = v_add(el8_1, v_rotate_left<2>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<2>(el8_2));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8_1 += v_rotate_left<4>(el8_1);
|
||||
el8_2 += v_rotate_left<4>(el8_2);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<4>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<4>(el8_2));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8_1 += v_rotate_left<8>(el8_1);
|
||||
el8_2 += v_rotate_left<8>(el8_2);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<8>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<8>(el8_2));
|
||||
#endif
|
||||
#endif
|
||||
v_expand(el8_1, el4l_1, el4h_1);
|
||||
@@ -350,9 +350,9 @@ struct Integral_SIMD<uchar, int, double>
|
||||
prev.val = _mm256_permute2x128_si256(el4h.val, el4h.val, 0x31);
|
||||
#else
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8 += v_rotate_left<4>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<4>(el8));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8 += v_rotate_left<8>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<8>(el8));
|
||||
#endif
|
||||
#endif
|
||||
v_expand(el8, el4l, el4h);
|
||||
@@ -364,7 +364,7 @@ struct Integral_SIMD<uchar, int, double>
|
||||
prev = v_combine_high(el4h, el4h);
|
||||
#else
|
||||
v_int32 t = v_rotate_right<12>(el4h);
|
||||
t |= v_rotate_left<4>(t);
|
||||
t = v_or(t, v_rotate_left<4>(t));
|
||||
prev = v_combine_low(t, t);
|
||||
#endif
|
||||
#endif
|
||||
@@ -442,9 +442,9 @@ struct Integral_SIMD<uchar, float, double>
|
||||
el8 = v_add(el8, v_rotate_left<1>(el8));
|
||||
el8 = v_add(el8, v_rotate_left<2>(el8));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8 += v_rotate_left<4>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<4>(el8));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8 += v_rotate_left<8>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<8>(el8));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li, el4hi;
|
||||
@@ -501,11 +501,11 @@ struct Integral_SIMD<uchar, float, double>
|
||||
el8_1 = v_add(el8_1, v_rotate_left<2>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<2>(el8_2));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8_1 += v_rotate_left<4>(el8_1);
|
||||
el8_2 += v_rotate_left<4>(el8_2);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<4>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<4>(el8_2));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8_1 += v_rotate_left<8>(el8_1);
|
||||
el8_2 += v_rotate_left<8>(el8_2);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<8>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<8>(el8_2));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li_1, el4hi_1, el4li_2, el4hi_2;
|
||||
@@ -590,13 +590,13 @@ struct Integral_SIMD<uchar, float, double>
|
||||
el8_2 = v_add(el8_2, v_rotate_left<2>(el8_2));
|
||||
el8_3 = v_add(el8_3, v_rotate_left<2>(el8_3));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8_1 += v_rotate_left<4>(el8_1);
|
||||
el8_2 += v_rotate_left<4>(el8_2);
|
||||
el8_3 += v_rotate_left<4>(el8_3);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<4>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<4>(el8_2));
|
||||
el8_3 = v_add(el8_3, v_rotate_left<4>(el8_3));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8_1 += v_rotate_left<8>(el8_1);
|
||||
el8_2 += v_rotate_left<8>(el8_2);
|
||||
el8_3 += v_rotate_left<8>(el8_3);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<8>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<8>(el8_2));
|
||||
el8_3 = v_add(el8_3, v_rotate_left<8>(el8_3));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li_1, el4hi_1, el4li_2, el4hi_2, el4li_3, el4hi_3;
|
||||
@@ -663,9 +663,9 @@ struct Integral_SIMD<uchar, float, double>
|
||||
prev.val = _mm256_permute2f128_ps(el4h.val, el4h.val, 0x31);
|
||||
#else
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8 += v_rotate_left<4>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<4>(el8));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8 += v_rotate_left<8>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<8>(el8));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li, el4hi;
|
||||
@@ -678,7 +678,7 @@ struct Integral_SIMD<uchar, float, double>
|
||||
prev = v_combine_high(el4h, el4h);
|
||||
#else
|
||||
v_float32 t = v_rotate_right<12>(el4h);
|
||||
t |= v_rotate_left<4>(t);
|
||||
t = v_or(t, v_rotate_left<4>(t));
|
||||
prev = v_combine_low(t, t);
|
||||
#endif
|
||||
#endif
|
||||
@@ -770,9 +770,9 @@ struct Integral_SIMD<uchar, double, double>
|
||||
el8 = v_add(el8, v_rotate_left<1>(el8));
|
||||
el8 = v_add(el8, v_rotate_left<2>(el8));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8 += v_rotate_left<4>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<4>(el8));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8 += v_rotate_left<8>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<8>(el8));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li, el4hi;
|
||||
@@ -843,11 +843,11 @@ struct Integral_SIMD<uchar, double, double>
|
||||
el8_1 = v_add(el8_1, v_rotate_left<2>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<2>(el8_2));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8_1 += v_rotate_left<4>(el8_1);
|
||||
el8_2 += v_rotate_left<4>(el8_2);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<4>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<4>(el8_2));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8_1 += v_rotate_left<8>(el8_1);
|
||||
el8_2 += v_rotate_left<8>(el8_2);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<8>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<8>(el8_2));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li_1, el4hi_1, el4li_2, el4hi_2;
|
||||
@@ -958,13 +958,13 @@ struct Integral_SIMD<uchar, double, double>
|
||||
el8_2 = v_add(el8_2, v_rotate_left<2>(el8_2));
|
||||
el8_3 = v_add(el8_3, v_rotate_left<2>(el8_3));
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8_1 += v_rotate_left<4>(el8_1);
|
||||
el8_2 += v_rotate_left<4>(el8_2);
|
||||
el8_3 += v_rotate_left<4>(el8_3);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<4>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<4>(el8_2));
|
||||
el8_3 = v_add(el8_3, v_rotate_left<4>(el8_3));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8_1 += v_rotate_left<8>(el8_1);
|
||||
el8_2 += v_rotate_left<8>(el8_2);
|
||||
el8_3 += v_rotate_left<8>(el8_3);
|
||||
el8_1 = v_add(el8_1, v_rotate_left<8>(el8_1));
|
||||
el8_2 = v_add(el8_2, v_rotate_left<8>(el8_2));
|
||||
el8_3 = v_add(el8_3, v_rotate_left<8>(el8_3));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li_1, el4hi_1, el4li_2, el4hi_2, el4li_3, el4hi_3;
|
||||
@@ -1058,9 +1058,9 @@ struct Integral_SIMD<uchar, double, double>
|
||||
prev_1.val = prev_2.val = el4hh.val;
|
||||
#else
|
||||
#if CV_SIMD_WIDTH >= 32
|
||||
el8 += v_rotate_left<4>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<4>(el8));
|
||||
#if CV_SIMD_WIDTH == 64
|
||||
el8 += v_rotate_left<8>(el8);
|
||||
el8 = v_add(el8, v_rotate_left<8>(el8));
|
||||
#endif
|
||||
#endif
|
||||
v_int32 el4li, el4hi;
|
||||
|
||||
Reference in New Issue
Block a user