Skip to content

Optimize the cvCeil and cvFloor functions for LoongArch#22040

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
CNClareChen:4.x
Sep 13, 2022
Merged

Optimize the cvCeil and cvFloor functions for LoongArch#22040
asmorkalov merged 1 commit intoopencv:4.xfrom
CNClareChen:4.x

Conversation

@CNClareChen
Copy link
Copy Markdown
Contributor

@CNClareChen CNClareChen commented May 26, 2022

This patch optimizes the cvCeil and cvFloor functions on
the LoongArch platform.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • 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

@asmorkalov
Copy link
Copy Markdown
Contributor

Relates to #21833

@vpisarev
Copy link
Copy Markdown
Contributor

vpisarev commented Aug 5, 2022

@CNClareChen, thank you! I wonder, if (int)__builtin_floor(value), (int)__builtin_ceil(value), (int)__builtin_floorf(value), (int)__builtin_ceilf(value) produce equivalent code on LoongArch?

@CNClareChen
Copy link
Copy Markdown
Contributor Author

CNClareChen commented Aug 10, 2022

@CNClareChen, thank you! I wonder, if (int)__builtin_floor(value), (int)__builtin_ceil(value), (int)__builtin_floorf(value), (int)__builtin_ceilf(value) produce equivalent code on LoongArch?

@vpisarev thanks, these _builtin finterfaces are not currently integrated in the compiler for the LoongArch platform. Therefore, in OpencV I use the way of embedded assembly to achieve these functions quickly.

@fengyuentau fengyuentau changed the title Optimize the cvCeil and cvFloor functions. Optimize the cvCeil and cvFloor functions for LoongArch Sep 9, 2022
@asmorkalov
Copy link
Copy Markdown
Contributor

@CNClareChen @fengyuentau The base PR for loongArch support has been merged. Please rebase the PR and fix merge conflicts.

@asmorkalov
Copy link
Copy Markdown
Contributor

@fengyuentau Could you sqaush commits? "Merge branch '4.x' into 4.x" - it'll be merged to history too.

@fengyuentau
Copy link
Copy Markdown
Member

I could but I do not know the safe way to do this without dropping @CNClareChen 's status as a contributor.

@asmorkalov
Copy link
Copy Markdown
Contributor

@CNClareChen could you squash commits on your side?

@CNClareChen
Copy link
Copy Markdown
Contributor Author

CNClareChen commented Sep 12, 2022 via email

@CNClareChen
Copy link
Copy Markdown
Contributor Author

@asmorkalov Now, this patch is merged. Should I resubmit a patch to modifies the commits?

This patch optimizes the cvCeil and cvFloor functions on
the LoongArch platform.

Signed-off-by: Hao Chen <chenhao@loongson.cn>
@asmorkalov
Copy link
Copy Markdown
Contributor

@CNClareChen I apologize, I disoriented you. Yuantao merged upstream 4.x to your branch, but not rebase it. It leads to incompatible commit history in you branch and upstream. I fixed the issue by cherry-picking of proper commit on top of upstream 4.x. Please pay attention, that I have to rewrite commits history for it. Please chech the branch with real hardware to ensure the patch works correctly.

@fengyuentau
Copy link
Copy Markdown
Member

Tested on loongarch server and all tests are passed except the known Calib3d_StereoBM.regression regression test.

@CNClareChen
Copy link
Copy Markdown
Contributor Author

@CNClareChen I apologize, I disoriented you. Yuantao merged upstream 4.x to your branch, but not rebase it. It leads to incompatible commit history in you branch and upstream. I fixed the issue by cherry-picking of proper commit on top of upstream 4.x. Please pay attention, that I have to rewrite commits history for it. Please chech the branch with real hardware to ensure the patch works correctly.

Thank you very much for your kind help. This patch can work normally in my branch with real hardware.

@asmorkalov asmorkalov self-requested a review September 13, 2022 13:25
@asmorkalov asmorkalov self-assigned this Sep 13, 2022
@asmorkalov asmorkalov merged commit 8eb036f into opencv:4.x Sep 13, 2022
@asmorkalov asmorkalov added platform: loongson Loonson CPU architecure and LASX simd and removed platform: other labels Oct 19, 2022
@alalek alalek mentioned this pull request Jan 8, 2023
@loongson-zn loongson-zn mentioned this pull request Jul 5, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: core optimization platform: loongson Loonson CPU architecure and LASX simd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants