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_integer_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 'external/include/glm/detail/func_integer_simd.inl')
-rw-r--r-- | external/include/glm/detail/func_integer_simd.inl | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/external/include/glm/detail/func_integer_simd.inl b/external/include/glm/detail/func_integer_simd.inl index 6175860..690671a 100644 --- a/external/include/glm/detail/func_integer_simd.inl +++ b/external/include/glm/detail/func_integer_simd.inl @@ -8,54 +8,54 @@ namespace glm{ namespace detail { - template <glm::precision P> - struct compute_bitfieldReverseStep<uint32, P, tvec4, true, true> + template<qualifier Q> + struct compute_bitfieldReverseStep<4, uint32, Q, true, true> { - GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift) + GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift) { __m128i const set0 = v.data; - __m128i const set1 = _mm_set1_epi32(Mask); + __m128i const set1 = _mm_set1_epi32(static_cast<int>(Mask)); __m128i const and1 = _mm_and_si128(set0, set1); __m128i const sft1 = _mm_slli_epi32(and1, Shift); __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); __m128i const and2 = _mm_and_si128(set0, set2); __m128i const sft2 = _mm_srai_epi32(and2, Shift); - + __m128i const or0 = _mm_or_si128(sft1, sft2); - + return or0; } }; - template <glm::precision P> - struct compute_bitfieldBitCountStep<uint32, P, tvec4, true, true> + template<qualifier Q> + struct compute_bitfieldBitCountStep<4, uint32, Q, true, true> { - GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift) + GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift) { __m128i const set0 = v.data; - __m128i const set1 = _mm_set1_epi32(Mask); + __m128i const set1 = _mm_set1_epi32(static_cast<int>(Mask)); __m128i const and0 = _mm_and_si128(set0, set1); __m128i const sft0 = _mm_slli_epi32(set0, Shift); __m128i const and1 = _mm_and_si128(sft0, set1); __m128i const add0 = _mm_add_epi32(and0, and1); - + return add0; } }; }//namespace detail # if GLM_ARCH & GLM_ARCH_AVX_BIT - template <> + template<> GLM_FUNC_QUALIFIER int bitCount(uint32 x) { return _mm_popcnt_u32(x); } # if(GLM_MODEL == GLM_MODEL_64) - template <> + template<> GLM_FUNC_QUALIFIER int bitCount(uint64 x) { return static_cast<int>(_mm_popcnt_u64(x)); |