This is prototype of generic linear algebraic objects using current state of System.Runtime.Intrinsics SIMD vectors.
Once was started as try to outperform Silk.NET, especially on matrix operations with double precision.
This stuff is made primarily for in-house engine, but it's possibly helpful draft for dotnet/runtime#24168
-
Acceleration for
Vec4<T>,Quat<T>,Rect<T>andMat44<T>- operations, various methods and type casts with usefull type combinations are effectively accelerated (with couple of unnecesary instructions generated by JIT in some places) -
All structs constrainted by
INumber<T>except ofQuat<T> -
Unlike
Silk.NET.MathsandSystem.Numerics, matrix 4x4 have accelerated method to construct affine matrix from quaternion, scale and translation vectors -
Unlike
Silk.NET.Maths, rectangle is defined as origin+max to effectively accelerate intersects/contains methods
- Acceleration for
Vec2<T>andVec3<T>- now there is no way to generate effective load/store operations for structs that not aligned to naturally register size (see)
Note
check benchmark reports for generated asm and timings
tested and benchmarked on AMD Ryzen 9 7900X that have
AVX512 - BITALG+VBMI2+VNNI+VPOPCNTDQ+IFMA+VBMI+F+BW+CD+DQ+VL
AVX2 - BMI1+BMI2+F16C+FMA+LZCNT+MOVBE
AVX+SSE3+SSSE3+SSE4.1+SSE4.2