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 /source/blender/blenlib | |
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 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_simd.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_simd.h b/source/blender/blenlib/BLI_simd.h index 1518b6c1de2..2ebbd7a2250 100644 --- a/source/blender/blenlib/BLI_simd.h +++ b/source/blender/blenlib/BLI_simd.h @@ -22,7 +22,15 @@ * SIMD instruction support. */ -#if defined(__SSE2__) +#if defined(__ARM_NEON) && defined(WITH_SSE2NEON) +/* SSE/SSE2 emulation on ARM Neon. Match SSE precision. */ +# define SSE2NEON_PRECISE_MINMAX 1 +# define SSE2NEON_PRECISE_DIV 1 +# define SSE2NEON_PRECISE_SQRT 1 +# include <sse2neon.h> +# define BLI_HAVE_SSE2 +#elif defined(__SSE2__) +/* Native SSE2 on Intel/AMD. */ # include <emmintrin.h> # define BLI_HAVE_SSE2 #endif |