Skip to content

Commit

Permalink
Math3D: Something wrong with hand simd optimization in vec2<float>, s…
Browse files Browse the repository at this point in the history
…o it causes very slow down.

However, compiler optimization is faster enough, so removed it.
  • Loading branch information
xebra committed Oct 7, 2018
1 parent c4a8d80 commit 62aaf63
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions GPU/Math3D.h
Expand Up @@ -1087,31 +1087,6 @@ __forceinline void Vec4<T>::ToRGBA(u8 *rgba) const
#if defined(_M_SSE)
// Specialized for SIMD optimization

// Vec2<float> operation
template<>
inline void Vec2<float>::operator += (const Vec2<float> &other)
{
vec = _mm_add_ps(vec, other.vec);
}

template<>
inline Vec2<float> Vec2<float>::operator + (const Vec2 &other) const
{
return Vec2<float>(_mm_add_ps(vec, other.vec));
}

template<>
inline Vec2<float> Vec2<float>::operator * (const Vec2 &other) const
{
return Vec2<float>(_mm_mul_ps(vec, other.vec));
}

template<> template<>
inline Vec2<float> Vec2<float>::operator * (const float &other) const
{
return Vec2<float>(_mm_mul_ps(vec, _mm_set_ps1(other)));
}

// Vec3<float> operation
template<>
inline void Vec3<float>::operator += (const Vec3<float> &other)
Expand Down

0 comments on commit 62aaf63

Please sign in to comment.