Merge branch '0.9.3' into swizzle

This commit is contained in:
Christophe Riccio 2011-10-18 14:15:36 +01:00
commit f4b1844b9a
8 changed files with 104 additions and 35 deletions

View File

@ -522,7 +522,7 @@ namespace glm
}
// findMSB
#if(GLM_COMPILER & GLM_COMPILER_VC)
#if((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_VC))
template <typename genIUType>
GLM_FUNC_QUALIFIER int findMSB
@ -535,7 +535,7 @@ namespace glm
return int(Result);
}
#elif((GLM_COMPILER & GLM_COMPILER_GCC) && __has_builtin(__builtin_clz))
#elif((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC40))
template <typename genIUType>
GLM_FUNC_QUALIFIER int findMSB
@ -543,7 +543,7 @@ namespace glm
genIUType const & Value
)
{
return __builtin_clz(x);
return __builtin_clz(Value);
}
#else

View File

@ -118,33 +118,55 @@ namespace detail
// Unary arithmetic operators
GLM_FUNC_DECL tvec1<T> & operator= (tvec1<T> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator= (tvec1<U> const & v);
GLM_FUNC_DECL tvec1<T> & operator+=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator+=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator-=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator-=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator*=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator*=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator/=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator/=(tvec1<T> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator+=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator+=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator-=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator-=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator*=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator*=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator/=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator/=(tvec1<U> const & v);
GLM_FUNC_DECL tvec1<T> & operator++();
GLM_FUNC_DECL tvec1<T> & operator--();
//////////////////////////////////////
// Unary bit operators
GLM_FUNC_DECL tvec1<T> & operator%=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator%=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator&=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator&=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator|=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator|=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator^=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator^=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator<<=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator<<=(tvec1<T> const & v);
GLM_FUNC_DECL tvec1<T> & operator>>=(value_type const & s);
GLM_FUNC_DECL tvec1<T> & operator>>=(tvec1<T> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator%=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator%=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator&=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator&=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator|=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator|=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator^=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator^=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator<<=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator<<=(tvec1<U> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator>>=(U const & s);
template <typename U>
GLM_FUNC_DECL tvec1<T> & operator>>=(tvec1<U> const & v);
//////////////////////////////////////
// Swizzle operators

View File

@ -65,27 +65,32 @@ namespace glm
typedef detail::int32 int32; //!< \brief 32bit signed integer. (from GLM_GTC_type_precision extension)
typedef detail::int64 int64; //!< \brief 64bit signed integer. (from GLM_GTC_type_precision extension)
typedef detail::int8 int8_t; //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension)
typedef detail::int16 int16_t; //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension)
typedef detail::int32 int32_t; //!< \brief 32bit signed integer. (from GLM_GTC_type_precision extension)
typedef detail::int64 int64_t; //!< \brief 64bit signed integer. (from GLM_GTC_type_precision extension)
typedef int8 i8; //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension)
typedef int16 i16; //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension)
typedef int32 i32; //!< \brief 32bit signed integer. (from GLM_GTC_type_precision extension)
typedef int64 i64; //!< \brief 64bit signed integer. (from GLM_GTC_type_precision extension)
//typedef i8 i8vec1; //!< \brief 8bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<i8> i8vec1; //!< \brief 8bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<i8> i8vec2; //!< \brief 8bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<i8> i8vec3; //!< \brief 8bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<i8> i8vec4; //!< \brief 8bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef i16 i16vec1; //!< \brief 16bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<i16> i16vec1; //!< \brief 16bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<i16> i16vec2; //!< \brief 16bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<i16> i16vec3; //!< \brief 16bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<i16> i16vec4; //!< \brief 16bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef i32 i32vec1; //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<i32> i32vec1; //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<i32> i32vec2; //!< \brief 32bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<i32> i32vec3; //!< \brief 32bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<i32> i32vec4; //!< \brief 32bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef i64 i64vec1; //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<i64> i64vec1; //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<i64> i64vec2; //!< \brief 64bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<i64> i64vec3; //!< \brief 64bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<i64> i64vec4; //!< \brief 64bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
@ -98,27 +103,32 @@ namespace glm
typedef detail::uint32 uint32; //!< \brief 32bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef detail::uint64 uint64; //!< \brief 64bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef detail::uint8 uint8_t; //!< \brief 8bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef detail::uint16 uint16_t; //!< \brief 16bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef detail::uint32 uint32_t; //!< \brief 32bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef detail::uint64 uint64_t; //!< \brief 64bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef uint8 u8; //!< \brief 8bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef uint16 u16; //!< \brief 16bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef uint32 u32; //!< \brief 32bit unsigned integer. (from GLM_GTC_type_precision extension)
typedef uint64 u64; //!< \brief 64bit unsigned integer. (from GLM_GTC_type_precision extension)
//typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<u8> u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<u8> u8vec2; //!< \brief 8bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<u8> u8vec3; //!< \brief 8bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<u8> u8vec4; //!< \brief 8bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<u16> u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<u16> u16vec2; //!< \brief 16bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<u16> u16vec3; //!< \brief 16bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<u16> u16vec4; //!< \brief 16bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<u32> u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<u32> u32vec2; //!< \brief 32bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<u32> u32vec3; //!< \brief 32bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<u32> u32vec4; //!< \brief 32bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<u64> u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<u64> u64vec2; //!< \brief 64bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<u64> u64vec3; //!< \brief 64bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<u64> u64vec4; //!< \brief 64bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
@ -130,6 +140,10 @@ namespace glm
typedef detail::float32 float32; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::float64 float64; //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::float16 float16_t; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::float32 float32_t; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::float64 float64_t; //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef float16 f16; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef float32 f32; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef float64 f64; //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)
@ -138,17 +152,17 @@ namespace glm
typedef detail::tvec3<float> fvec3; //!< Vector of 3 single-precision floating-point numbers. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<float> fvec4; //!< Vector of 4 single-precision floating-point numbers. (from GLM_GTC_type_precision extension)
//typedef f16 f16vec1; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<f16> f16vec1; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<f16> f16vec2; //!< \brief Half-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<f16> f16vec3; //!< \brief Half-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<f16> f16vec4; //!< \brief Half-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef f32 f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<f32> f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<f32> f32vec2; //!< \brief Single-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<f32> f32vec3; //!< \brief Single-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<f32> f32vec4; //!< \brief Single-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension)
//typedef f64 f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec1<f64> f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
typedef detail::tvec2<f64> f64vec2; //!< \brief Double-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec3<f64> f64vec3; //!< \brief Double-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension)
typedef detail::tvec4<f64> f64vec4; //!< \brief Double-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension)

View File

@ -41,6 +41,8 @@
// Dependency:
#include "../glm.hpp"
#if(GLM_ARCH != GLM_ARCH_PURE)
#if(GLM_ARCH & GLM_ARCH_SSE2)
# include "../core/intrinsic_matrix.hpp"
# include "../gtx/simd_vec4.hpp"
@ -197,4 +199,6 @@ namespace detail
#include "simd_mat4.inl"
#endif//(GLM_ARCH != GLM_ARCH_PURE)
#endif//GLM_GTX_simd_mat4

View File

@ -41,6 +41,8 @@
// Dependency:
#include "../glm.hpp"
#if(GLM_ARCH != GLM_ARCH_PURE)
#if(GLM_ARCH & GLM_ARCH_SSE2)
# include "../core/intrinsic_common.hpp"
# include "../core/intrinsic_geometric.hpp"
@ -488,4 +490,6 @@ namespace detail
#include "simd_vec4.inl"
#endif//(GLM_ARCH != GLM_ARCH_PURE)
#endif//GLM_GTX_simd_vec4

View File

@ -10,7 +10,7 @@
#include <glm/glm.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/epsilon.hpp>
#include <iostream>
#include <cstdio>
int test_floor_log2()
{

View File

@ -18,6 +18,8 @@
#include <ctime>
#include <vector>
#if(GLM_ARCH != GLM_ARCH_PURE)
std::vector<float> test_detA(std::vector<glm::mat4> const & Data)
{
std::vector<float> Test(Data.size());
@ -288,3 +290,13 @@ int main()
return Error;
}
#else
int main()
{
int Error = 0;
return Error;
}
#endif//(GLM_ARCH != GLM_ARCH_PURE)

View File

@ -11,6 +11,8 @@
#include <glm/gtx/simd_vec4.hpp>
#include <cstdio>
#if(GLM_ARCH != GLM_ARCH_PURE)
int main()
{
glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
@ -28,3 +30,14 @@ int main()
return 0;
}
#else
int main()
{
int Error = 0;
return Error;
}
#endif//(GLM_ARCH != GLM_ARCH_PURE)