Refactor vector API codegen and WideLane conversions

- Introduce IVectorAPIContext abstraction and supporting types for vectorized code generation
- Add Avx2APIContext and UtilityTemplate for AVX2-specific code emission
- Dynamically generate AVX2 sine methods in AVX2Rewriter
- Refactor WideLane<TNumber> to use Unsafe.BitCast for all Vector conversions
- Update all WideLane operators and math methods to use Unsafe.BitCast
- Change MultiplyAdd parameter names for clarity
- Remove static indices field in favor of Vector<TNumber>.Indices
- Add implicit conversion from Vector<TNumber> to WideLane<TNumber>
- Update tests and program files for compatibility
This commit is contained in:
2026-05-06 19:20:15 +09:00
parent c8f78f9d02
commit fd2d60c8f1
8 changed files with 439 additions and 84 deletions

View File

@@ -118,12 +118,6 @@ internal struct DistanceJob : IJobSPMD<float>
[TestClass]
public partial class SPMDTest
{
[HPCompute(TargetInstructionSet.AVX2)]
private static WideLane<float> Test(WideLane<float> a, WideLane<float> b, WideLane<float> c)
{
return WideLane<float>.MultiplyAdd(a, b, c);
}
[HPCompute(TargetInstructionSet.AVX2)]
private static (TFloat, TFloat) Test_SPMD<TFloat>(TFloat a, TFloat b, TFloat c)
where TFloat : unmanaged, ISPMDLane<TFloat, float>