Skip to content

Repository files navigation

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

Achieved:

  • Acceleration for Vec4<T>, Quat<T>, Rect<T> and Mat44<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 of Quat<T>

  • Unlike Silk.NET.Maths and System.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

Not achieved:

  • Acceleration for Vec2<T> and Vec3<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

About

No description or website provided.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages