diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-21 17:40:38 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-21 17:40:38 +0200 |
commit | 2877f4eda3d1b0c7431039e3142ecf1a282a34b1 (patch) | |
tree | 58ad35e27ab2a3b8955f5adbf28f296670681ffc /external/include/glm/detail/func_common_simd.inl | |
parent | Smooth sun movement (diff) | |
download | AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.gz AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.bz2 AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.lz AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.xz AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.zst AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.zip |
Diffstat (limited to '')
-rw-r--r-- | external/include/glm/detail/func_common_simd.inl | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/external/include/glm/detail/func_common_simd.inl b/external/include/glm/detail/func_common_simd.inl index c76f180..a3482ff 100644 --- a/external/include/glm/detail/func_common_simd.inl +++ b/external/include/glm/detail/func_common_simd.inl @@ -10,191 +10,191 @@ namespace glm{ namespace detail { - template <precision P> - struct compute_abs_vector<float, P, tvec4, true> + template<qualifier Q> + struct compute_abs_vector<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = glm_vec4_abs(v.data); return result; } }; - template <precision P> - struct compute_abs_vector<int, P, tvec4, true> + template<qualifier Q> + struct compute_abs_vector<4, int, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & v) + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) { - tvec4<int, P> result(uninitialize); + vec<4, int, Q> result; result.data = glm_ivec4_abs(v.data); return result; } }; - template <precision P> - struct compute_floor<float, P, tvec4, true> + template<qualifier Q> + struct compute_floor<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = glm_vec4_floor(v.data); return result; } }; - template <precision P> - struct compute_ceil<float, P, tvec4, true> + template<qualifier Q> + struct compute_ceil<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = glm_vec4_ceil(v.data); return result; } }; - template <precision P> - struct compute_fract<float, P, tvec4, true> + template<qualifier Q> + struct compute_fract<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = glm_vec4_fract(v.data); return result; } }; - template <precision P> - struct compute_round<float, P, tvec4, true> + template<qualifier Q> + struct compute_round<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = glm_vec4_round(v.data); return result; } }; - template <precision P> - struct compute_mod<float, P, tvec4, true> + template<qualifier Q> + struct compute_mod<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = glm_vec4_mod(x.data, y.data); return result; } }; - template <precision P> - struct compute_min_vector<float, P, tvec4, true> + template<qualifier Q> + struct compute_min_vector<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = _mm_min_ps(v1.data, v2.data); return result; } }; - template <precision P> - struct compute_min_vector<int32, P, tvec4, true> + template<qualifier Q> + struct compute_min_vector<4, int32, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2) + GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) { - tvec4<int32, P> result(uninitialize); + vec<4, int32, Q> result; result.data = _mm_min_epi32(v1.data, v2.data); return result; } }; - template <precision P> - struct compute_min_vector<uint32, P, tvec4, true> + template<qualifier Q> + struct compute_min_vector<4, uint32, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2) + GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, uint32, Q> const& v1, vec<4, uint32, Q> const& v2) { - tvec4<uint32, P> result(uninitialize); + vec<4, uint32, Q> result; result.data = _mm_min_epu32(v1.data, v2.data); return result; } }; - template <precision P> - struct compute_max_vector<float, P, tvec4, true> + template<qualifier Q> + struct compute_max_vector<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = _mm_max_ps(v1.data, v2.data); return result; } }; - template <precision P> - struct compute_max_vector<int32, P, tvec4, true> + template<qualifier Q> + struct compute_max_vector<4, int32, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2) + GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) { - tvec4<int32, P> result(uninitialize); + vec<4, int32, Q> result; result.data = _mm_max_epi32(v1.data, v2.data); return result; } }; - template <precision P> - struct compute_max_vector<uint32, P, tvec4, true> + template<qualifier Q> + struct compute_max_vector<4, uint32, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2) + GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v1, vec<4, uint32, Q> const& v2) { - tvec4<uint32, P> result(uninitialize); + vec<4, uint32, Q> result; result.data = _mm_max_epu32(v1.data, v2.data); return result; } }; - template <precision P> - struct compute_clamp_vector<float, P, tvec4, true> + template<qualifier Q> + struct compute_clamp_vector<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & minVal, tvec4<float, P> const & maxVal) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> result; result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data); return result; } }; - template <precision P> - struct compute_clamp_vector<int32, P, tvec4, true> + template<qualifier Q> + struct compute_clamp_vector<4, int32, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & x, tvec4<int32, P> const & minVal, tvec4<int32, P> const & maxVal) + GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, int32, Q> const& x, vec<4, int32, Q> const& minVal, vec<4, int32, Q> const& maxVal) { - tvec4<int32, P> result(uninitialize); + vec<4, int32, Q> result; result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data); return result; } }; - template <precision P> - struct compute_clamp_vector<uint32, P, tvec4, true> + template<qualifier Q> + struct compute_clamp_vector<4, uint32, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & x, tvec4<uint32, P> const & minVal, tvec4<uint32, P> const & maxVal) + GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& x, vec<4, uint32, Q> const& minVal, vec<4, uint32, Q> const& maxVal) { - tvec4<uint32, P> result(uninitialize); + vec<4, uint32, Q> result; result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data); return result; } }; - template <precision P> - struct compute_mix_vector<float, bool, P, tvec4, true> + template<qualifier Q> + struct compute_mix_vector<4, float, bool, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y, tvec4<bool, P> const & a) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a) { - __m128i const Load = _mm_set_epi32(-(int)a.w, -(int)a.z, -(int)a.y, -(int)a.x); + __m128i const Load = _mm_set_epi32(-static_cast<int>(a.w), -static_cast<int>(a.z), -static_cast<int>(a.y), -static_cast<int>(a.x)); __m128 const Mask = _mm_castsi128_ps(Load); - tvec4<float, P> Result(uninitialize); + vec<4, float, Q> Result; # if 0 && GLM_ARCH & GLM_ARCH_AVX Result.data = _mm_blendv_ps(x.data, y.data, Mask); # else @@ -204,25 +204,25 @@ namespace detail } }; /* FIXME - template <precision P> - struct compute_step_vector<float, P, tvec4> + template<qualifier Q> + struct compute_step_vector<float, Q, tvec4> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge, tvec4<float, P> const& x) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge, vec<4, float, Q> const& x) { - tvec4<float, P> result(uninitialize); + vec<4, float, Q> Result; result.data = glm_vec4_step(edge.data, x.data); return result; } }; */ - template <precision P> - struct compute_smoothstep_vector<float, P, tvec4, true> + template<qualifier Q> + struct compute_smoothstep_vector<4, float, Q, true> { - GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge0, tvec4<float, P> const& edge1, tvec4<float, P> const& x) + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x) { - tvec4<float, P> result(uninitialize); - result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data); - return result; + vec<4, float, Q> Result; + Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data); + return Result; } }; }//namespace detail |