include/simd.h
branchpyrit
changeset 95 ca7d4c665531
parent 94 4c8abb8977dc
child 98 64638385798a
--- a/include/simd.h	Thu May 08 09:21:25 2008 +0200
+++ b/include/simd.h	Sat May 10 14:29:37 2008 +0200
@@ -34,9 +34,9 @@
 
 #include <xmmintrin.h>
 
-typedef __m128 mfloat4;
+#define mfloat4 __m128
 
-#define mZero  _mm_set_ps1(0.0f)
+#define mZero  _mm_setzero_ps()
 #define mOne   _mm_set_ps1(1.0f)
 #define mTwo   _mm_set_ps1(2.0f)
 #define mEps   _mm_set_ps1(Eps)
@@ -66,6 +66,12 @@
 #define mmax _mm_max_ps
 #define mmovemask _mm_movemask_ps
 
+#define mShuffle0 _MM_SHUFFLE(0,0,0,0)
+#define mShuffle1 _MM_SHUFFLE(1,1,1,1)
+#define mShuffle2 _MM_SHUFFLE(2,2,2,2)
+#define mShuffle3 _MM_SHUFFLE(3,3,3,3)
+#define mshuffle _mm_shuffle_ps
+
 inline const mfloat4 mselect(const mfloat4& mask, const mfloat4& a, const mfloat4& b)
 {
 	return _mm_or_ps(_mm_and_ps(mask, a), _mm_andnot_ps(mask, b));