Better FMA

This commit is contained in:
Youmu Liu
2026-03-05 18:04:34 +08:00
parent dfa6f4ba92
commit 83997f64d0
21 changed files with 893 additions and 1030 deletions
@@ -1,4 +1,4 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="NumericalModule"
// Project: StgSharp
@@ -25,9 +25,11 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Mathematics.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
@@ -36,12 +38,53 @@ namespace StgSharp.Mathematics.Numeric
public class NumericalModule : IStaticModule
{
public static unsafe int DefaultSIMDAlignment
{
get
{
SIMDID id = GlobalIntrinsicMask;
return (id.MaskByte[0] & 0b_00001111) switch
{
1 => id.MaskByte[1] switch
{
1 => 16,
2 => 32,
3 => 64,
4 => 64,
5 => 64,
_ => 8,
},
_ => 8,
};
}
}
public string ModuleName => "Math.Numerical";
internal static IntrinsicContext GlobalContext
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get;
} = new();
internal static SIMDID GlobalIntrinsicMask { get; set; }
public void InitializeModule()
{
throw new NotImplementedException();
}
public void InitializeModule(
IModuleInitializeProfile profile
)
{
MatrixParallel.Init();
}
public void UninitializeModule()
{
throw new NotImplementedException();
}
}
}