[release/8.0] JIT: Fixed containment of STOREIND of HW intrinsics ConvertTo*/Extract* by github-actions[bot] · Pull Request #92513 · dotnet/runtime (original) (raw)
Backport of #92396 to release/8.0
/cc @TIHan
Customer Impact
The customer has a custom-built software rasterizer and is using SSE2 hw-intrinsics to improve performance. In .NET 8, they were getting incorrect results compared to .NET 7 when using the Sse2.ConvertToInt32 API.
Specifically, when storing the result of Sse2.ConvertToInt32 or vector indexing in memory, the JIT would in certain cases store either too many bytes or too few bytes when applying its containment optimization. The fix is to ensure the proper sizes and otherwise give up on containment.
This change will fix that.
Original issues: #92349, #92590
Testing
Added regression tests of the hw-intrinsics Sse2.ConvertToInt32 and Extract to ensure that this will not happen again.
Risk
Very low risk. Only two lines were changed and will not regress performance.

