mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-23 22:29:28 +00:00
Test simd math functions for float4 values
beginning implementation of float4 simd functions for x64 and neon
This commit is contained in:
parent
a7d92c344d
commit
6406ca1832
8 changed files with 305 additions and 389 deletions
|
|
@ -99,7 +99,8 @@ class Point4F
|
|||
Point4F operator*(F32) const;
|
||||
Point4F operator+(const Point4F&) const;
|
||||
Point4F& operator+=(const Point4F&);
|
||||
Point4F operator-(const Point4F&) const;
|
||||
Point4F operator-(const Point4F&) const;
|
||||
Point4F operator-=(const Point4F&);
|
||||
Point4F operator*(const Point4F&) const;
|
||||
Point4F& operator*=(const Point4F&);
|
||||
Point4F& operator=(const Point3F&);
|
||||
|
|
@ -205,32 +206,50 @@ inline Point4F& Point4F::operator/=(F32 scalar)
|
|||
|
||||
inline Point4F Point4F::operator+(const Point4F& _add) const
|
||||
{
|
||||
return Point4F( x + _add.x, y + _add.y, z + _add.z, w + _add.w );
|
||||
Point4F r;
|
||||
math_backend::float4::add(*this, _add, r);
|
||||
return r;
|
||||
|
||||
//return Point4F( x + _add.x, y + _add.y, z + _add.z, w + _add.w );
|
||||
}
|
||||
|
||||
inline Point4F& Point4F::operator+=(const Point4F& _add)
|
||||
{
|
||||
x += _add.x;
|
||||
y += _add.y;
|
||||
z += _add.z;
|
||||
w += _add.w;
|
||||
|
||||
math_backend::float4::add(*this, _add, *this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Point4F Point4F::operator-(const Point4F& _rSub) const
|
||||
{
|
||||
return Point4F( x - _rSub.x, y - _rSub.y, z - _rSub.z, w - _rSub.w );
|
||||
Point4F r;
|
||||
math_backend::float4::sub(*this, _rSub, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
inline Point4F Point4F::operator-=(const Point4F& _rSub)
|
||||
{
|
||||
math_backend::float4::sub(*this, _rSub, *this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Point4F Point4F::operator*(const Point4F &_vec) const
|
||||
{
|
||||
return Point4F(x * _vec.x, y * _vec.y, z * _vec.z, w * _vec.w);
|
||||
Point4F r;
|
||||
math_backend::float4::mul(*this, _vec, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
inline Point4F& Point4F::operator*=(const Point4F& _vec)
|
||||
{
|
||||
math_backend::float4::mul(*this, _vec, *this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Point4F Point4F::operator*(F32 _mul) const
|
||||
{
|
||||
return Point4F(x * _mul, y * _mul, z * _mul, w * _mul);
|
||||
Point4F r;
|
||||
math_backend::float4::mul_scalar(*this, _mul, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
inline Point4F Point4F::operator /(F32 t) const
|
||||
|
|
@ -241,7 +260,8 @@ inline Point4F Point4F::operator /(F32 t) const
|
|||
|
||||
inline F32 mDot(const Point4F &p1, const Point4F &p2)
|
||||
{
|
||||
return (p1.x*p2.x + p1.y*p2.y + p1.z*p2.z + p1.w*p2.w);
|
||||
return math_backend::float4::dot(p1, p2);
|
||||
//return (p1.x*p2.x + p1.y*p2.y + p1.z*p2.z + p1.w*p2.w);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue