diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 8cf550a886..134d38062c 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -136,6 +136,14 @@ add_library(common WorkQueueThread.h ) +if(MSVC AND _M_ARM_64) + # Workaround msvc arm64 optimizer bug + # TODO remove after updating to VS 17.4 + set_source_files_properties( + Crypto/SHA1.cpp + PROPERTIES COMPILE_FLAGS "/d2ssa-peeps-post-color-") +endif() + if(NOT MSVC AND _M_ARM_64) set_source_files_properties( Crypto/AES.cpp diff --git a/Source/Core/Common/Crypto/SHA1.cpp b/Source/Core/Common/Crypto/SHA1.cpp index 7dfbb1f0c0..8f22855b0e 100644 --- a/Source/Core/Common/Crypto/SHA1.cpp +++ b/Source/Core/Common/Crypto/SHA1.cpp @@ -293,10 +293,6 @@ private: template static inline constexpr State FourRounds(State state, uint32x4_t w) { -#ifdef _MSC_VER - // FIXME it seems the msvc optimizer gets a little too happy - _ReadBarrier(); -#endif return {f(state, w), vsha1h_u32(vgetq_lane_u32(state.abcd, 0))}; } diff --git a/Source/Core/DolphinLib.props b/Source/Core/DolphinLib.props index 0c73e3d980..b1da315c18 100644 --- a/Source/Core/DolphinLib.props +++ b/Source/Core/DolphinLib.props @@ -723,7 +723,12 @@ - + + + /d2ssa-peeps-post-color- %(AdditionalOptions) +