Added SSE det function

This commit is contained in:
Christophe Riccio
2011-01-06 18:33:42 +00:00
parent e3ae7e3db5
commit a9cef7a516
3 changed files with 76 additions and 37 deletions

View File

@@ -13,5 +13,25 @@
int main(int argc, void* argv[])
{
// shuffle test
glm::simd_vec4 A(1.0f, 2.0f, 3.0f, 4.0f);
glm::simd_vec4 B(5.0f, 6.0f, 7.0f, 8.0f);
__m128 C = _mm_shuffle_ps(A.Data, B.Data, _MM_SHUFFLE(1, 0, 1, 0));
glm::mat4 IdentityA(
glm::vec4(4.0f, 0.7f, 0.1f, 0.01f),
glm::vec4(0.5f, 3.0f, 0.6f, 0.02f),
glm::vec4(0.2f, 0.4f, 2.0f, 0.03f),
glm::vec4(4.0f, 3.0f, 2.0f, 1.00f));
float DetA = glm::determinant(IdentityA);
glm::simd_mat4 IdentityB(
glm::simd_vec4(4.0f, 0.7f, 0.1f, 0.01f),
glm::simd_vec4(0.5f, 3.0f, 0.6f, 0.02f),
glm::simd_vec4(0.2f, 0.4f, 2.0f, 0.03f),
glm::simd_vec4(4.0f, 3.0f, 2.0f, 1.00f));
__m128 DetB = _mm_slow_det_ps(&IdentityB.Data[0].Data);
__m128 DetC = _mm_det_ps(&IdentityB.Data[0].Data);
return 0;
}