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

@@ -416,14 +416,14 @@ public unsafe interface ISPMDLane<TSelf, TNumber> : ISPMDLane, IEquatable<TSelf>
/// <summary>
/// Computes a * b + c element-wise.
/// </summary>
/// <param name="a">The first multiplier.</param>
/// <param name="b">The second multiplier.</param>
/// <param name="c">The addend.</param>
/// <param name="left">The first multiplier.</param>
/// <param name="right">The second multiplier.</param>
/// <param name="addend">The addend.</param>
/// <returns>The result of the fused multiply-add operation.</returns>
/// <remarks>
/// Float and double implementations should use fused multiply-add instructions when available for both accuracy and performance.
/// </remarks>
static abstract TSelf MultiplyAdd(TSelf a, TSelf b, TSelf c);
static abstract TSelf MultiplyAdd(TSelf left, TSelf right, TSelf addend);
/// <summary>
/// Returns the minimum of the two lane values element-wise.
/// </summary>