diff --git a/CMakeLists.txt b/CMakeLists.txt index c23b989e..773bbbb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -744,12 +744,12 @@ elseif(MSVC) string(REGEX REPLACE "/[Ww][^ ]+" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) string(REGEX REPLACE "/[Ww][^ ]+" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - add_compile_options(/std:c++17 -D__STDC_LIMIT_MACROS) + add_compile_options(/std:c++17 -D__STDC_LIMIT_MACROS /fp:fast /Oi) if(CMAKE_BUILD_TYPE STREQUAL Debug) add_compile_options(/W4) else() - add_compile_options(/w) + add_compile_options(/w /O2) if(ENABLE_LTO) add_compile_options(/GL) diff --git a/src/filters/xBRZ/xbrz.cpp b/src/filters/xBRZ/xbrz.cpp index 13e6cdc1..17d7830e 100644 --- a/src/filters/xBRZ/xbrz.cpp +++ b/src/filters/xBRZ/xbrz.cpp @@ -76,8 +76,10 @@ inline double fastSqrt(double n) fld n fsqrt } -#else // defined(_MSC_VER) && defined(_M_X64) OR other platforms - // VisualStudio x86_64 does not allow inline ASM +#elif defined(_MSC_VER) + // On MSVC x64 use intrinsic with /Oi and /fp:fast + return sqrt(n); +#else // Other platforms. return std::sqrt(n); #endif }