diff --git a/source/blender/blenlib/BLI_simd.hh b/source/blender/blenlib/BLI_simd.hh index 7ee862e1003..f6e76eb9346 100644 --- a/source/blender/blenlib/BLI_simd.hh +++ b/source/blender/blenlib/BLI_simd.hh @@ -16,9 +16,8 @@ # error Including BLI_simd.hh requires C++ #endif -// TODO: Re-enable this once blenlib is converted to C++ -#if (defined(__ARM_NEON) /* || (defined(_M_ARM64) && defined(_MSC_VER))*/) && \ - defined(WITH_SSE2NEON) +#if (defined(__ARM_NEON) || (defined(_M_ARM64) && defined(_MSC_VER))) && \ + defined(WITH_SSE2NEON) && !defined(DISABLE_SSE2NEON) /* SSE/SSE2 emulation on ARM Neon. Match SSE precision. */ # if !defined(SSE2NEON_PRECISE_MINMAX) # define SSE2NEON_PRECISE_MINMAX 1 @@ -39,7 +38,8 @@ # define BLI_HAVE_SSE2 0 #endif -#if defined(__ARM_NEON) && defined(WITH_SSE2NEON) +#if (defined(__ARM_NEON) || (defined(_M_ARM64) && defined(_MSC_VER))) && \ + defined(WITH_SSE2NEON) && !defined(DISABLE_SSE2NEON) /* SSE4 is emulated via sse2neon. */ # define BLI_HAVE_SSE4 1 #elif defined(__SSE4_2__) diff --git a/source/blender/io/usd/CMakeLists.txt b/source/blender/io/usd/CMakeLists.txt index 05bd2b073d0..f555e7c572f 100644 --- a/source/blender/io/usd/CMakeLists.txt +++ b/source/blender/io/usd/CMakeLists.txt @@ -54,8 +54,9 @@ if(WIN32) remove_cc_flag("/w34100") if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") # USD currently does not support the new preprocessor, - # and does not use sse2neon, so we can remove it here + # so we remove it here and disable sse2neon remove_cc_flag("/Zc:preprocessor") + add_definitions(-DDISABLE_SSE2NEON) endif() endif() diff --git a/source/blender/render/hydra/CMakeLists.txt b/source/blender/render/hydra/CMakeLists.txt index dca5b0c03cb..ec93be00e97 100644 --- a/source/blender/render/hydra/CMakeLists.txt +++ b/source/blender/render/hydra/CMakeLists.txt @@ -35,8 +35,9 @@ if(WIN32) remove_cc_flag("/w34100") if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") # USD currently does not support the new preprocessor, - # and does not use sse2neon, so we can remove it here + # so we remove it here and disable sse2neon remove_cc_flag("/Zc:preprocessor") + add_definitions(-DDISABLE_SSE2NEON) endif() endif()