From 2877f4eda3d1b0c7431039e3142ecf1a282a34b1 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Tue, 21 Aug 2018 20:40:38 +0500 Subject: Update glm to 0.9.9.0 --- external/include/glm/gtc/quaternion_simd.inl | 88 ++++++++++++++-------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'external/include/glm/gtc/quaternion_simd.inl') diff --git a/external/include/glm/gtc/quaternion_simd.inl b/external/include/glm/gtc/quaternion_simd.inl index cca874b..06ca7b7 100644 --- a/external/include/glm/gtc/quaternion_simd.inl +++ b/external/include/glm/gtc/quaternion_simd.inl @@ -7,10 +7,10 @@ namespace glm{ namespace detail { /* - template - struct compute_quat_mul + template + struct compute_quat_mul { - static tquat call(tquat const& q1, tquat const& q2) + static tquat call(tquat const& q1, tquat const& q2) { // SSE2 STATS: 11 shuffle, 8 mul, 8 add // SSE4 STATS: 3 shuffle, 4 mul, 4 dpps @@ -51,7 +51,7 @@ namespace detail // //return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0)); - tquat Result(uninitialize); + tquat Result; _mm_store_ss(&Result.x, add4); _mm_store_ss(&Result.y, add5); _mm_store_ss(&Result.z, add6); @@ -61,122 +61,122 @@ namespace detail }; */ - template - struct compute_dot + template + struct compute_dot, float, true> { - static GLM_FUNC_QUALIFIER float call(tquat const& x, tquat const& y) + static GLM_FUNC_QUALIFIER float call(tquat const& x, tquat const& y) { return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); } }; - template - struct compute_quat_add + template + struct compute_quat_add { - static tquat call(tquat const& q, tquat const& p) + static tquat call(tquat const& q, tquat const& p) { - tquat Result(uninitialize); + tquat Result; Result.data = _mm_add_ps(q.data, p.data); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_add + template + struct compute_quat_add { - static tquat call(tquat const & a, tquat const & b) + static tquat call(tquat const& a, tquat const& b) { - tquat Result(uninitialize); + tquat Result; Result.data = _mm256_add_pd(a.data, b.data); return Result; } }; # endif - template - struct compute_quat_sub + template + struct compute_quat_sub { - static tquat call(tquat const& q, tquat const& p) + static tquat call(tquat const& q, tquat const& p) { - tvec4 Result(uninitialize); + vec<4, float, Q> Result; Result.data = _mm_sub_ps(q.data, p.data); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_sub + template + struct compute_quat_sub { - static tquat call(tquat const & a, tquat const & b) + static tquat call(tquat const& a, tquat const& b) { - tquat Result(uninitialize); + tquat Result; Result.data = _mm256_sub_pd(a.data, b.data); return Result; } }; # endif - template - struct compute_quat_mul_scalar + template + struct compute_quat_mul_scalar { - static tquat call(tquat const& q, float s) + static tquat call(tquat const& q, float s) { - tvec4 Result(uninitialize); + vec<4, float, Q> Result; Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s)); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_mul_scalar + template + struct compute_quat_mul_scalar { - static tquat call(tquat const& q, double s) + static tquat call(tquat const& q, double s) { - tquat Result(uninitialize); + tquat Result; Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s)); return Result; } }; # endif - template - struct compute_quat_div_scalar + template + struct compute_quat_div_scalar { - static tquat call(tquat const& q, float s) + static tquat call(tquat const& q, float s) { - tvec4 Result(uninitialize); + vec<4, float, Q> Result; Result.data = _mm_div_ps(q.data, _mm_set_ps1(s)); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_div_scalar + template + struct compute_quat_div_scalar { - static tquat call(tquat const& q, double s) + static tquat call(tquat const& q, double s) { - tquat Result(uninitialize); + tquat Result; Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s)); return Result; } }; # endif - template - struct compute_quat_mul_vec4 + template + struct compute_quat_mul_vec4 { - static tvec4 call(tquat const& q, tvec4 const& v) + static vec<4, float, Q> call(tquat const& q, vec<4, float, Q> const& v) { __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3)); __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1)); __m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2)); __m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1)); __m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2)); - + __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); @@ -186,7 +186,7 @@ namespace detail uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); uuv = _mm_mul_ps(uuv, two); - tvec4 Result(uninitialize); + vec<4, float, Q> Result; Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv)); return Result; } -- cgit v1.2.3