]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
possibly better animation code by cobra__ (not tested)
authorRudolf Polzer <divverent@xonotic.org>
Thu, 1 Nov 2012 15:03:55 +0000 (16:03 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 1 Nov 2012 15:03:55 +0000 (16:03 +0100)
mod_skeletal_animatevertices_sse.c

index 648ab31a15460b7f333e6a8686d8df28bbbc554c..254848bc35be958cb037d753c6e83b85a53640e6 100644 (file)
@@ -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