--- a/kernels/volk/volk_32f_index_max_16u.h 2016-07-28 15:53:26 +++ b/kernels/volk/volk_32f_index_max_16u.h 2018-06-25 11:28:31 @@ -143,6 +143,23 @@ #include +/* + * To bypass an Optimizer bug in MSVC-2017. + * Ref: + * https://developercommunity.visualstudio.com/content/problem/215602/new-optimizer-code-generation-bug.html + * + * Turn off all optimizations for this function. + */ +#if defined(_MSC_VER) && !defined(__clang__) + #define OPTIMIZE_OFF() __pragma (optimize ("g", off)); + #define OPTIMIZE_DEF() __pragma (optimize ("", on)); +#else + #define OPTIMIZE_OFF() + #define OPTIMIZE_DEF() +#endif + +OPTIMIZE_OFF() + static inline void volk_32f_index_max_16u_a_sse(uint16_t* target, const float* src0, uint32_t num_points) @@ -200,6 +217,8 @@ target[0] = (uint16_t)index; } +OPTIMIZE_DEF() + #endif /*LV_HAVE_SSE*/