Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-02-14 06:16:39 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-02-17 18:26:24 +0300
commitdb28411fd90b77035dddc1682bb2786da34f73e9 (patch)
tree657da0efe3cb8e418d80bdd4b81a7f5ed0cbb8ce /build_files
parent859118d8f6ff022a16acbc6435488883424bad25 (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')
-rw-r--r--build_files/cmake/macros.cmake20
-rw-r--r--build_files/cmake/platform/platform_apple.cmake7
-rw-r--r--build_files/cmake/platform/platform_unix.cmake4
3 files changed, 17 insertions, 14 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)
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 5203ba10863..e7b0097a137 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -321,8 +321,11 @@ if(WITH_OPENVDB)
endif()
if(WITH_NANOVDB)
- set(NANOVDB ${LIBDIR}/nanovdb)
- set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
+ find_package(NanoVDB)
+endif()
+
+if(WITH_CPU_SIMD)
+ find_package(sse2neon)
endif()
if(WITH_LLVM)
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index f212741f0b6..5d3f074bdda 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -284,6 +284,10 @@ if(WITH_NANOVDB)
endif()
endif()
+if(WITH_CPU_SIMD)
+ find_package_wrapper(sse2neon)
+endif()
+
if(WITH_ALEMBIC)
find_package_wrapper(Alembic)