ISA backends float3 and float4 - cleanup history squash

working for both neon32 and neon64

Update math_backend.cpp

further sse simd additions

avx2 float3 added
added normalize_magnitude
added divide fast to float3 may copy to float4

move static spheremesh to drawSphere (initialize on first use) so platform has a chance to load the math backend

all float3 and float4 functions and isas

completed all options of float3 and float4 functions in isas and math_c
neon still to be done but that will be on mac.

Update math_backend.cpp

mac isa neon update

added float3
restructured the classes to look more like the final version of the x86 classes

linux required changes

Update build-macos-clang.yml

Update build-macos-clang.yml

Revert "Update build-macos-clang.yml"

This reverts commit 29dfc567f4.

Revert "Update build-macos-clang.yml"

This reverts commit 2abad2b4ca.

Update CMakeLists.txt

fix macs stupid build

remove god awful rolling average from frame time tracker....

use intrinsic headers instead

each isa implementation now uses a header for that isa's intrinsic functions these are then used in the impl files. This will make it easier for matrix functions when those are implemented.

fixed comment saying 256 when it should be 512 for avx512

consolidated initializers for function tables

Update neon_intrinsics.h

fixes for some neon intrinsics no idea if this is the best way to do these but they work at least

v_cross is especially messy at the moment we basically just do it as a c math function need to look into getting this done correctly
This commit is contained in:
marauder2k7 2026-02-26 16:45:13 +00:00
parent 73ed502ac9
commit 67f12311d4
36 changed files with 1481 additions and 419 deletions

View file

@ -26,10 +26,12 @@
#ifndef _MMATHFN_H_
#include "math/mMathFn.h"
#endif
#ifndef _MPOINT3_H_
#include "math/mPoint3.h"
#endif
#ifndef _MATH_BACKEND_H_
#include "math/public/math_backend.h"
#endif
//------------------------------------------------------------------------------
@ -61,6 +63,8 @@ class Point4I
/// Uses F32 internally.
///
/// Useful for representing quaternions and other 4d beasties.
using math_backend::float4::dispatch::gFloat4;
class Point4F
{
//-------------------------------------- Public data
@ -152,15 +156,12 @@ inline void Point4F::set(F32 _x, F32 _y, F32 _z, F32 _w)
inline F32 Point4F::len() const
{
return mSqrt(x*x + y*y + z*z + w*w);
return gFloat4.length(*this);
}
inline void Point4F::interpolate(const Point4F& _from, const Point4F& _to, F32 _factor)
{
x = (_from.x * (1.0f - _factor)) + (_to.x * _factor);
y = (_from.y * (1.0f - _factor)) + (_to.y * _factor);
z = (_from.z * (1.0f - _factor)) + (_to.z * _factor);
w = (_from.w * (1.0f - _factor)) + (_to.w * _factor);
gFloat4.lerp(_from, _to, _factor, *this);
}
inline void Point4F::zero()
@ -193,55 +194,55 @@ inline Point4F& Point4F::operator/=(F32 scalar)
if (mIsZero(scalar))
return *this;
F32 denom = 1 / scalar;
x *= denom;
y *= denom;
z *= denom;
w *= denom;
gFloat4.div_scalar(*this, scalar, *this);
return *this;
}
inline Point4F Point4F::operator+(const Point4F& _add) const
{
return Point4F( x + _add.x, y + _add.y, z + _add.z, w + _add.w );
Point4F res;
gFloat4.add(*this, _add, res);
return res;
}
inline Point4F& Point4F::operator+=(const Point4F& _add)
{
x += _add.x;
y += _add.y;
z += _add.z;
w += _add.w;
gFloat4.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 res;
gFloat4.sub(*this, _rSub, res);
return res;
}
inline Point4F Point4F::operator*(const Point4F &_vec) const
{
return Point4F(x * _vec.x, y * _vec.y, z * _vec.z, w * _vec.w);
Point4F res;
gFloat4.mul(*this, _vec, res);
return res;
}
inline Point4F Point4F::operator*(F32 _mul) const
{
return Point4F(x * _mul, y * _mul, z * _mul, w * _mul);
Point4F res;
gFloat4.mul_scalar(*this, _mul, res);
return res;
}
inline Point4F Point4F::operator /(F32 t) const
{
F32 f = 1.0f / t;
return Point4F( x * f, y * f, z * f, w * f );
Point4F res;
gFloat4.div_scalar(*this, t, res);
return res;
}
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 gFloat4.dot(p1, p2);
}
//------------------------------------------------------------------------------