You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: (bug) negating the first operand of a scalar FMA drops the negation from the copied upper lanes #133553
usingSystem;usingSystem.Runtime.CompilerServices;usingSystem.Runtime.Intrinsics;usingSystem.Runtime.Intrinsics.X86;classProgram{[MethodImpl(MethodImplOptions.NoInlining|MethodImplOptions.AggressiveOptimization)]staticVector128<float>Test(Vector128<float>a,Vector128<float>b,Vector128<float>c)=>Fma.MultiplyAddScalar(-a,b,c);staticvoidMain(){if(!Fma.IsSupported)thrownewPlatformNotSupportedException("FMA is required.");// lane 0 = (-2)*10 + 1; lanes 1..3 are copied from the first operand, which is -a.varr=Test(Vector128.Create(2.0f,3.0f,4.0f,5.0f),Vector128.Create(10.0f),Vector128.Create(1.0f));Console.WriteLine($"{r.GetElement(0)}{r.GetElement(1)}{r.GetElement(2)}{r.GetElement(3)}");}}
Expected
-19 -3 -4 -5
Actual
-19 3 4 5
MultiplyAddScalar copies lanes 1..3 from its first operand, so they must come from -a, but
they come from the un-negated a instead.
Platform
Windows x64 with FMA, local Checked build of dotnet/runtime main (ef97eb5).
Also reproduces on release .NET 11.0.100-rc.1.26420.103, and at MinOpts.
Activity
dotnet-policy-service commentedon Sep 10, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
Fix SIMD complement and scalar FMA folding (dotnet#133542)
EgorBo commentedon Sep 18, 2026
Affected SDK versions: