diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-02-14 06:16:39 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 18:26:24 +0300 |
commit | db28411fd90b77035dddc1682bb2786da34f73e9 (patch) | |
tree | 657da0efe3cb8e418d80bdd4b81a7f5ed0cbb8ce /build_files/cmake/macros.cmake | |
parent | 859118d8f6ff022a16acbc6435488883424bad25 (diff) |
BLI: use sse2neon to emulate SSE instructions with Arm Neon
* WITH_CPU_SSE was renamed to WITH_CPU_SIMD, and now covers both SSE and Neon.
* For macOS sse2neon.h is included as part of the precompiled libraries.
* For Linux it is enabled if the sse2neon.h header file is detected. However
this library does not have official releases and is not shipped with any Linux
distribution, so manual installation and configuration is required to get this
working.
Ref D8237, T78710
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r-- | build_files/cmake/macros.cmake | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index aebcd25e3b6..b8f92a10761 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -668,12 +668,6 @@ macro(TEST_SSE_SUPPORT #include <xmmintrin.h> int main(void) { __m128 v = _mm_setzero_ps(); return 0; }" SUPPORT_SSE_BUILD) - - if(SUPPORT_SSE_BUILD) - message(STATUS "SSE Support: detected.") - else() - message(STATUS "SSE Support: missing.") - endif() endif() if(NOT DEFINED SUPPORT_SSE2_BUILD) @@ -682,17 +676,19 @@ macro(TEST_SSE_SUPPORT #include <emmintrin.h> int main(void) { __m128d v = _mm_setzero_pd(); return 0; }" SUPPORT_SSE2_BUILD) - - if(SUPPORT_SSE2_BUILD) - message(STATUS "SSE2 Support: detected.") - else() - message(STATUS "SSE2 Support: missing.") - endif() endif() unset(CMAKE_REQUIRED_FLAGS) endmacro() +macro(TEST_NEON_SUPPORT) + include(CheckCXXSourceCompiles) + check_cxx_source_compiles( + "#include <arm_neon.h> + int main() {return vaddvq_s32(vdupq_n_s32(1));}" + SUPPORT_NEON_BUILD) +endmacro() + # Only print message if running CMake first time macro(message_first_run) if(FIRST_RUN) |