Restored generic (non-SIMD) code

This commit is contained in:
Brian Harris
2013-05-29 13:12:13 -05:00
parent be311f42e1
commit 9c37079c16
23 changed files with 3328 additions and 24 deletions

View File

@@ -32,10 +32,12 @@ If you have questions concerning this license or the applicable additional terms
#include "tr_local.h"
#include "Model_local.h"
#ifdef ID_WIN_X86_SSE2_INTRIN
static const __m128 vector_float_posInfinity = { idMath::INFINITY, idMath::INFINITY, idMath::INFINITY, idMath::INFINITY };
static const __m128 vector_float_negInfinity = { -idMath::INFINITY, -idMath::INFINITY, -idMath::INFINITY, -idMath::INFINITY };
#endif
static const char *MD5_SnapshotName = "_MD5_Snapshot_";
@@ -501,6 +503,7 @@ idMD5Mesh::CalculateBounds
====================
*/
void idMD5Mesh::CalculateBounds( const idJointMat * entJoints, idBounds & bounds ) const {
#ifdef ID_WIN_X86_SSE2_INTRIN
__m128 minX = vector_float_posInfinity;
__m128 minY = vector_float_posInfinity;
@@ -534,6 +537,16 @@ void idMD5Mesh::CalculateBounds( const idJointMat * entJoints, idBounds & bounds
_mm_store_ss( bounds.ToFloatPtr() + 4, _mm_splat_ps( maxY, 3 ) );
_mm_store_ss( bounds.ToFloatPtr() + 5, _mm_splat_ps( maxZ, 3 ) );
#else
bounds.Clear();
for ( int i = 0; i < numMeshJoints; i++ ) {
const idJointMat & joint = entJoints[meshJoints[i]];
bounds.AddPoint( joint.GetTranslation() );
}
bounds.ExpandSelf( maxJointVertDist );
#endif
}
/*
@@ -1085,6 +1098,7 @@ static void TransformJoints( idJointMat *__restrict outJoints, const int numJoin
assert_16_byte_aligned( inFloats1 );
assert_16_byte_aligned( inFloats2 );
#ifdef ID_WIN_X86_SSE2_INTRIN
const __m128 mask_keep_last = __m128c( _mm_set_epi32( 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000 ) );
@@ -1160,6 +1174,13 @@ static void TransformJoints( idJointMat *__restrict outJoints, const int numJoin
_mm_store_ps( outFloats + 1 * 12 + 8, ri1 );
}
#else
for ( int i = 0; i < numJoints; i++ ) {
idJointMat::Multiply( outJoints[i], inJoints1[i], inJoints2[i] );
}
#endif
}
/*