From 7d38a75f21fd45ef5b9a701a10716a727677a1aa Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 1 Nov 2012 16:03:55 +0100 Subject: [PATCH] possibly better animation code by cobra__ (not tested) --- mod_skeletal_animatevertices_sse.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mod_skeletal_animatevertices_sse.c b/mod_skeletal_animatevertices_sse.c index 648ab31a..254848bc 100644 --- a/mod_skeletal_animatevertices_sse.c +++ b/mod_skeletal_animatevertices_sse.c @@ -308,18 +308,19 @@ void Mod_Skeletal_AnimateVertices_SSE(const dp_model_t * RESTRICT model, const f #define TRANSFORM_VECTOR(in, out) { \ __m128 vin = _mm_loadu_ps(in); \ - \ + __m128 z1 = _mm_movehl_ps(vin, vin); \ + __m128 vinxy = _mm_unpacklo_ps(vin, vin); \ /* x */ \ - __m128 x = _mm_shuffle_ps(vin, vin, 0x0); \ + __m128 x = _mm_movelh_ps(vinxy, vinxy); \ __m128 t1 = _mm_mul_ps(x, m1); \ \ /* y, + x */ \ - __m128 y = _mm_shuffle_ps(vin, vin, 0x55); \ + __m128 y = _mm_movehl_ps(vinxy, vinxy); \ __m128 t2 = _mm_mul_ps(y, m2); \ + __m128 z = _mm_unpacklo_ps(z1, z1); \ __m128 t3 = _mm_add_ps(t1, t2); \ \ /* nz, + (ny + nx) */ \ - __m128 z = _mm_shuffle_ps(vin, vin, 0xaa); \ __m128 t4 = _mm_mul_ps(z, m3); \ __m128 vout = _mm_add_ps(t3, t4); \ _mm_storeu_ps((out), vout); \ @@ -443,4 +444,4 @@ void Mod_Skeletal_AnimateVertices_SSE(const dp_model_t * RESTRICT model, const f #undef TRANSFORM_VECTOR_SCALAR } -#endif +#endif \ No newline at end of file -- 2.39.2