Skip to content

Replace legacy __ARM_NEON__ by __ARM_NEON#25024

Merged
asmorkalov merged 3 commits intoopencv:4.xfrom
vrabaud:neon
Feb 20, 2024
Merged

Replace legacy __ARM_NEON__ by __ARM_NEON#25024
asmorkalov merged 3 commits intoopencv:4.xfrom
vrabaud:neon

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Feb 14, 2024

Even ACLE 1.1 referes to __ARM_NEON
https://developer.arm.com/documentation/ihi0053/b/?lang=en

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

@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Feb 14, 2024

I guess defined(__ARM_NEON) || defined(__aarch64__) could be simplified into defined(__ARM_NEON) but is there a platform where __aarch64__ is defined and not __ARM_NEON ?

@asmorkalov
Copy link
Copy Markdown
Contributor

Please pay attention on CI.

@asmorkalov asmorkalov added category: build/install platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc labels Feb 14, 2024
@asmorkalov asmorkalov self-requested a review February 14, 2024 14:26
@mshabunin
Copy link
Copy Markdown
Contributor

I guess defined(__ARM_NEON) || defined(__aarch64__) could be simplified into defined(__ARM_NEON) but is there a platform where __aarch64__ is defined and not __ARM_NEON ?

I don't know if there is HW platform, but it "exists" in the software 🙂

$ aarch64-linux-gnu-g++ -dM -E -march=armv8-a - < /dev/null | grep NEON
#define __ARM_NEON 1
$ aarch64-linux-gnu-g++ -dM -E -march=armv8-a+nosimd - < /dev/null | grep NEON
<nothing>

@opencv-alalek
Copy link
Copy Markdown
Contributor

defined(__ARM_NEON) || defined(__aarch64__)

I believe it makes sense to use defined(__ARM_NEON) here (to keep support for some "debug" configurations like mentioned -march=armv8-a+nosimd)

@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Feb 19, 2024

-march=armv8-a+nosimd defines __aarch64__ but not __ARM_NEON right? So we should keep defined(__ARM_NEON) || defined(__aarch64__) ? Or should I replace those with pure defined(__ARM_NEON) ?

@opencv-alalek
Copy link
Copy Markdown
Contributor

pure defined(__ARM_NEON)

my vote for this
(yes, it is not equal to the current conditions)

@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Feb 19, 2024

I replaced defined(__ARM_NEON) || defined(__aarch64__) with defined(__ARM_NEON)

Copy link
Copy Markdown
Contributor

@mshabunin mshabunin left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I've build and tested in qemu (opencv_test_core) two configurations with and without NEON, seems to be OK.

@opencv-alalek opencv-alalek added this to the 4.10.0 milestone Feb 19, 2024
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

👍

@asmorkalov asmorkalov merged commit f8aa289 into opencv:4.x Feb 20, 2024
@vrabaud vrabaud deleted the neon branch February 20, 2024 09:16
@asmorkalov asmorkalov mentioned this pull request Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build/install platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants