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 an AVX-512 multiply changes its explicit rounding mode #133519
usingSystem;usingSystem.Runtime.CompilerServices;usingSystem.Runtime.Intrinsics;usingSystem.Runtime.Intrinsics.X86;classProgram{[MethodImpl(MethodImplOptions.NoInlining|MethodImplOptions.AggressiveOptimization)]staticVector512<float>Test(Vector512<float>x)=>-Avx512F.Multiply(x,Vector512.Create(1.5f),FloatRoundingMode.ToPositiveInfinity);staticvoidMain(){if(!Avx512F.IsSupported)thrownewPlatformNotSupportedException("AVX-512F is required.");floatx=BitConverter.Int32BitsToSingle(0x3F800001);Console.WriteLine(Test(Vector512.Create(x)).AsUInt32().GetElement(0).ToString("X8"));}}
Expected
BFC00002
The exact product is halfway between two floats. Rounding up gives 0x3FC00002; negating gives 0xBFC00002.
Actual
BFC00001
The negation moved inside the rounded multiply, so rounding went the wrong way.
Platform
Windows x64 with AVX-512F, .NET 11.0.0-rc.1.26425.128.
changed the title [-]JIT: negating an AVX-512 multiply changes its explicit rounding mode[/-][+]JIT: (bug) negating an AVX-512 multiply changes its explicit rounding mode[/+]on Sep 10, 2026
Activity
dotnet-policy-service commentedon Sep 9, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
[-]JIT: negating an AVX-512 multiply changes its explicit rounding mode[/-][+]JIT: (bug) negating an AVX-512 multiply changes its explicit rounding mode[/+]Fix optimizations of explicitly rounded hardware intrinsics (dotnet#1…
EgorBo commentedon Sep 18, 2026
Affected SDK versions: