Skip to content

Commit 743099f

Browse files
authored
Merge pull request opencv#19521 from zchrissirhcz:3.4-fix-core-module-android-arm64-build
* fix core module android arm64 build * fix core module android build when neon is off When building for Android ARM platform, cmake with `-D CV_DISABLE_OPTIMIZATION=ON`, the expected behavior is not using ARM NEON, using naive computation instead. This commit fix the un-expected compile error for neon intrinsincs.
1 parent cceec84 commit 743099f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/core/src/rand.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static void randf_32f( float* arr, int len, uint64* state, const Vec2f* p, bool
243243
__m128 p1 = _mm_unpackhi_ps(q01l, q01h);
244244

245245
_mm_storeu_ps(arr + i, _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(f), p0), p1));
246-
#elif defined __ARM_NEON && defined __aarch64__
246+
#elif CV_NEON && defined __aarch64__
247247
// handwritten NEON is required not for performance but for numerical stability!
248248
// 64bit gcc tends to use fmadd instead of separate multiply and add
249249
// use volatile to ensure to separate the multiply and add
@@ -278,7 +278,7 @@ static void randf_32f( float* arr, int len, uint64* state, const Vec2f* p, bool
278278
_mm_mul_ss(_mm_set_ss((float)(int)temp), _mm_set_ss(p[i][0])),
279279
_mm_set_ss(p[i][1]))
280280
);
281-
#elif defined __ARM_NEON && defined __aarch64__
281+
#elif CV_NEON && defined __aarch64__
282282
float32x2_t t = vadd_f32(vmul_f32(
283283
vdup_n_f32((float)(int)temp), vdup_n_f32(p[i][0])),
284284
vdup_n_f32(p[i][1]));

0 commit comments

Comments
 (0)