mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #25059 from opencv-pushbot:gitee/alalek/core_fix_float16
core: fix float16_t optimization condition
This commit is contained in:
commit
a2e23fa988
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user