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) BlendVariable on float ignores the sign-bit rule when the mask is byte-granular #133548
usingSystem;usingSystem.Runtime.CompilerServices;usingSystem.Runtime.Intrinsics;usingSystem.Runtime.Intrinsics.X86;classProgram{[MethodImpl(MethodImplOptions.NoInlining|MethodImplOptions.AggressiveOptimization)]staticuintTest(Vector128<float>value,Vector128<byte>l,Vector128<byte>r)=>Sse41.BlendVariable(Vector128<float>.Zero,value,Sse2.CompareEqual(l,r).AsSingle()).AsUInt32().GetElement(0);staticvoidMain(){if(!Sse41.IsSupported)thrownewPlatformNotSupportedException("SSE4.1 is required.");// Bytes 0 and 1 compare equal (0xFF), bytes 2 and 3 do not (0x00), so the first// 32-bit mask lane is 0x0000FFFF and its sign bit is clear. blendvps selects per// 32-bit lane using only that lane's sign bit, so lane 0 must come from Zero.varl=Vector128.Create((byte)1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0);varr=Vector128.Create((byte)1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0);varvalue=Vector128.Create(0x12345678u).AsSingle();Console.WriteLine(Test(value,l,r).ToString("X8"));}}
Expected
00000000
Actual
00005678
The result is value & mask computed bitwise, which is neither of the two operands blendvps
is allowed to select.
Platform
Windows x64, local Checked build of dotnet/runtime main (ef97eb5). Requires SSE4.1; also
reproduces with DOTNET_EnableAVX512=0 and DOTNET_EnableAVX=0.
It currently only exists in main (12.0). The repro still fails on the shipped 11.0 RC2 SDK (11.0.100-rc.2.26467.112), while 8.0.425, 9.0.318 and 10.0.401 all behave correctly, so this is a regression introduced during the 11.0 cycle rather than a long-standing bug — 11.0 would ship with it.
Note: this comment was produced by an AI agent; the repro was re-run against all four released SDKs to confirm the results above.
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.
Preserve mask element granularity in SIMD transformations (#133708)
EgorBo commentedon Sep 18, 2026
Affected SDK versions:
Preserve mask element granularity in SIMD transformations (dotnet#133708
EgorBo commentedon Sep 18, 2026
@tannergooding would you consider backporting the fix from #133708 to
release/11.0?It currently only exists in
main(12.0). The repro still fails on the shipped 11.0 RC2 SDK (11.0.100-rc.2.26467.112), while 8.0.425, 9.0.318 and 10.0.401 all behave correctly, so this is a regression introduced during the 11.0 cycle rather than a long-standing bug — 11.0 would ship with it.Note: this comment was produced by an AI agent; the repro was re-run against all four released SDKs to confirm the results above.
[release/11.0] Preserve mask element granularity in SIMD transformati…