Merge pull request #25024 from vrabaud:neon

Replace legacy __ARM_NEON__ by __ARM_NEON #25024

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

- [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
- [x] 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
pull/25054/head
Vincent Rabaud 9 months ago committed by GitHub
parent f8ef646312
commit f8aa2896a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      cmake/checks/cpu_neon.cpp
  2. 8
      modules/core/include/opencv2/core/cv_cpu_dispatch.h
  3. 2
      modules/core/include/opencv2/core/fast_math.hpp
  4. 6
      modules/core/src/system.cpp
  5. 6
      modules/flann/include/opencv2/flann/dist.h

@ -5,7 +5,7 @@
# include <Intrin.h> # include <Intrin.h>
# include <arm_neon.h> # include <arm_neon.h>
# define CV_NEON 1 # define CV_NEON 1
#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__)) #elif defined(__ARM_NEON)
# include <arm_neon.h> # include <arm_neon.h>
# define CV_NEON 1 # define CV_NEON 1
#endif #endif

@ -141,7 +141,7 @@
# include <Intrin.h> # include <Intrin.h>
# include <arm_neon.h> # include <arm_neon.h>
# define CV_NEON 1 # define CV_NEON 1
#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__)) #elif defined(__ARM_NEON)
# include <arm_neon.h> # include <arm_neon.h>
# define CV_NEON 1 # define CV_NEON 1
#endif #endif
@ -151,10 +151,6 @@
# define CV_RVV071 1 # define CV_RVV071 1
#endif #endif
#if defined(__ARM_NEON__) || defined(__aarch64__)
# include <arm_neon.h>
#endif
#ifdef CV_CPU_COMPILE_VSX #ifdef CV_CPU_COMPILE_VSX
# include <altivec.h> # include <altivec.h>
# undef vector # undef vector
@ -229,7 +225,7 @@ struct VZeroUpperGuard {
# include <Intrin.h> # include <Intrin.h>
# include <arm_neon.h> # include <arm_neon.h>
# define CV_NEON 1 # define CV_NEON 1
#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__)) #elif defined(__ARM_NEON)
# include <arm_neon.h> # include <arm_neon.h>
# define CV_NEON 1 # define CV_NEON 1
#elif defined(__VSX__) && defined(__PPC64__) && defined(__LITTLE_ENDIAN__) #elif defined(__VSX__) && defined(__PPC64__) && defined(__LITTLE_ENDIAN__)

@ -84,7 +84,7 @@
#if defined(CV_INLINE_ROUND_FLT) #if defined(CV_INLINE_ROUND_FLT)
// user-specified version // user-specified version
// CV_INLINE_ROUND_DBL should be defined too // CV_INLINE_ROUND_DBL should be defined too
#elif defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__ #elif defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON) && !defined __SOFTFP__
// 1. general scheme // 1. general scheme
#define ARM_ROUND(_value, _asm_string) \ #define ARM_ROUND(_value, _asm_string) \
int res; \ int res; \

@ -637,10 +637,10 @@ struct HWFeatures
} }
#endif #endif
#elif (defined __APPLE__) #elif (defined __APPLE__)
#if (defined __ARM_NEON__ || (defined __ARM_NEON && defined __aarch64__)) #if defined __ARM_NEON
have[CV_CPU_NEON] = true; have[CV_CPU_NEON] = true;
#endif #endif
#if (defined __ARM_FP && (((__ARM_FP & 0x2) != 0) && defined __ARM_NEON__)) #if (defined __ARM_FP && (((__ARM_FP & 0x2) != 0) && defined __ARM_NEON))
have[CV_CPU_FP16] = have[CV_CPU_NEON_FP16] = true; have[CV_CPU_FP16] = have[CV_CPU_NEON_FP16] = true;
#endif #endif
// system.cpp may be compiled w/o special -march=armv8...+dotprod, -march=armv8...+bf16 etc., // system.cpp may be compiled w/o special -march=armv8...+dotprod, -march=armv8...+bf16 etc.,
@ -659,7 +659,7 @@ struct HWFeatures
have[CV_CPU_NEON_BF16] = true; have[CV_CPU_NEON_BF16] = true;
} }
#elif (defined __clang__) #elif (defined __clang__)
#if (defined __ARM_NEON__ || (defined __ARM_NEON && defined __aarch64__)) #if defined __ARM_NEON
have[CV_CPU_NEON] = true; have[CV_CPU_NEON] = true;
#if (defined __ARM_FP && ((__ARM_FP & 0x2) != 0)) #if (defined __ARM_FP && ((__ARM_FP & 0x2) != 0))
have[CV_CPU_FP16] = true; have[CV_CPU_FP16] = true;

@ -49,7 +49,7 @@ typedef unsigned __int64 uint64_t;
# include <Intrin.h> # include <Intrin.h>
#endif #endif
#if defined(__ARM_NEON__) && !defined(__CUDACC__) #if defined(__ARM_NEON) && !defined(__CUDACC__)
# include "arm_neon.h" # include "arm_neon.h"
#endif #endif
@ -559,7 +559,7 @@ struct Hamming
ResultType operator()(const Iterator1 a, const Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const ResultType operator()(const Iterator1 a, const Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
{ {
ResultType result = 0; ResultType result = 0;
#if defined(__ARM_NEON__) && !defined(__CUDACC__) #if defined(__ARM_NEON) && !defined(__CUDACC__)
{ {
const unsigned char* a2 = reinterpret_cast<const unsigned char*> (a); const unsigned char* a2 = reinterpret_cast<const unsigned char*> (a);
const unsigned char* b2 = reinterpret_cast<const unsigned char*> (b); const unsigned char* b2 = reinterpret_cast<const unsigned char*> (b);
@ -611,7 +611,7 @@ struct Hamming
{ {
(void)b; (void)b;
ResultType result = 0; ResultType result = 0;
#if defined(__ARM_NEON__) && !defined(__CUDACC__) #if defined(__ARM_NEON) && !defined(__CUDACC__)
{ {
const unsigned char* a2 = reinterpret_cast<const unsigned char*> (a); const unsigned char* a2 = reinterpret_cast<const unsigned char*> (a);
uint32x4_t bits = vmovq_n_u32(0); uint32x4_t bits = vmovq_n_u32(0);

Loading…
Cancel
Save