Fixed constexpr with SIMD interaction
This commit is contained in:
parent
92a46735d6
commit
a6047251be
@ -737,11 +737,17 @@
|
|||||||
# define GLM_RELAXED_CONSTEXPR const
|
# define GLM_RELAXED_CONSTEXPR const
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if GLM_ARCH == GLM_ARCH_PURE
|
||||||
|
# define GLM_CONSTEXPR_SIMD GLM_CONSTEXPR
|
||||||
|
#else
|
||||||
|
# define GLM_CONSTEXPR_SIMD
|
||||||
|
#endif
|
||||||
|
|
||||||
// GCC 4.6 has a bug causing a compiler crash
|
// GCC 4.6 has a bug causing a compiler crash
|
||||||
#if GLM_COMPILER & GLM_COMPILER_GCC
|
#if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
# define GLM_CONSTEXPR_GCC
|
# define GLM_CONSTEXPR_GCC
|
||||||
#else
|
#else
|
||||||
# define GLM_CONSTEXPR_GCC GLM_CONSTEXPR
|
# define GLM_CONSTEXPR_GCC GLM_CONSTEXPR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLM_FORCE_EXPLICIT_CTOR
|
#ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||||
|
@ -158,8 +158,8 @@ namespace detail
|
|||||||
// -- Explicit basic constructors --
|
// -- Explicit basic constructors --
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec4(ctor);
|
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec4(ctor);
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR_GCC explicit tvec4(T scalar);
|
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec4(T scalar);
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR tvec4(T a, T b, T c, T d);
|
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(T a, T b, T c, T d);
|
||||||
|
|
||||||
// -- Conversion scalar constructors --
|
// -- Conversion scalar constructors --
|
||||||
|
|
||||||
|
@ -63,12 +63,12 @@ namespace glm
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec4<T, P>::tvec4(T scalar)
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<T, P>::tvec4(T scalar)
|
||||||
: x(scalar), y(scalar), z(scalar), w(scalar)
|
: x(scalar), y(scalar), z(scalar), w(scalar)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(T a, T b, T c, T d)
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD 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)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace glm
|
|||||||
|
|
||||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<float, simd>::tvec4()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<float, simd>::tvec4()
|
||||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||||
: data(_mm_setzero_ps())
|
: data(_mm_setzero_ps())
|
||||||
# endif
|
# endif
|
||||||
@ -44,12 +44,12 @@ namespace glm
|
|||||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec4<float, simd>::tvec4(float s) :
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, simd>::tvec4(float s) :
|
||||||
data(_mm_set1_ps(s))
|
data(_mm_set1_ps(s))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<float, simd>::tvec4(float a, float b, float c, float d) :
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, simd>::tvec4(float a, float b, float c, float d) :
|
||||||
data(_mm_set_ps(d, c, b, a))
|
data(_mm_set_ps(d, c, b, a))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user