diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-02-14 16:20:51 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 18:26:24 +0300 |
commit | 859118d8f6ff022a16acbc6435488883424bad25 (patch) | |
tree | e0f708929a884070f7c3758f7fb58527cbdfd555 /source/blender/blenkernel | |
parent | ac680c569e1b979f20c2e81dbd4f232085141aad (diff) |
BLI: add BLI_simd.h header to wrap SSE includes
In preparation of adding Neon support.
Ref D8237, T78710
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/lattice_deform.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/lattice_deform.c b/source/blender/blenkernel/intern/lattice_deform.c index 81c2f492f7e..2651042939f 100644 --- a/source/blender/blenkernel/intern/lattice_deform.c +++ b/source/blender/blenkernel/intern/lattice_deform.c @@ -31,6 +31,7 @@ #include "MEM_guardedalloc.h" #include "BLI_math.h" +#include "BLI_simd.h" #include "BLI_task.h" #include "BLI_utildefines.h" @@ -49,10 +50,6 @@ #include "BKE_deform.h" -#ifdef __SSE2__ -# include <emmintrin.h> -#endif - /* -------------------------------------------------------------------- */ /** \name Lattice Deform API * \{ */ @@ -171,7 +168,7 @@ void BKE_lattice_deform_data_eval_co(LatticeDeformData *lattice_deform_data, /* vgroup influence */ float co_prev[4] = {0}, weight_blend = 0.0f; copy_v3_v3(co_prev, co); -#ifdef __SSE2__ +#ifdef BLI_HAVE_SSE2 __m128 co_vec = _mm_loadu_ps(co_prev); #endif @@ -232,7 +229,7 @@ void BKE_lattice_deform_data_eval_co(LatticeDeformData *lattice_deform_data, u = v * tu[uu - ui + 1]; idx_u = CLAMPIS(uu, 0, idx_u_max); const int idx = idx_w + idx_v + idx_u; -#ifdef __SSE2__ +#ifdef BLI_HAVE_SSE2 { __m128 weight_vec = _mm_set1_ps(u); /* We need to address special case for last item to avoid accessing invalid memory. */ @@ -256,7 +253,7 @@ void BKE_lattice_deform_data_eval_co(LatticeDeformData *lattice_deform_data, } } } -#ifdef __SSE2__ +#ifdef BLI_HAVE_SSE2 { copy_v3_v3(co, (float *)&co_vec); } |