From 02504e2bdbaa2af12a0f369a67f6f0e0a00f224a Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 21 Feb 2024 08:11:32 +0000 Subject: [PATCH] core: fix float16_t optimization condition - resolves issue on Windows ARM64 --- modules/core/include/opencv2/core/cvdef.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index b6879ff5a5..03f65ad328 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -844,7 +844,7 @@ protected: float16_t() : w(0) {} explicit float16_t(float x) { - #if CV_FP16 + #if CV_FP16 && CV_AVX2 __m128 v = _mm_load_ss(&x); w = (ushort)_mm_cvtsi128_si32(_mm_cvtps_ph(v, 0)); #else @@ -875,7 +875,7 @@ protected: operator float() const { - #if CV_FP16 + #if CV_FP16 && CV_AVX2 float f; _mm_store_ss(&f, _mm_cvtph_ps(_mm_cvtsi32_si128(w))); return f;