diff --git a/glm/detail/precision.hpp b/glm/detail/precision.hpp index 2be5e238..c657d031 100644 --- a/glm/detail/precision.hpp +++ b/glm/detail/precision.hpp @@ -39,6 +39,7 @@ namespace glm highp, mediump, lowp, + simd, defaultp = highp }; }//namespace glm diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 94583f1f..58868ef6 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -46,8 +46,8 @@ namespace glm{ namespace detail { - template - struct simd + template + struct simd_data { typedef T type[4]; }; @@ -56,19 +56,19 @@ namespace detail # if (GLM_ARCH & GLM_ARCH_SSE2) && GLM_NOT_BUGGY_VC32BITS template <> - struct simd + struct simd_data { typedef __m128 type; }; template <> - struct simd + struct simd_data { typedef __m128i type; }; template <> - struct simd + struct simd_data { typedef __m128i type; }; @@ -76,7 +76,7 @@ namespace detail # if (GLM_ARCH & GLM_ARCH_AVX) && GLM_NOT_BUGGY_VC32BITS template <> - struct simd + struct simd_data { typedef __m256d type; }; @@ -84,13 +84,13 @@ namespace detail # if (GLM_ARCH & GLM_ARCH_AVX2) && GLM_NOT_BUGGY_VC32BITS template <> - struct simd + struct simd_data { typedef __m256i type; }; template <> - struct simd + struct simd_data { typedef __m256i type; }; @@ -121,9 +121,7 @@ namespace detail struct { T r, g, b, a; }; struct { T s, t, p, q; }; -# ifdef GLM_SIMD - typename detail::simd::type data; -# endif + typename detail::simd_data::type data; # ifdef GLM_SWIZZLE _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w) diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 8b680dd4..62d59d11 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -1104,7 +1104,7 @@ namespace glm } }//namespace glm -#if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SIMD) && GLM_NOT_BUGGY_VC32BITS +#if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS #if GLM_ARCH & GLM_ARCH_SSE2 # include "type_vec4_sse2.inl" #endif diff --git a/glm/detail/type_vec4_sse2.inl b/glm/detail/type_vec4_sse2.inl index 623db81a..968e9fed 100644 --- a/glm/detail/type_vec4_sse2.inl +++ b/glm/detail/type_vec4_sse2.inl @@ -34,14 +34,7 @@ namespace glm{ # if !GLM_HAS_DEFAULTED_FUNCTIONS template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : data(_mm_setzero_ps()) -# endif - {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() + GLM_FUNC_QUALIFIER tvec4::tvec4() # ifndef GLM_FORCE_NO_CTOR_INIT : data(_mm_setzero_ps()) # endif @@ -49,28 +42,18 @@ namespace glm{ # endif//!GLM_HAS_DEFAULTED_FUNCTIONS template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : - data(_mm_set1_ps(s)) - {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : + GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : data(_mm_set1_ps(s)) {} template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float a, float b, float c, float d) : - data(_mm_set_ps(d, c, b, a)) - {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float a, float b, float c, float d) : + GLM_FUNC_QUALIFIER tvec4::tvec4(float a, float b, float c, float d) : data(_mm_set_ps(d, c, b, a)) {} template <> template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(U scalar) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(U scalar) { this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(scalar))); return *this; @@ -78,7 +61,7 @@ namespace glm{ template <> template <> - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(float scalar) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(float scalar) { this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar)); return *this; @@ -86,31 +69,7 @@ namespace glm{ template <> template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(U scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(scalar))); - return *this; - } - - template <> - template <> - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(float scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar)); - return *this; - } - - template <> - template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(v.x))); - return *this; - } - - template <> - template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) { this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(v.x))); return *this; diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index d4ff3cfe..b9f8098c 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -186,7 +186,6 @@ namespace glm T near, T far); - /// Creates a matrix for a right handed, symetric perspective-view frustum. /// /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. diff --git a/readme.md b/readme.md index f90bb5cb..26a36c7e 100644 --- a/readme.md +++ b/readme.md @@ -51,10 +51,8 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ## Release notes #### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/latest) - 2015-XX-XX -##### Features: -- Added GLM_SIMD to enable automatic SIMD code generation for generic GLM types #235 #370 - ##### Fixes: +- Fixed strict alignment warnings #235 #370 - Fixed link errors on compilers not supported default function #377 - Fixed compilation warnings in vec4