Skip to content

Restored legacy intrinsics operators in a separate header#27327

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
mshabunin:fix-intrin-legacy-ops
May 19, 2025
Merged

Restored legacy intrinsics operators in a separate header#27327
asmorkalov merged 1 commit intoopencv:4.xfrom
mshabunin:fix-intrin-legacy-ops

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

resolves #27267

  • New header with removed universal intrinsics operator overloads must be included manually by the user if necessary. Transition to operator-less API is recommended.
  • Basic compilation test can be performed by defining OPENCV_ENABLE_INLINE_INTRIN_OPERATOR_TEST macro before header inclusion. It is not meant to be run
  • shift operators have not been defined due to potential conflicts with io streams
  • safety checks for opencv build, opencv version and risc-v platform would produce compiler warnings and errors

Comment on lines +20 to +22
#if defined(CV_VERSION) && CV_VERSION_MAJOR == 4 && CV_VERSION_MINOR < 11
#warning "Older versions of OpenCV (<4.11) already have Universal Intrinscs operators"
#endif
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only since OpenCV 4.11 the Universal Intrinscs operators have been removed?

I don't understand, I had to fix some code since OpenCV 4.9 release.

#24371

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the feedback. The operator overload was removed due to problems with RISC-V platform. The header with overloaded operators was added for compatibility on previously supported platforms (we have such issue report). You do not need to touch your code. v_xxx functions is the way to go further.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-trinh , you are right. Operators has been removed from AArch64 backend since 4.9 and from other backends since 4.11.

@asmorkalov asmorkalov added this to the 4.12.0 milestone May 19, 2025
@asmorkalov asmorkalov self-requested a review May 19, 2025 06:05
@asmorkalov asmorkalov self-assigned this May 19, 2025
@asmorkalov asmorkalov merged commit eae77da into opencv:4.x May 19, 2025
54 of 55 checks passed
@mshabunin mshabunin deleted the fix-intrin-legacy-ops branch May 22, 2025 17:57
@asmorkalov asmorkalov mentioned this pull request May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hal_intrinsics operators breakage in 4.11

3 participants