Fixed SIMD build

This commit is contained in:
Christophe Riccio 2017-08-16 03:43:17 +02:00
parent 1bbf2dafb9
commit fdfd03ffaf
2 changed files with 32 additions and 32 deletions

View File

@ -14,7 +14,7 @@ namespace detail
template<qualifier Q>
struct compute_matrixCompMult<4, 4, float, Q, true>
{
GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned");
GLM_STATIC_ASSERT(detail::is_aligned<Q>::value, "Specialization requires aligned");
GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& x, mat<4, 4, float, Q> const& y)
{

View File

@ -8,9 +8,9 @@ namespace detail
{
/*
template<qualifier Q>
struct compute_quat_mul<float, P, true>
struct compute_quat_mul<float, Q, true>
{
static tquat<float, P> call(tquat<float, Q> const& q1, tquat<float, Q> const& q2)
static tquat<float, Q> call(tquat<float, Q> const& q1, tquat<float, Q> const& q2)
{
// SSE2 STATS: 11 shuffle, 8 mul, 8 add
// SSE4 STATS: 3 shuffle, 4 mul, 4 dpps
@ -51,7 +51,7 @@ namespace detail
//
//return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0));
tquat<float, P> Result;
tquat<float, Q> Result;
_mm_store_ss(&Result.x, add4);
_mm_store_ss(&Result.y, add5);
_mm_store_ss(&Result.z, add6);
@ -62,7 +62,7 @@ namespace detail
*/
template<qualifier Q>
struct compute_dot<tquat<float, P>, float, true>
struct compute_dot<tquat<float, Q>, float, true>
{
static GLM_FUNC_QUALIFIER float call(tquat<float, Q> const& x, tquat<float, Q> const& y)
{
@ -71,11 +71,11 @@ namespace detail
};
template<qualifier Q>
struct compute_quat_add<float, P, true>
struct compute_quat_add<float, Q, true>
{
static tquat<float, P> call(tquat<float, Q> const& q, tquat<float, Q> const& p)
static tquat<float, Q> call(tquat<float, Q> const& q, tquat<float, Q> const& p)
{
tquat<float, P> Result;
tquat<float, Q> Result;
Result.data = _mm_add_ps(q.data, p.data);
return Result;
}
@ -83,11 +83,11 @@ namespace detail
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier Q>
struct compute_quat_add<double, P, true>
struct compute_quat_add<double, Q, true>
{
static tquat<double, P> call(tquat<double, Q> const& a, tquat<double, Q> const& b)
static tquat<double, Q> call(tquat<double, Q> const& a, tquat<double, Q> const& b)
{
tquat<double, P> Result;
tquat<double, Q> Result;
Result.data = _mm256_add_pd(a.data, b.data);
return Result;
}
@ -95,11 +95,11 @@ namespace detail
# endif
template<qualifier Q>
struct compute_quat_sub<float, P, true>
struct compute_quat_sub<float, Q, true>
{
static tquat<float, P> call(tquat<float, Q> const& q, tquat<float, Q> const& p)
static tquat<float, Q> call(tquat<float, Q> const& q, tquat<float, Q> const& p)
{
vec<4, float, P> Result;
vec<4, float, Q> Result;
Result.data = _mm_sub_ps(q.data, p.data);
return Result;
}
@ -107,11 +107,11 @@ namespace detail
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier Q>
struct compute_quat_sub<double, P, true>
struct compute_quat_sub<double, Q, true>
{
static tquat<double, P> call(tquat<double, Q> const& a, tquat<double, Q> const& b)
static tquat<double, Q> call(tquat<double, Q> const& a, tquat<double, Q> const& b)
{
tquat<double, P> Result;
tquat<double, Q> Result;
Result.data = _mm256_sub_pd(a.data, b.data);
return Result;
}
@ -119,11 +119,11 @@ namespace detail
# endif
template<qualifier Q>
struct compute_quat_mul_scalar<float, P, true>
struct compute_quat_mul_scalar<float, Q, true>
{
static tquat<float, P> call(tquat<float, Q> const& q, float s)
static tquat<float, Q> call(tquat<float, Q> const& q, float s)
{
vec<4, float, P> Result;
vec<4, float, Q> Result;
Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s));
return Result;
}
@ -131,11 +131,11 @@ namespace detail
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier Q>
struct compute_quat_mul_scalar<double, P, true>
struct compute_quat_mul_scalar<double, Q, true>
{
static tquat<double, P> call(tquat<double, Q> const& q, double s)
static tquat<double, Q> call(tquat<double, Q> const& q, double s)
{
tquat<double, P> Result;
tquat<double, Q> Result;
Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s));
return Result;
}
@ -143,11 +143,11 @@ namespace detail
# endif
template<qualifier Q>
struct compute_quat_div_scalar<float, P, true>
struct compute_quat_div_scalar<float, Q, true>
{
static tquat<float, P> call(tquat<float, Q> const& q, float s)
static tquat<float, Q> call(tquat<float, Q> const& q, float s)
{
vec<4, float, P> Result;
vec<4, float, Q> Result;
Result.data = _mm_div_ps(q.data, _mm_set_ps1(s));
return Result;
}
@ -155,11 +155,11 @@ namespace detail
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier Q>
struct compute_quat_div_scalar<double, P, true>
struct compute_quat_div_scalar<double, Q, true>
{
static tquat<double, P> call(tquat<double, Q> const& q, double s)
static tquat<double, Q> call(tquat<double, Q> const& q, double s)
{
tquat<double, P> Result;
tquat<double, Q> Result;
Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s));
return Result;
}
@ -167,9 +167,9 @@ namespace detail
# endif
template<qualifier Q>
struct compute_quat_mul_vec4<float, P, true>
struct compute_quat_mul_vec4<float, Q, true>
{
static vec<4, float, P> call(tquat<float, Q> const& q, vec<4, float, Q> const& v)
static vec<4, float, Q> call(tquat<float, Q> const& q, vec<4, float, Q> const& v)
{
__m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3));
__m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1));
@ -186,7 +186,7 @@ namespace detail
uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two));
uuv = _mm_mul_ps(uuv, two);
vec<4, float, P> Result;
vec<4, float, Q> Result;
Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv));
return Result;
}