Merge branch '0.9.6'
This commit is contained in:
commit
2ac05f11e0
@ -116,6 +116,7 @@ namespace detail
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER < GLM_COMPILER_VC2013) && (GLM_MODEL == GLM_MODEL_32))
|
||||||
template <typename genIUType>
|
template <typename genIUType>
|
||||||
struct compute_findLSB<genIUType, 64>
|
struct compute_findLSB<genIUType, 64>
|
||||||
{
|
{
|
||||||
@ -126,6 +127,7 @@ namespace detail
|
|||||||
return IsNotNull ? int(Result) : -1;
|
return IsNotNull ? int(Result) : -1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
# endif
|
||||||
# endif//GLM_HAS_BITSCAN_WINDOWS
|
# endif//GLM_HAS_BITSCAN_WINDOWS
|
||||||
|
|
||||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType, bool EXEC = true>
|
template <typename T, glm::precision P, template <class, glm::precision> class vecType, bool EXEC = true>
|
||||||
@ -171,14 +173,6 @@ namespace detail
|
|||||||
return IsNotNull ? int(Result) : -1;
|
return IsNotNull ? int(Result) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename genIUType>
|
|
||||||
GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value)
|
|
||||||
{
|
|
||||||
unsigned long Result(0);
|
|
||||||
unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast<unsigned __int64*>(&Value));
|
|
||||||
return IsNotNull ? int(Result) : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
||||||
struct compute_findMSB_vec<T, P, vecType, 32>
|
struct compute_findMSB_vec<T, P, vecType, 32>
|
||||||
{
|
{
|
||||||
@ -188,6 +182,15 @@ namespace detail
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER < GLM_COMPILER_VC2013) && (GLM_MODEL == GLM_MODEL_32))
|
||||||
|
template <typename genIUType>
|
||||||
|
GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value)
|
||||||
|
{
|
||||||
|
unsigned long Result(0);
|
||||||
|
unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast<unsigned __int64*>(&Value));
|
||||||
|
return IsNotNull ? int(Result) : -1;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
||||||
struct compute_findMSB_vec<T, P, vecType, 64>
|
struct compute_findMSB_vec<T, P, vecType, 64>
|
||||||
{
|
{
|
||||||
@ -196,6 +199,7 @@ namespace detail
|
|||||||
return detail::functor1<int, T, P, vecType>::call(compute_findMSB_64, x);
|
return detail::functor1<int, T, P, vecType>::call(compute_findMSB_64, x);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
# endif
|
||||||
# endif//GLM_HAS_BITSCAN_WINDOWS
|
# endif//GLM_HAS_BITSCAN_WINDOWS
|
||||||
}//namespace detail
|
}//namespace detail
|
||||||
|
|
||||||
@ -203,7 +207,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry)
|
GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry)
|
||||||
{
|
{
|
||||||
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
|
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
|
||||||
uint64 const Max32(static_cast<uint64>(std::numeric_limits<uint>::max()));
|
uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
|
||||||
Carry = Value64 > Max32 ? 1 : 0;
|
Carry = Value64 > Max32 ? 1 : 0;
|
||||||
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
|
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
|
||||||
}
|
}
|
||||||
|
@ -453,9 +453,17 @@
|
|||||||
// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
|
// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
|
||||||
|
|
||||||
// N1720
|
// N1720
|
||||||
#define GLM_HAS_CXX11_STL ( \
|
/*
|
||||||
|
#if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# define GLM_HAS_CXX11_STL (GLM_LANG & GLM_LANG_CXX11_FLAG) && __has_include(<__config>)
|
||||||
|
#else
|
||||||
|
# define GLM_HAS_CXX11_STL (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015)
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
#define GLM_HAS_CXX11_STL ((GLM_PLATFORM != GLM_PLATFORM_ANDROID) && (\
|
||||||
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
||||||
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015)))
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
|
||||||
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015))))
|
||||||
|
|
||||||
// N1720
|
// N1720
|
||||||
#define GLM_HAS_STATIC_ASSERT ( \
|
#define GLM_HAS_STATIC_ASSERT ( \
|
||||||
@ -506,6 +514,14 @@
|
|||||||
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
|
||||||
__has_feature(cxx_rvalue_references))
|
__has_feature(cxx_rvalue_references))
|
||||||
|
|
||||||
|
// N2437
|
||||||
|
#define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ( \
|
||||||
|
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
||||||
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \
|
||||||
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14))) || \
|
||||||
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \
|
||||||
|
__has_feature(cxx_explicit_conversions))
|
||||||
|
|
||||||
#define GLM_HAS_STL_ARRAY ( \
|
#define GLM_HAS_STL_ARRAY ( \
|
||||||
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
||||||
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010))) || \
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010))) || \
|
||||||
|
@ -53,7 +53,9 @@ namespace detail
|
|||||||
typedef T type[4];
|
typedef T type[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
# if GLM_ARCH & GLM_ARCH_SSE2
|
# define GLM_NOT_BUGGY_VC32BITS !(GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER < GLM_COMPILER_VC2013)
|
||||||
|
|
||||||
|
# if GLM_ARCH & GLM_ARCH_SSE2 && GLM_NOT_BUGGY_VC32BITS
|
||||||
template <>
|
template <>
|
||||||
struct simd<float>
|
struct simd<float>
|
||||||
{
|
{
|
||||||
@ -73,7 +75,7 @@ namespace detail
|
|||||||
};
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if GLM_ARCH & GLM_ARCH_AVX
|
# if GLM_ARCH & GLM_ARCH_AVX && GLM_NOT_BUGGY_VC32BITS
|
||||||
template <>
|
template <>
|
||||||
struct simd<double>
|
struct simd<double>
|
||||||
{
|
{
|
||||||
@ -81,7 +83,7 @@ namespace detail
|
|||||||
};
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if GLM_ARCH & GLM_ARCH_AVX2
|
# if GLM_ARCH & GLM_ARCH_AVX2 && GLM_NOT_BUGGY_VC32BITS
|
||||||
template <>
|
template <>
|
||||||
struct simd<int64>
|
struct simd<int64>
|
||||||
{
|
{
|
||||||
|
@ -42,22 +42,6 @@ namespace glm
|
|||||||
# endif
|
# endif
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4()
|
|
||||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
|
||||||
: data(_mm_setzero_ps())
|
|
||||||
# endif
|
|
||||||
{}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4()
|
|
||||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
|
||||||
: data(_mm_setzero_ps())
|
|
||||||
# endif
|
|
||||||
{}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
template <precision Q>
|
template <precision Q>
|
||||||
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v)
|
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v)
|
||||||
@ -76,35 +60,11 @@ namespace glm
|
|||||||
: x(s), y(s), z(s), w(s)
|
: x(s), y(s), z(s), w(s)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float s) :
|
|
||||||
data(_mm_set1_ps(s))
|
|
||||||
{}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float s) :
|
|
||||||
data(_mm_set1_ps(s))
|
|
||||||
{}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T a, T b, T c, T d)
|
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T a, T b, T c, T d)
|
||||||
: x(a), y(b), z(c), w(d)
|
: x(a), y(b), z(c), w(d)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float a, float b, float c, float d) :
|
|
||||||
data(_mm_set_ps(d, c, b, a))
|
|
||||||
{}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float a, float b, float c, float d) :
|
|
||||||
data(_mm_set_ps(d, c, b, a))
|
|
||||||
{}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Conversion scalar constructors
|
// Conversion scalar constructors
|
||||||
|
|
||||||
@ -307,40 +267,6 @@ namespace glm
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
|
||||||
template <>
|
|
||||||
template <typename U>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(U scalar)
|
|
||||||
{
|
|
||||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=<float>(float scalar)
|
|
||||||
{
|
|
||||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
template <typename U>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(U scalar)
|
|
||||||
{
|
|
||||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
template <>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=<float>(float scalar)
|
|
||||||
{
|
|
||||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
template <typename U>
|
template <typename U>
|
||||||
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec1<U, P> const & v)
|
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec1<U, P> const & v)
|
||||||
@ -353,24 +279,6 @@ namespace glm
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
|
||||||
template <>
|
|
||||||
template <typename U>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(tvec1<U, lowp> const & v)
|
|
||||||
{
|
|
||||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
template <typename U>
|
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(tvec1<U, mediump> const & v)
|
|
||||||
{
|
|
||||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
template <typename U>
|
template <typename U>
|
||||||
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec4<U, P> const & v)
|
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec4<U, P> const & v)
|
||||||
@ -1187,3 +1095,15 @@ namespace glm
|
|||||||
~v.w);
|
~v.w);
|
||||||
}
|
}
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
|
#if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS
|
||||||
|
#if GLM_ARCH & GLM_ARCH_SSE2
|
||||||
|
# include "type_vec4_sse2.inl"
|
||||||
|
#endif
|
||||||
|
#if GLM_ARCH & GLM_ARCH_AVX
|
||||||
|
# include "type_vec4_avx.inl"
|
||||||
|
#endif
|
||||||
|
#if GLM_ARCH & GLM_ARCH_AVX2
|
||||||
|
# include "type_vec4_avx2.inl"
|
||||||
|
#endif
|
||||||
|
#endif//
|
||||||
|
41
glm/detail/type_vec4_avx.inl
Normal file
41
glm/detail/type_vec4_avx.inl
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// OpenGL Mathematics (glm.g-truc.net)
|
||||||
|
///
|
||||||
|
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||||
|
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
/// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
/// in the Software without restriction, including without limitation the rights
|
||||||
|
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
/// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
/// furnished to do so, subject to the following conditions:
|
||||||
|
///
|
||||||
|
/// The above copyright notice and this permission notice shall be included in
|
||||||
|
/// all copies or substantial portions of the Software.
|
||||||
|
///
|
||||||
|
/// Restrictions:
|
||||||
|
/// By making use of the Software for military purposes, you choose to make
|
||||||
|
/// a Bunny unhappy.
|
||||||
|
///
|
||||||
|
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
/// THE SOFTWARE.
|
||||||
|
///
|
||||||
|
/// @ref core
|
||||||
|
/// @file glm/detail/type_tvec4_avx.inl
|
||||||
|
/// @date 2014-12-01 / 2014-12-01
|
||||||
|
/// @author Christophe Riccio
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
namespace glm{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
}//namespace detail
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}//namespace glm
|
41
glm/detail/type_vec4_avx2.inl
Normal file
41
glm/detail/type_vec4_avx2.inl
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// OpenGL Mathematics (glm.g-truc.net)
|
||||||
|
///
|
||||||
|
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||||
|
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
/// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
/// in the Software without restriction, including without limitation the rights
|
||||||
|
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
/// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
/// furnished to do so, subject to the following conditions:
|
||||||
|
///
|
||||||
|
/// The above copyright notice and this permission notice shall be included in
|
||||||
|
/// all copies or substantial portions of the Software.
|
||||||
|
///
|
||||||
|
/// Restrictions:
|
||||||
|
/// By making use of the Software for military purposes, you choose to make
|
||||||
|
/// a Bunny unhappy.
|
||||||
|
///
|
||||||
|
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
/// THE SOFTWARE.
|
||||||
|
///
|
||||||
|
/// @ref core
|
||||||
|
/// @file glm/detail/type_tvec4_avx2.inl
|
||||||
|
/// @date 2014-12-01 / 2014-12-01
|
||||||
|
/// @author Christophe Riccio
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
namespace glm{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
}//namespace detail
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}//namespace glm
|
120
glm/detail/type_vec4_sse2.inl
Normal file
120
glm/detail/type_vec4_sse2.inl
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// OpenGL Mathematics (glm.g-truc.net)
|
||||||
|
///
|
||||||
|
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||||
|
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
/// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
/// in the Software without restriction, including without limitation the rights
|
||||||
|
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
/// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
/// furnished to do so, subject to the following conditions:
|
||||||
|
///
|
||||||
|
/// The above copyright notice and this permission notice shall be included in
|
||||||
|
/// all copies or substantial portions of the Software.
|
||||||
|
///
|
||||||
|
/// Restrictions:
|
||||||
|
/// By making use of the Software for military purposes, you choose to make
|
||||||
|
/// a Bunny unhappy.
|
||||||
|
///
|
||||||
|
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
/// THE SOFTWARE.
|
||||||
|
///
|
||||||
|
/// @ref core
|
||||||
|
/// @file glm/detail/type_tvec4_sse2.inl
|
||||||
|
/// @date 2014-12-01 / 2014-12-01
|
||||||
|
/// @author Christophe Riccio
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
namespace glm{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
}//namespace detail
|
||||||
|
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4()
|
||||||
|
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||||
|
: data(_mm_setzero_ps())
|
||||||
|
# endif
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4()
|
||||||
|
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||||
|
: data(_mm_setzero_ps())
|
||||||
|
# endif
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float s) :
|
||||||
|
data(_mm_set1_ps(s))
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float s) :
|
||||||
|
data(_mm_set1_ps(s))
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float a, float b, float c, float d) :
|
||||||
|
data(_mm_set_ps(d, c, b, a))
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float a, float b, float c, float d) :
|
||||||
|
data(_mm_set_ps(d, c, b, a))
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
template <typename U>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(U scalar)
|
||||||
|
{
|
||||||
|
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=<float>(float scalar)
|
||||||
|
{
|
||||||
|
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
template <typename U>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(U scalar)
|
||||||
|
{
|
||||||
|
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
template <>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=<float>(float scalar)
|
||||||
|
{
|
||||||
|
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
template <typename U>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(tvec1<U, lowp> const & v)
|
||||||
|
{
|
||||||
|
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
template <typename U>
|
||||||
|
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(tvec1<U, mediump> const & v)
|
||||||
|
{
|
||||||
|
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
}//namespace glm
|
@ -40,7 +40,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
//Equivalent to return findMSB(vec); but save one function call in ASM with VC
|
//Equivalent to return findMSB(vec); but save one function call in ASM with VC
|
||||||
//return findMSB(vec);
|
//return findMSB(vec);
|
||||||
return detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(vec);
|
return vecType<T, P>(detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(vec));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -113,8 +113,10 @@ namespace glm
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
// explicit conversion operators
|
// explicit conversion operators
|
||||||
GLM_FUNC_DECL explicit operator tmat3x3<T, P>();
|
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
|
||||||
GLM_FUNC_DECL explicit operator tmat4x4<T, P>();
|
GLM_FUNC_DECL explicit operator tmat3x3<T, P>();
|
||||||
|
GLM_FUNC_DECL explicit operator tmat4x4<T, P>();
|
||||||
|
# endif
|
||||||
|
|
||||||
/// Create a quaternion from two normalized axis
|
/// Create a quaternion from two normalized axis
|
||||||
///
|
///
|
||||||
|
@ -190,7 +190,8 @@ namespace detail
|
|||||||
{
|
{
|
||||||
*this = quat_cast(m);
|
*this = quat_cast(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat3x3<T, P>()
|
GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat3x3<T, P>()
|
||||||
{
|
{
|
||||||
@ -202,6 +203,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
return mat4_cast(*this);
|
return mat4_cast(*this);
|
||||||
}
|
}
|
||||||
|
# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const & q)
|
GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const & q)
|
||||||
|
11
readme.txt
11
readme.txt
@ -62,6 +62,17 @@ GLM is a header only library, there is nothing to build, just include it.
|
|||||||
More informations in GLM manual:
|
More informations in GLM manual:
|
||||||
http://glm.g-truc.net/glm.pdf
|
http://glm.g-truc.net/glm.pdf
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
GLM 0.9.6.1: 2014-12-XX
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
Fixes:
|
||||||
|
- Fixed scalar uaddCarry build error with Cuda #276
|
||||||
|
- Fixed C++11 explicit conversion operators detection #282
|
||||||
|
- Fixed missing explicit convertion when using integer log2 with *vec1 types
|
||||||
|
- Fixed Android build issue, STL C++11 is not supported by the NDK #284
|
||||||
|
- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10
|
||||||
|
- Fixed Visual C++ 32 bit build #283
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
GLM 0.9.6.0: 2014-11-30
|
GLM 0.9.6.0: 2014-11-30
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
@ -49,17 +49,17 @@ namespace log2_
|
|||||||
{
|
{
|
||||||
int Error = 0;
|
int Error = 0;
|
||||||
|
|
||||||
int A0(glm::log2(10.f));
|
int A0 = static_cast<int>(glm::log2(16.f));
|
||||||
glm::ivec1 B0(glm::log2(glm::vec1(10.f)));
|
glm::ivec1 B0(glm::log2(glm::vec1(16.f)));
|
||||||
glm::ivec2 C0(glm::log2(glm::vec2(10.f)));
|
glm::ivec2 C0(glm::log2(glm::vec2(16.f)));
|
||||||
glm::ivec3 D0(glm::log2(glm::vec3(10.f)));
|
glm::ivec3 D0(glm::log2(glm::vec3(16.f)));
|
||||||
glm::ivec4 E0(glm::log2(glm::vec4(10.f)));
|
glm::ivec4 E0(glm::log2(glm::vec4(16.f)));
|
||||||
|
|
||||||
int A1 = glm::log2(int(10.f));
|
int A1 = glm::log2(int(16));
|
||||||
glm::ivec1 B1 = glm::log2(glm::ivec1(10.f));
|
glm::ivec1 B1 = glm::log2(glm::ivec1(16));
|
||||||
glm::ivec2 C1 = glm::log2(glm::ivec2(10.f));
|
glm::ivec2 C1 = glm::log2(glm::ivec2(16));
|
||||||
glm::ivec3 D1 = glm::log2(glm::ivec3(10.f));
|
glm::ivec3 D1 = glm::log2(glm::ivec3(16));
|
||||||
glm::ivec4 E1 = glm::log2(glm::ivec4(10.f));
|
glm::ivec4 E1 = glm::log2(glm::ivec4(16));
|
||||||
|
|
||||||
Error += A0 == A1 ? 0 : 1;
|
Error += A0 == A1 ? 0 : 1;
|
||||||
Error += glm::all(glm::equal(B0, B1)) ? 0 : 1;
|
Error += glm::all(glm::equal(B0, B1)) ? 0 : 1;
|
||||||
@ -67,6 +67,18 @@ namespace log2_
|
|||||||
Error += glm::all(glm::equal(D0, D1)) ? 0 : 1;
|
Error += glm::all(glm::equal(D0, D1)) ? 0 : 1;
|
||||||
Error += glm::all(glm::equal(E0, E1)) ? 0 : 1;
|
Error += glm::all(glm::equal(E0, E1)) ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint64 A2 = glm::log2(glm::uint64(16));
|
||||||
|
glm::u64vec1 B2 = glm::log2(glm::u64vec1(16));
|
||||||
|
glm::u64vec2 C2 = glm::log2(glm::u64vec2(16));
|
||||||
|
glm::u64vec3 D2 = glm::log2(glm::u64vec3(16));
|
||||||
|
glm::u64vec4 E2 = glm::log2(glm::u64vec4(16));
|
||||||
|
|
||||||
|
Error += A2 == glm::uint64(4) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(B2, glm::u64vec1(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(C2, glm::u64vec2(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(D2, glm::u64vec3(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(E2, glm::u64vec4(4))) ? 0 : 1;
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +93,7 @@ namespace log2_
|
|||||||
|
|
||||||
std::clock_t Begin = clock();
|
std::clock_t Begin = clock();
|
||||||
|
|
||||||
for(std::size_t i = 0; i < Count; ++i)
|
for(int i = 0; i < static_cast<int>(Count); ++i)
|
||||||
Result[i] = glm::log2(static_cast<int>(i));
|
Result[i] = glm::log2(static_cast<int>(i));
|
||||||
|
|
||||||
std::clock_t End = clock();
|
std::clock_t End = clock();
|
||||||
@ -95,7 +107,7 @@ namespace log2_
|
|||||||
|
|
||||||
std::clock_t Begin = clock();
|
std::clock_t Begin = clock();
|
||||||
|
|
||||||
for(std::size_t i = 0; i < Count; ++i)
|
for(int i = 0; i < static_cast<int>(Count); ++i)
|
||||||
Result[i] = glm::log2(glm::ivec4(i));
|
Result[i] = glm::log2(glm::ivec4(i));
|
||||||
|
|
||||||
std::clock_t End = clock();
|
std::clock_t End = clock();
|
||||||
@ -186,7 +198,7 @@ namespace log2_
|
|||||||
|
|
||||||
std::clock_t Begin = clock();
|
std::clock_t Begin = clock();
|
||||||
|
|
||||||
for(std::size_t i = 0; i < Count; ++i)
|
for(int i = 0; i < static_cast<int>(Count); ++i)
|
||||||
Result[i] = glm::log2(glm::vec4(i));
|
Result[i] = glm::log2(glm::vec4(i));
|
||||||
|
|
||||||
std::clock_t End = clock();
|
std::clock_t End = clock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user