diff --git a/cmake/OpenCVCompilerOptimizations.cmake b/cmake/OpenCVCompilerOptimizations.cmake index fea13cefa6..2696ac2ac0 100644 --- a/cmake/OpenCVCompilerOptimizations.cmake +++ b/cmake/OpenCVCompilerOptimizations.cmake @@ -256,12 +256,14 @@ elseif(ARM OR AARCH64) ocv_update(CPU_FP16_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_fp16.cpp") if(NOT AARCH64) ocv_update(CPU_KNOWN_OPTIMIZATIONS "VFPV3;NEON;FP16") - ocv_update(CPU_VFPV3_FLAGS_ON "-mfpu=vfpv3") - ocv_update(CPU_NEON_FLAGS_ON "-mfpu=neon") - ocv_update(CPU_NEON_FLAGS_CONFLICT "-mfpu=[^ ]*") - ocv_update(CPU_FP16_FLAGS_ON "-mfpu=neon-fp16") + if(NOT MSVC) + ocv_update(CPU_VFPV3_FLAGS_ON "-mfpu=vfpv3") + ocv_update(CPU_NEON_FLAGS_ON "-mfpu=neon") + ocv_update(CPU_NEON_FLAGS_CONFLICT "-mfpu=[^ ]*") + ocv_update(CPU_FP16_FLAGS_ON "-mfpu=neon-fp16") + ocv_update(CPU_FP16_FLAGS_CONFLICT "-mfpu=[^ ]*") + endif() ocv_update(CPU_FP16_IMPLIES "NEON") - ocv_update(CPU_FP16_FLAGS_CONFLICT "-mfpu=[^ ]*") else() ocv_update(CPU_KNOWN_OPTIMIZATIONS "NEON;FP16") ocv_update(CPU_NEON_FLAGS_ON "") diff --git a/modules/core/include/opencv2/core/hal/intrin.hpp b/modules/core/include/opencv2/core/hal/intrin.hpp index 26fd9185b3..9dcfc5623a 100644 --- a/modules/core/include/opencv2/core/hal/intrin.hpp +++ b/modules/core/include/opencv2/core/hal/intrin.hpp @@ -440,7 +440,7 @@ template <> struct V_RegTrait128 { inline unsigned int trailingZeros32(unsigned int value) { #if defined(_MSC_VER) -#if (_MSC_VER < 1700) +#if (_MSC_VER < 1700) || defined(_M_ARM) unsigned long index = 0; _BitScanForward(&index, value); return (unsigned int)index; diff --git a/modules/core/src/hal_replacement.hpp b/modules/core/src/hal_replacement.hpp index 9a1177e9c2..c0477e69b0 100644 --- a/modules/core/src/hal_replacement.hpp +++ b/modules/core/src/hal_replacement.hpp @@ -727,7 +727,7 @@ inline int hal_ni_gemm64fc(const double* src1, size_t src1_step, const double* s //! @cond IGNORED #define CALL_HAL_RET(name, fun, retval, ...) \ { \ - int res = fun(__VA_ARGS__, &retval); \ + int res = __CV_EXPAND(fun(__VA_ARGS__, &retval)); \ if (res == CV_HAL_ERROR_OK) \ return retval; \ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ @@ -738,7 +738,7 @@ inline int hal_ni_gemm64fc(const double* src1, size_t src1_step, const double* s #define CALL_HAL(name, fun, ...) \ { \ - int res = fun(__VA_ARGS__); \ + int res = __CV_EXPAND(fun(__VA_ARGS__)); \ if (res == CV_HAL_ERROR_OK) \ return; \ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ diff --git a/modules/imgproc/src/hal_replacement.hpp b/modules/imgproc/src/hal_replacement.hpp index 1bbc2f372b..5c7e7726fb 100644 --- a/modules/imgproc/src/hal_replacement.hpp +++ b/modules/imgproc/src/hal_replacement.hpp @@ -627,7 +627,7 @@ inline int hal_ni_integral(int depth, int sdepth, int sqdepth, const uchar * src //! @cond IGNORED #define CALL_HAL_RET(name, fun, retval, ...) \ - int res = fun(__VA_ARGS__, &retval); \ + int res = __CV_EXPAND(fun(__VA_ARGS__, &retval)); \ if (res == CV_HAL_ERROR_OK) \ return retval; \ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ @@ -636,7 +636,7 @@ inline int hal_ni_integral(int depth, int sdepth, int sqdepth, const uchar * src #define CALL_HAL(name, fun, ...) \ - int res = fun(__VA_ARGS__); \ + int res = __CV_EXPAND(fun(__VA_ARGS__)); \ if (res == CV_HAL_ERROR_OK) \ return; \ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \